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);
}
Aggregations