Search in sources :

Example 1 with DialpadSearchEmptyContentView

use of com.android.dialer.app.widget.DialpadSearchEmptyContentView 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)

Aggregations

Resources (android.content.res.Resources)1 ViewGroup (android.view.ViewGroup)1 AbsListView (android.widget.AbsListView)1 OnScrollListener (android.widget.AbsListView.OnScrollListener)1 ListView (android.widget.ListView)1 DialpadSearchEmptyContentView (com.android.dialer.app.widget.DialpadSearchEmptyContentView)1 EmptyContentView (com.android.dialer.widget.EmptyContentView)1