use of com.android.launcher3.views.RecyclerViewFastScroller in project android_packages_apps_Launcher3 by ArrowOS.
the class WidgetsFullSheet method onControllerInterceptTouchEvent.
@Override
public boolean onControllerInterceptTouchEvent(MotionEvent ev) {
// Disable swipe down when recycler view is scrolling
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
mNoIntercept = false;
RecyclerViewFastScroller scroller = getRecyclerView().getScrollbar();
if (scroller.getThumbOffsetY() >= 0 && getPopupContainer().isEventOverView(scroller, ev)) {
mNoIntercept = true;
} else if (getPopupContainer().isEventOverView(mContent, ev)) {
mNoIntercept = !getRecyclerView().shouldContainerScroll(ev, getPopupContainer());
}
if (mSearchScrollController.mSearchBar.isSearchBarFocused() && !getPopupContainer().isEventOverView(mSearchScrollController.mSearchBarContainer, ev)) {
mSearchScrollController.mSearchBar.clearSearchBarFocus();
}
}
return super.onControllerInterceptTouchEvent(ev);
}
use of com.android.launcher3.views.RecyclerViewFastScroller in project android_packages_apps_Launcher3 by ArrowOS.
the class WidgetsFullSheet method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mContent = findViewById(R.id.container);
LayoutInflater layoutInflater = LayoutInflater.from(getContext());
int contentLayoutRes = mHasWorkProfile ? R.layout.widgets_full_sheet_paged_view : R.layout.widgets_full_sheet_recyclerview;
layoutInflater.inflate(contentLayoutRes, mContent, true);
RecyclerViewFastScroller fastScroller = findViewById(R.id.fast_scroller);
mAdapters.get(AdapterHolder.PRIMARY).setup(findViewById(R.id.primary_widgets_list_view));
mAdapters.get(AdapterHolder.SEARCH).setup(findViewById(R.id.search_widgets_list_view));
if (mHasWorkProfile) {
mViewPager = findViewById(R.id.widgets_view_pager);
mViewPager.initParentViews(this);
mViewPager.getPageIndicator().setOnActivePageChangedListener(this);
mViewPager.getPageIndicator().setActiveMarker(AdapterHolder.PRIMARY);
findViewById(R.id.tab_personal).setOnClickListener((View view) -> mViewPager.snapToPage(0));
findViewById(R.id.tab_work).setOnClickListener((View view) -> mViewPager.snapToPage(1));
mAdapters.get(AdapterHolder.WORK).setup(findViewById(R.id.work_widgets_list_view));
} else {
mViewPager = null;
}
mNoWidgetsView = findViewById(R.id.no_widgets_text);
mSearchScrollController = new SearchAndRecommendationsScrollController(findViewById(R.id.search_and_recommendations_container));
mSearchScrollController.setCurrentRecyclerView(findViewById(R.id.primary_widgets_list_view));
mSearchScrollController.mRecommendedWidgetsTable.setWidgetCellLongClickListener(this);
mSearchScrollController.mRecommendedWidgetsTable.setWidgetCellOnClickListener(this);
onRecommendedWidgetsBound();
onWidgetsBound();
mSearchScrollController.mSearchBar.initialize(mActivityContext.getPopupDataProvider(), /* searchModeListener= */
this);
setUpEducationViewsIfNeeded();
}
Aggregations