Search in sources :

Example 11 with RecyclerViewFastScroller

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);
}
Also used : RecyclerViewFastScroller(com.android.launcher3.views.RecyclerViewFastScroller)

Example 12 with RecyclerViewFastScroller

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();
}
Also used : LayoutInflater(android.view.LayoutInflater) RecyclerViewFastScroller(com.android.launcher3.views.RecyclerViewFastScroller) PersonalWorkPagedView(com.android.launcher3.workprofile.PersonalWorkPagedView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) WidgetsEduView(com.android.launcher3.views.WidgetsEduView) TextView(android.widget.TextView) ArrowTipView(com.android.launcher3.views.ArrowTipView)

Aggregations

RecyclerViewFastScroller (com.android.launcher3.views.RecyclerViewFastScroller)12 LayoutInflater (android.view.LayoutInflater)5 View (android.view.View)5 TextView (android.widget.TextView)5 RecyclerView (androidx.recyclerview.widget.RecyclerView)5 ArrowTipView (com.android.launcher3.views.ArrowTipView)5 WidgetsEduView (com.android.launcher3.views.WidgetsEduView)5 PersonalWorkPagedView (com.android.launcher3.workprofile.PersonalWorkPagedView)5 TopRoundedCornerView (com.android.launcher3.views.TopRoundedCornerView)1