setFooterDividersEnabled ( )源码实例Demo

android.widget.ListView#setFooterDividersEnabled ( )源码实例Demo

下面列出了android.widget.ListView#setFooterDividersEnabled ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: Hangar   文件: StatsWidgetSettings.java
@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);

}
 
源代码2 项目: Hangar   文件: AppsWidgetSettings.java
@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);

}
 
@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();
}
 
源代码4 项目: MDPreference   文件: PreferenceFragment.java
@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);
}
 
源代码5 项目: MemoryCleaner   文件: SettingFragment.java
@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);
}
 
源代码6 项目: SwipeRefreshLayout   文件: RefreshLayout.java
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;
}
 
源代码7 项目: Conquer   文件: AddTaskActivity.java
/**
 * 添加修改重复
 */
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();
        }
    });

}
 
源代码8 项目: iBeebo   文件: AbstractUserListFragment.java
@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;
    }
 
源代码9 项目: coursera-android   文件: ShowDevices.java
@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();
			}
		}
	});
}
 
源代码10 项目: iBeebo   文件: AbstractUserListFragment.java
@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;
    }
 
源代码11 项目: arcusandroid   文件: CareAddEditBehaviorFragment.java
@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;
}
 
源代码12 项目: VCL-Android   文件: MainActivity.java
@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();
}
 
源代码评论
动弹
沙发等你来抢
 方法所在类