use of com.android.dialer.widget.EmptyContentView in project android_packages_apps_Dialer by MoKee.
the class CallStatsFragment method onCreateView.
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedState) {
View view = inflater.inflate(R.layout.call_stats_fragment, container, false);
mAppBarLayout = (AppBarLayout) view.findViewById(R.id.app_bar_layout);
mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view);
mRecyclerView.setHasFixedSize(true);
mLayoutManager = new LinearLayoutManager(getActivity());
mRecyclerView.setLayoutManager(mLayoutManager);
mEmptyListView = (EmptyContentView) view.findViewById(R.id.empty_list_view);
mEmptyListView.setImage(R.drawable.empty_call_log);
mEmptyListView.setActionClickedListener(this);
mSumHeaderView = (TextView) view.findViewById(R.id.sum_header);
mDateFilterView = (TextView) view.findViewById(R.id.date_filter);
mFilterSubSpinnerView = (Spinner) view.findViewById(R.id.filter_sub_spinner);
mFilterStatusSpinnerView = (Spinner) view.findViewById(R.id.filter_status_spinner);
// Update the filter views.
updateFilterSpinnerViews();
return view;
}
use of com.android.dialer.widget.EmptyContentView in project android_packages_apps_Dialer by LineageOS.
the class SearchFragment method onStart.
@Override
public void onStart() {
LogUtil.d("SearchFragment.onStart", "");
super.onStart();
mActivity = (HostInterface) getActivity();
final Resources res = getResources();
mActionBarHeight = mActivity.getActionBarHeight();
mShadowHeight = res.getDrawable(R.drawable.search_shadow).getIntrinsicHeight();
mPaddingTop = res.getDimensionPixelSize(R.dimen.search_list_padding_top);
mShowDialpadDuration = res.getInteger(R.integer.dialpad_slide_in_duration);
mHideDialpadDuration = res.getInteger(R.integer.dialpad_slide_out_duration);
final ListView listView = getListView();
if (mEmptyView == null) {
if (this instanceof SmartDialSearchFragment) {
mEmptyView = new DialpadSearchEmptyContentView(getActivity());
} else {
mEmptyView = new EmptyContentView(getActivity());
}
((ViewGroup) getListView().getParent()).addView(mEmptyView);
getListView().setEmptyView(mEmptyView);
setupEmptyView();
}
listView.setBackgroundColor(res.getColor(R.color.background_dialer_results));
listView.setClipToPadding(false);
setVisibleScrollbarEnabled(false);
// Turn of accessibility live region as the list constantly update itself and spam messages.
listView.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_NONE);
ContentChangedFilter.addToParent(listView);
listView.setOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (mActivityScrollListener != null) {
mActivityScrollListener.onListFragmentScrollStateChange(scrollState);
}
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
}
});
if (mActivityOnTouchListener != null) {
listView.setOnTouchListener(mActivityOnTouchListener);
}
updatePosition(false);
}
use of com.android.dialer.widget.EmptyContentView in project android_packages_apps_Dialer by LineageOS.
the class ContactsFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.fragment_contacts, container, false);
fastScroller = view.findViewById(R.id.fast_scroller);
anchoredHeader = view.findViewById(R.id.header);
recyclerView = view.findViewById(R.id.recycler_view);
emptyContentView = view.findViewById(R.id.empty_list_view);
emptyContentView.setImage(R.drawable.empty_contacts);
emptyContentView.setActionClickedListener(this);
if (PermissionsUtil.hasContactsReadPermissions(getContext())) {
getLoaderManager().initLoader(0, null, this);
} else {
emptyContentView.setDescription(R.string.permission_no_contacts);
emptyContentView.setActionLabel(R.string.permission_single_turn_on);
emptyContentView.setVisibility(View.VISIBLE);
}
return view;
}
use of com.android.dialer.widget.EmptyContentView in project android_packages_apps_Dialer by MoKee.
the class SearchFragment method onStart.
@Override
public void onStart() {
super.onStart();
if (isSearchMode()) {
getAdapter().setHasHeader(0, false);
}
mActivity = (HostInterface) getActivity();
final Resources res = getResources();
mActionBarHeight = mActivity.getActionBarHeight();
mShadowHeight = res.getDrawable(R.drawable.search_shadow).getIntrinsicHeight();
mPaddingTop = res.getDimensionPixelSize(R.dimen.search_list_padding_top);
mShowDialpadDuration = res.getInteger(R.integer.dialpad_slide_in_duration);
mHideDialpadDuration = res.getInteger(R.integer.dialpad_slide_out_duration);
final View parentView = getView();
final ListView listView = getListView();
if (mEmptyView == null) {
mEmptyView = new EmptyContentView(getActivity());
((ViewGroup) getListView().getParent()).addView(mEmptyView);
getListView().setEmptyView(mEmptyView);
setupEmptyView();
}
listView.setBackgroundColor(res.getColor(R.color.background_dialer_results));
listView.setClipToPadding(false);
setVisibleScrollbarEnabled(false);
// Turn of accessibility live region as the list constantly update itself and spam messages.
listView.setAccessibilityLiveRegion(View.ACCESSIBILITY_LIVE_REGION_NONE);
ContentChangedFilter.addToParent(listView);
listView.setOnScrollListener(new OnScrollListener() {
@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
if (mActivityScrollListener != null) {
mActivityScrollListener.onListFragmentScrollStateChange(scrollState);
}
}
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
}
});
if (mActivityOnTouchListener != null) {
listView.setOnTouchListener(mActivityOnTouchListener);
}
updatePosition(false);
}
Aggregations