Search in sources :

Example 1 with TopRoundedCornerView

use of com.android.launcher3.views.TopRoundedCornerView in project android_packages_apps_Launcher3 by crdroidandroid.

the class WidgetsFullSheet method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mContent = findViewById(R.id.container);
    TopRoundedCornerView springLayout = (TopRoundedCornerView) mContent;
    LayoutInflater layoutInflater = LayoutInflater.from(getContext());
    int contentLayoutRes = mHasWorkProfile ? R.layout.widgets_full_sheet_paged_view : R.layout.widgets_full_sheet_recyclerview;
    layoutInflater.inflate(contentLayoutRes, springLayout, 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);
        mTabsView = findViewById(R.id.tabs);
        findViewById(R.id.tab_personal).setOnClickListener((View view) -> mViewPager.snapToPage(0));
        findViewById(R.id.tab_work).setOnClickListener((View view) -> mViewPager.snapToPage(1));
        fastScroller.setIsRecyclerViewFirstChildInParent(false);
        mAdapters.get(AdapterHolder.WORK).setup(findViewById(R.id.work_widgets_list_view));
    } else {
        mViewPager = null;
    }
    layoutInflater.inflate(R.layout.widgets_full_sheet_search_and_recommendations, springLayout, true);
    mNoWidgetsView = findViewById(R.id.no_widgets_text);
    mSearchAndRecommendationViewHolder = new SearchAndRecommendationViewHolder(findViewById(R.id.search_and_recommendations_container));
    TopRoundedCornerView.LayoutParams layoutParams = (TopRoundedCornerView.LayoutParams) mSearchAndRecommendationViewHolder.mContainer.getLayoutParams();
    layoutParams.bottomMargin = mSearchAndRecommendationContainerBottomMargin;
    mSearchAndRecommendationViewHolder.mContainer.setLayoutParams(layoutParams);
    mSearchAndRecommendationsScrollController = new SearchAndRecommendationsScrollController(mHasWorkProfile, mTabsHeight, mSearchAndRecommendationViewHolder, findViewById(R.id.primary_widgets_list_view), mHasWorkProfile ? findViewById(R.id.work_widgets_list_view) : null, findViewById(R.id.search_widgets_list_view), mTabsView, mViewPager, mNoWidgetsView);
    fastScroller.setOnFastScrollChangeListener(mSearchAndRecommendationsScrollController);
    onRecommendedWidgetsBound();
    onWidgetsBound();
    mSearchAndRecommendationViewHolder.mSearchBar.initialize(mActivityContext.getPopupDataProvider(), /* searchModeListener= */
    this);
    setUpEducationViewsIfNeeded();
}
Also used : TopRoundedCornerView(com.android.launcher3.views.TopRoundedCornerView) 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) TopRoundedCornerView(com.android.launcher3.views.TopRoundedCornerView) ArrowTipView(com.android.launcher3.views.ArrowTipView)

Example 2 with TopRoundedCornerView

use of com.android.launcher3.views.TopRoundedCornerView in project Neo-Launcher by NeoApplications.

the class WidgetsFullSheet method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mContent = findViewById(R.id.container);
    mRecyclerView = findViewById(R.id.widgets_list_view);
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.setApplyBitmapDeferred(true, mRecyclerView);
    TopRoundedCornerView springLayout = (TopRoundedCornerView) mContent;
    springLayout.addSpringView(R.id.widgets_list_view);
    mRecyclerView.setEdgeEffectFactory(springLayout.createEdgeEffectFactory());
    onWidgetsBound();
}
Also used : TopRoundedCornerView(com.android.launcher3.views.TopRoundedCornerView)

Example 3 with TopRoundedCornerView

use of com.android.launcher3.views.TopRoundedCornerView in project android_packages_apps_Trebuchet by LineageOS.

the class WidgetsFullSheet method onFinishInflate.

@Override
protected void onFinishInflate() {
    super.onFinishInflate();
    mContent = findViewById(R.id.container);
    mRecyclerView = findViewById(R.id.widgets_list_view);
    mRecyclerView.setAdapter(mAdapter);
    mAdapter.setApplyBitmapDeferred(true, mRecyclerView);
    TopRoundedCornerView springLayout = (TopRoundedCornerView) mContent;
    springLayout.addSpringView(R.id.widgets_list_view);
    mRecyclerView.setEdgeEffectFactory(springLayout.createEdgeEffectFactory());
    onWidgetsBound();
}
Also used : TopRoundedCornerView(com.android.launcher3.views.TopRoundedCornerView)

Aggregations

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