Java Code Examples for android.widget.ListView#setFooterDividersEnabled()

The following examples show how to use android.widget.ListView#setFooterDividersEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: StatsWidgetSettings.java    From Hangar with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    prefs = new PrefsGet(getSharedPreferences("StatsWidget", Context.MODE_PRIVATE));

    mContext = getApplicationContext();
    extras = getIntent().getExtras();

    setTitle(R.string.stats_widget_name);
    setResult(RESULT_CANCELED);
    getFragmentManager().beginTransaction().replace(android.R.id.content, new StatsWidgetFragment().newInstance()).commit();

    ListView v = getListView();
    v.setFooterDividersEnabled(false);

}
 
Example 2
Source File: AppsWidgetSettings.java    From Hangar with GNU General Public License v3.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    prefs = new PrefsGet(getSharedPreferences("AppsWidget", Context.MODE_PRIVATE));

    mContext = getApplicationContext();
    extras = getIntent().getExtras();

    super.onCreate(savedInstanceState);

    setTitle(R.string.apps_widget_name);
    setResult(RESULT_CANCELED);
    getFragmentManager().beginTransaction().replace(android.R.id.content, new StatsWidgetFragment().newInstance()).commit();

    ListView v = getListView();
    v.setFooterDividersEnabled(false);

}
 
Example 3
Source File: RecentActivityActivity.java    From Inside_Android_Testing with Apache License 2.0 6 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.recent_activity_layout);

    authenticationGateway = new AuthenticationGateway(apiGateway, this);
    recentActivities = new RecentActivities(apiGateway, authenticationGateway);

    ListView recentActivityListView = (ListView) findViewById(R.id.recent_activity_list);

    View loadingView = getLayoutInflater().inflate(R.layout.loading_view, recentActivityListView, false);
    recentActivityListView.addFooterView(loadingView, null, false);
    recentActivityListView.setFooterDividersEnabled(false);

    RecentActivityAdapter recentActivityAdapter = new RecentActivityAdapter(recentActivities, getLayoutInflater());
    recentActivityListView.setAdapter(recentActivityAdapter);

    showLoadingWhileOutstanding = new ViewVisibleWhileOutstandingCallbacks(loadingView);
    notifyDataSetChangedCallbacks = new NotifyDataSetChangedCallbacks(recentActivityAdapter);

    updateOrSignIn();
}
 
Example 4
Source File: PreferenceFragment.java    From MDPreference with Apache License 2.0 5 votes vote down vote up
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
    super.onViewCreated(view, savedInstanceState);
    ListView listView = (ListView) view.findViewById(android.R.id.list);
    listView.setPadding(PADDING_LEFT_RIGHT, 0, PADDING_LEFT_RIGHT, 0);
    listView.setHorizontalScrollBarEnabled(false);
    listView.setVerticalScrollBarEnabled(false);
    listView.setFooterDividersEnabled(false);
}
 
Example 5
Source File: SettingFragment.java    From MemoryCleaner with Apache License 2.0 5 votes vote down vote up
@Override public void initPreferenceListView(View view) {
    ListView listView = (ListView) view.findViewById(android.R.id.list);
    listView.setHorizontalScrollBarEnabled(false);
    listView.setVerticalScrollBarEnabled(false);
    listView.setDivider(
            new ColorDrawable(getResources().getColor(R.color.grey)));
    listView.setDividerHeight((int) getResources().getDimension(
            R.dimen.preference_divider_height));
    listView.setFooterDividersEnabled(false);
    listView.setHeaderDividersEnabled(false);
}
 
Example 6
Source File: RefreshLayout.java    From SwipeRefreshLayout with Apache License 2.0 5 votes vote down vote up
public void setFooterView(Context context, ListView mListView, int layoutId) {
    mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop();
    mListViewFooter = LayoutInflater.from(context).inflate(layoutId, null,
            false);
    mListView.addFooterView(mListViewFooter);
    mListView.setFooterDividersEnabled(false);
    this.mListView = mListView;
}
 
Example 7
Source File: AddTaskActivity.java    From Conquer with Apache License 2.0 5 votes vote down vote up
/**
 * 添加修改重复
 */
private void showRepeat() {
    ListView v = new ListView(context);
    v.setFooterDividersEnabled(false);
    final PopupWindow popupWindow = new PopupWindow(v, PixelUtil.dp2px(100), PixelUtil.dp2px(180));
    popupWindow.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.card_bg));
    popupWindow.setFocusable(true);
    popupWindow.setOutsideTouchable(true); // 点击popWin
    popupWindow.setOutsideTouchable(true); // 以处的区域,自动关闭

    int[] location = new int[2];
    tv_repeat.getLocationOnScreen(location);
    popupWindow.showAtLocation(v, Gravity.NO_GRAVITY, location[0], location[1] + tv_repeat.getHeight());

    final List<String> list = new ArrayList<>();
    list.add("单次");
    list.add("每天");
    list.add("每周");
    list.add("每月");
    v.setAdapter(new ArrayAdapter<String>(context, R.layout.item_list_simple, list));

    v.setOnItemClickListener(new AdapterView.OnItemClickListener() {
        @Override
        public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
            task.setRepeat(position);
            tv_repeat.setText(list.get(position));
            popupWindow.dismiss();
        }
    });

}
 
