List of usage examples for android.widget ListView setDivider
public void setDivider(@Nullable Drawable divider)
From source file:me.tylerbwong.pokebase.gui.fragments.PreferencesFragment.java
@Override public void onResume() { super.onResume(); updatePreference.setSummary(R.string.check_updates); if (!listStyled) { View rootView = getView(); if (rootView != null) { ListView list = (ListView) rootView.findViewById(android.R.id.list); list.setPadding(0, 0, 0, 0); list.setDivider(null); //any other styling call listStyled = true;// ww w .j a v a2 s. c o m } } }
From source file:org.tanrabad.team.ChatFragment.java
private void turnOffListViewDecoration(ListView listView) { listView.setDivider(null); listView.setDividerHeight(0);/* ww w . j a va 2 s.co m*/ listView.setHorizontalFadingEdgeEnabled(false); listView.setVerticalFadingEdgeEnabled(false); listView.setHorizontalScrollBarEnabled(false); listView.setVerticalScrollBarEnabled(true); listView.setSelector(new ColorDrawable(0x00ffffff)); listView.setCacheColorHint(0x00000000); // For Gingerbread scrolling bug fix }
From source file:org.chromium.chrome.browser.preferences.website.UsbDevicePreferences.java
@Override @SuppressWarnings("unchecked") public void onActivityCreated(Bundle savedInstanceState) { addPreferencesFromResource(R.xml.usb_device_preferences); ListView listView = (ListView) getView().findViewById(android.R.id.list); listView.setDivider(null); int contentSettingsType = getArguments().getInt(EXTRA_CATEGORY); mCategory = SiteSettingsCategory.fromContentSettingsType(contentSettingsType); mUsbInfos = (ArrayList<UsbInfo>) getArguments().getSerializable(EXTRA_USB_INFOS); mUsbInfo = mUsbInfos.get(0);// ww w . ja v a 2 s.c o m mSites = (ArrayList<Website>) getArguments().getSerializable(EXTRA_SITES); String title = getArguments().getString(SingleCategoryPreferences.EXTRA_TITLE); if (title != null) getActivity().setTitle(title); setHasOptionsMenu(true); super.onActivityCreated(savedInstanceState); }
From source file:com.farmerbb.taskbar.fragment.SettingsFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // Remove dividers View rootView = getView();//from ww w . ja va 2s.c om if (rootView != null) { ListView list = (ListView) rootView.findViewById(android.R.id.list); if (list != null) list.setDivider(null); } // Set values setRetainInstance(true); setHasOptionsMenu(true); // On smaller-screened devices, set "Grid" as the default start menu layout SharedPreferences pref = U.getSharedPreferences(getActivity()); if (getActivity().getApplicationContext().getResources().getConfiguration().smallestScreenWidthDp < 600 && pref.getString("start_menu_layout", "null").equals("null")) { pref.edit().putString("start_menu_layout", "grid").apply(); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && !Build.MANUFACTURER.equalsIgnoreCase("Samsung")) { if (!pref.getBoolean("freeform_hack_override", false)) { pref.edit().putBoolean("freeform_hack", U.hasFreeformSupport(getActivity())) .putBoolean("freeform_hack_override", true).apply(); } else if (!U.hasFreeformSupport(getActivity())) { pref.edit().putBoolean("freeform_hack", false).apply(); LocalBroadcastManager.getInstance(getActivity()) .sendBroadcast(new Intent("com.farmerbb.taskbar.FINISH_FREEFORM_ACTIVITY")); } } }
From source file:com.uwetrottmann.movies.ui.LocalMoviesFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // set list adapter mAdapter = new MoviesCursorAdapter(getActivity()); setListAdapter(mAdapter);/*w w w .j av a 2 s. c om*/ // style list view final ListView list = getListView(); list.setDivider(getResources().getDrawable(R.drawable.divider_horizontal_holo_dark)); list.setClipToPadding(AndroidUtils.isHoneycombOrHigher() ? false : true); final float scale = getResources().getDisplayMetrics().density; int layoutPadding = (int) (10 * scale + 0.5f); int defaultPadding = (int) (8 * scale + 0.5f); list.setPadding(layoutPadding, layoutPadding, layoutPadding, defaultPadding); list.setFastScrollEnabled(true); onListLoad(true); }
From source file:com.uwetrottmann.movies.ui.MovieDetailsFragment.java
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); // set list adapter mAdapter = new MovieSummaryAdapter(getSherlockActivity(), getFragmentManager()); setListAdapter(mAdapter);/*from w w w . j a v a 2s. co m*/ // style list view final ListView list = getListView(); list.setDivider(null); list.setSelector(R.color.transparent); // nag about no connectivity if (!AndroidUtils.isNetworkConnected(getActivity())) { setEmptyText(getString(R.string.offline)); setListShown(true); } else { setEmptyText(getString(R.string.details_empty)); setListShown(false); getLoaderManager().initLoader(MOVIE_LOADER_ID, getArguments(), this); } }
From source file:me.tylerbwong.pokebase.gui.fragments.PreferencesFragment.java
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); pref = getActivity().getSharedPreferences(SplashActivity.ACTIVITY_PREF, Context.MODE_PRIVATE); View rootView = getView();// w w w.j a va 2 s . c o m ListView list = null; if (rootView != null) { list = rootView.findViewById(android.R.id.list); } if (list != null) { list.setDivider(null); } PackageInfo packageInfo = null; try { packageInfo = getActivity().getPackageManager().getPackageInfo(getActivity().getPackageName(), 0); } catch (PackageManager.NameNotFoundException e) { } addPreferencesFromResource(R.xml.preferences); namePreference = getPreferenceScreen().findPreference(getString(R.string.trainer_name_key)); updatePreference = getPreferenceScreen().findPreference(getString(R.string.update_key)); versionPreference = getPreferenceScreen().findPreference(getString(R.string.version_key)); namePreference.setOnPreferenceClickListener(this); updatePreference.setOnPreferenceClickListener(this); namePreference.setSummary(pref.getString(SignUpActivity.USERNAME, "Error")); if (packageInfo != null) { versionPreference.setSummary(packageInfo.versionName); } }
From source file:io.indy.drone.fragment.StrikeListFragment.java
@Override public void onViewCreated(View view, Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ListView lv = getListView(); lv.setDivider(null); lv.setDividerHeight(0);// w w w . j av a2 s .com // Restore the previously serialized activated item position. if (savedInstanceState != null && savedInstanceState.containsKey(STATE_ACTIVATED_POSITION)) { setActivatedPosition(savedInstanceState.getInt(STATE_ACTIVATED_POSITION)); } // This is the View which is created by ListFragment ViewGroup viewGroup = (ViewGroup) view; // We need to create a PullToRefreshLayout manually mPullToRefreshLayout = new PullToRefreshLayout(viewGroup.getContext()); // We can now setup the PullToRefreshLayout ActionBarPullToRefresh.from(getActivity()) // We need to insert the PullToRefreshLayout into the Fragment's ViewGroup .insertLayoutInto(viewGroup) // We need to mark the ListView and it's Empty View as pullable // This is because they are not direct children of the ViewGroup .theseChildrenArePullable(getListView(), getListView().getEmptyView()) // We can now complete the setup as desired .listener(new OnRefreshListener() { @Override public void onRefreshStarted(View view) { Intent intent = new Intent(getActivity(), ScheduledService.class); intent.putExtra(StrikeListActivity.ResponseReceiver.IS_PTR, true); getActivity().startService(intent); } }).setup(mPullToRefreshLayout); }
From source file:com.roque.rueda.cashflows.fragments.AccountListFragment.java
/** * Set the listeners for this ListView.//from w w w. j ava 2 s. com */ private void setListerners() { ListView lv = getListView(); lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE); lv.setDivider(getResources().getDrawable(R.color.divider_blue)); lv.setDividerHeight(1); }
From source file:org.chromium.chrome.browser.preferences.website.UsbChooserPreferences.java
@Override public void onActivityCreated(Bundle savedInstanceState) { addPreferencesFromResource(R.xml.usb_chooser_preferences); ListView listView = (ListView) getView().findViewById(android.R.id.list); mEmptyView = (TextView) getView().findViewById(android.R.id.empty); listView.setEmptyView(mEmptyView);// w ww . j a va2 s . c o m listView.setDivider(null); String category = getArguments().getString(SingleCategoryPreferences.EXTRA_CATEGORY); mCategory = SiteSettingsCategory.fromString(category); String title = getArguments().getString(SingleCategoryPreferences.EXTRA_TITLE); getActivity().setTitle(title); setHasOptionsMenu(true); super.onActivityCreated(savedInstanceState); }