Search in sources :

Example 1 with EmptyContentView

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;
}
Also used : LinearLayoutManager(android.support.v7.widget.LinearLayoutManager) View(android.view.View) AdapterView(android.widget.AdapterView) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) EmptyContentView(com.android.dialer.widget.EmptyContentView)

Example 2 with EmptyContentView

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);
}
Also used : AbsListView(android.widget.AbsListView) ListView(android.widget.ListView) DialpadSearchEmptyContentView(com.android.dialer.app.widget.DialpadSearchEmptyContentView) EmptyContentView(com.android.dialer.widget.EmptyContentView) OnScrollListener(android.widget.AbsListView.OnScrollListener) DialpadSearchEmptyContentView(com.android.dialer.app.widget.DialpadSearchEmptyContentView) ViewGroup(android.view.ViewGroup) AbsListView(android.widget.AbsListView) Resources(android.content.res.Resources)

Example 3 with EmptyContentView

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;
}
Also used : View(android.view.View) RecyclerView(android.support.v7.widget.RecyclerView) TextView(android.widget.TextView) EmptyContentView(com.android.dialer.widget.EmptyContentView) Nullable(android.support.annotation.Nullable)

Example 4 with EmptyContentView

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);
}
Also used : AbsListView(android.widget.AbsListView) ListView(android.widget.ListView) EmptyContentView(com.android.dialer.widget.EmptyContentView) OnScrollListener(android.widget.AbsListView.OnScrollListener) ViewGroup(android.view.ViewGroup) AbsListView(android.widget.AbsListView) Resources(android.content.res.Resources) View(android.view.View) AbsListView(android.widget.AbsListView) ContactListItemView(com.android.contacts.common.list.ContactListItemView) ListView(android.widget.ListView) EmptyContentView(com.android.dialer.widget.EmptyContentView)

Aggregations

EmptyContentView (com.android.dialer.widget.EmptyContentView)4 View (android.view.View)3 Resources (android.content.res.Resources)2 RecyclerView (android.support.v7.widget.RecyclerView)2 ViewGroup (android.view.ViewGroup)2 AbsListView (android.widget.AbsListView)2 OnScrollListener (android.widget.AbsListView.OnScrollListener)2 ListView (android.widget.ListView)2 TextView (android.widget.TextView)2 Nullable (android.support.annotation.Nullable)1 LinearLayoutManager (android.support.v7.widget.LinearLayoutManager)1 AdapterView (android.widget.AdapterView)1 ContactListItemView (com.android.contacts.common.list.ContactListItemView)1 DialpadSearchEmptyContentView (com.android.dialer.app.widget.DialpadSearchEmptyContentView)1