Example 8
Source File: AbstractUserListFragment.java    From iBeebo with GNU General Public License v3.0 5 votes vote down vote up
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.abs_userlist_listview_layout, container, false);
        // mToolbar = (Toolbar) view.findViewById(R.id.baseToolBar);

        empty = (TextView) view.findViewById(R.id.empty);
        mSwipeRefreshLayout = ViewUtility.findViewById(view, R.id.userListSRL);
        mSwipeRefreshLayout.setOnlyPullRefersh();

        mSwipeRefreshLayout.setEnableSount(SettingUtils.getEnableSound());
        pullToRefreshListView = (ListView) view.findViewById(R.id.listView);

//        mSwipeRefreshLayout.setOnRefreshListener(userOnRefreshListener);

        mSwipeRefreshLayout.setOnRefreshLoadMoreListener(userOnRefreshListener);

//        pullToRefreshListView.setOnLastItemVisibleListener(new UserListOnLastItemVisibleListener());
//        pullToRefreshListView.setOnPullEventListener(getPullEventListener());
        pullToRefreshListView.setOnScrollListener(new UserListOnScrollListener());
        pullToRefreshListView.setOnItemClickListener(new UserListOnItemClickListener());
        pullToRefreshListView.setFooterDividersEnabled(false);

        dismissFooterView();

        userListAdapter = new UserListAdapter(AbstractUserListFragment.this, bean.getUsers(), getListView());
        pullToRefreshListView.setAdapter(userListAdapter);

        return view;
    }
 
Example 9
Source File: ShowDevices.java    From coursera-android with MIT License 5 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
	final ListView lv = getListView();
	final TextView footer = new TextView(this);
	footer.setText("Discover More Devices");
	lv.setFooterDividersEnabled(true);
	lv.addFooterView(footer, null, true);

	final List<String> devices = getIntent().getStringArrayListExtra("devices");
	mArrayAdapter = new ArrayAdapter<String>(this, R.layout.list_item,devices);
	setListAdapter(mArrayAdapter);
	getListView().setOnItemClickListener(new OnItemClickListener() {
		@Override
		public void onItemClick(AdapterView<?> parent, View view, int pos,long id) {
			if (parent.getAdapter().getItemViewType(pos) == AdapterView.ITEM_VIEW_TYPE_HEADER_OR_FOOTER) {
				mBluetoothAdapter.startDiscovery();
			} else {
				String tmp = (String) parent.getItemAtPosition(pos);
				BluetoothDevice device = mBluetoothAdapter.getRemoteDevice(tmp.split("\n")[1]);
				Intent data = new Intent();
				data.putExtra(BluetoothDevice.EXTRA_DEVICE, device);
				setResult(RESULT_OK, data);
				finish();
			}
		}
	});
}
 
Example 10
Source File: AbstractUserListFragment.java    From iBeebo with GNU General Public License v3.0 5 votes vote down vote up
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.abs_userlist_listview_layout, container, false);
        // mToolbar = (Toolbar) view.findViewById(R.id.baseToolBar);

        empty = (TextView) view.findViewById(R.id.empty);
        mSwipeRefreshLayout = ViewUtility.findViewById(view, R.id.userListSRL);
        mSwipeRefreshLayout.setOnlyPullRefersh();

        mSwipeRefreshLayout.setEnableSount(SettingUtils.getEnableSound());
        pullToRefreshListView = (ListView) view.findViewById(R.id.listView);

//        mSwipeRefreshLayout.setOnRefreshListener(userOnRefreshListener);

        mSwipeRefreshLayout.setOnRefreshLoadMoreListener(userOnRefreshListener);

//        pullToRefreshListView.setOnLastItemVisibleListener(new UserListOnLastItemVisibleListener());
//        pullToRefreshListView.setOnPullEventListener(getPullEventListener());
        pullToRefreshListView.setOnScrollListener(new UserListOnScrollListener());
        pullToRefreshListView.setOnItemClickListener(new UserListOnItemClickListener());
        pullToRefreshListView.setFooterDividersEnabled(false);

        dismissFooterView();

        userListAdapter = new UserListAdapter(AbstractUserListFragment.this, bean.getUsers(), getListView());
        pullToRefreshListView.setAdapter(userListAdapter);

        return view;
    }
 
