@Override public void onHiddenChanged(boolean hidden) { super.onHiddenChanged(hidden); if (getActivity() != null && getView() != null && !hidden) { // If the padding was last applied when in a hidden state, it may have been applied // incorrectly. Therefore we need to reapply it. ContactListViewUtils.applyCardPaddingToView(getResources(), mListView, getView()); } }
protected void onCreateView(LayoutInflater inflater, ViewGroup container) { mView = inflateView(inflater, container); mListView = (ListView)mView.findViewById(android.R.id.list); if (mListView == null) { throw new RuntimeException( "Your content must have a ListView whose id attribute is " + "'android.R.id.list'"); } View emptyView = mView.findViewById(android.R.id.empty); if (emptyView != null) { mListView.setEmptyView(emptyView); } mListView.setOnItemClickListener(this); mListView.setOnItemLongClickListener(this); mListView.setOnFocusChangeListener(this); mListView.setOnTouchListener(this); mListView.setFastScrollEnabled(!isSearchMode()); // Tell list view to not show dividers. We'll do it ourself so that we can *not* show // them when an A-Z headers is visible. mListView.setDividerHeight(0); // We manually save/restore the listview state mListView.setSaveEnabled(false); configureVerticalScrollbar(); configurePhotoLoader(); getAdapter().setFragmentRootView(getView()); ContactListViewUtils.applyCardPaddingToView(getResources(), mListView, mView); }