Example 11
Source File: CareAddEditBehaviorFragment.java    From arcusandroid with Apache License 2.0 4 votes vote down vote up
@Nullable @Override public View onCreateView(
      LayoutInflater inflater,
      @Nullable ViewGroup container,
      @Nullable Bundle savedInstanceState)
{
    View view = super.onCreateView(inflater, container, savedInstanceState);
    if (view == null) {
        return view;
    }


    TextView addEditTitle = (TextView) view.findViewById(R.id.care_add_edit_title);
    Bundle arguments = getArguments();
    if (arguments != null) {
        isEditMode = arguments.getBoolean(IS_EDIT, false);
        modelIDToEdit = arguments.getString(ID);
    }
    if (addEditTitle != null && arguments != null) {
        addEditTitle.setText(arguments.getString(DESCRIPTION, ""));
        addEditTitle.setTextColor(isEditMode ? getResources().getColor(R.color.white) : getResources().getColor(R.color.black));
    }

    setWallpaper();

    addEditButton = (Version1Button) view.findViewById(R.id.care_add_edit_save);
    if (addEditButton != null) {
        addEditButton.setColorScheme(isEditMode ? Version1ButtonColor.WHITE : Version1ButtonColor.BLACK);
    }

    behaviorSettingsListView = (ListView) view.findViewById(R.id.care_add_edit_behavior_lv);
    behaviorSettingsListView.setHeaderDividersEnabled(false);
    behaviorSettingsListView.setFooterDividersEnabled(false);

    oopsText = view.findViewById(R.id.behavior_ineligible);

    View divider = view.findViewById(R.id.divider);
    if (divider != null && isEditMode) {
        divider.setBackground(ContextCompat.getDrawable(getActivity(), R.color.overlay_white_with_10));
    }

    subText = (TextView) view.findViewById(R.id.care_add_edit_sub_title);
    if (isEditMode) {
        subText.setTextColor(getResources().getColor(R.color.overlay_white_with_60));
    }
    return view;
}
 
Example 12
Source File: MainActivity.java    From VCL-Android with Apache License 2.0 4 votes vote down vote up
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (!VLCInstance.testCompatibleCPU(this)) {
        finish();
        return;
    }
    /* Enable the indeterminate progress feature */
    supportRequestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

    /* Get the current version from package */
    mVersionNumber = BuildConfig.VERSION_CODE;

    /* Check if it's the first run */
    mFirstRun = mSettings.getInt(PREF_FIRST_RUN, -1) != mVersionNumber;
    if (mFirstRun) {
        Editor editor = mSettings.edit();
        editor.putInt(PREF_FIRST_RUN, mVersionNumber);
        Util.commitPreferences(editor);
    }

    mMediaLibrary = MediaLibrary.getInstance();
    if (mMediaLibrary.getMediaItems().isEmpty()) {
        if (mSettings.getBoolean(PreferencesActivity.AUTO_RESCAN, true))
            mMediaLibrary.scanMediaItems();
        else
            mMediaLibrary.loadMedaItems();
    }

    /*** Start initializing the UI ***/

    setContentView(R.layout.main);

    mDrawerLayout = (HackyDrawerLayout) findViewById(R.id.root_container);
    mListView = (ListView)findViewById(R.id.sidelist);
    mListView.setFooterDividersEnabled(true);
    mSidebarAdapter = new SidebarAdapter(this);
    mListView.setAdapter(mSidebarAdapter);

    initAudioPlayerContainerActivity();

    if (savedInstanceState != null){
        mCurrentFragment = savedInstanceState.getString("current");
        if (mCurrentFragment != null)
            mSidebarAdapter.setCurrentFragment(mCurrentFragment);
    }


    /* Initialize UI variables */
    mInfoLayout = findViewById(R.id.info_layout);
    mInfoProgress = (ProgressBar) findViewById(R.id.info_progress);
    mInfoText = (TextView) findViewById(R.id.info_text);

    /* Set up the action bar */
    prepareActionBar();

    /* Set up the sidebar click listener
     * no need to invalidate menu for now */
    mDrawerToggle = new ActionBarDrawerToggle(this, mDrawerLayout, R.string.drawer_open, R.string.drawer_close){
        @Override
        public void onDrawerClosed(View drawerView) {
            super.onDrawerClosed(drawerView);
            if (getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder) instanceof MediaBrowserFragment)
                ((MediaBrowserFragment) getSupportFragmentManager().findFragmentById(R.id.fragment_placeholder)).setReadyToDisplay(true);
        }
    };

    // Set the drawer toggle as the DrawerListener
    mDrawerLayout.setDrawerListener(mDrawerToggle);
    // set a custom shadow that overlays the main content when the drawer opens
    mDrawerLayout.setDrawerShadow(R.drawable.drawer_shadow, GravityCompat.START);

    mListView.setOnItemClickListener(this);

    if (mFirstRun) {
        /*
         * The sliding menu is automatically opened when the user closes
         * the info dialog. If (for any reason) the dialog is not shown,
         * open the menu after a short delay.
         */
        mHandler.postDelayed(new Runnable() {
            @Override
            public void run() {
                mDrawerLayout.openDrawer(mListView);
            }
        }, 500);
    }

    /* Reload the latest preferences */
    reloadPreferences();
}