Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a0077408 authored by Fengjiang Li's avatar Fengjiang Li
Browse files

[Predictive Back] Hide inactive recycler view when work profile is enabled on tablet

This CL will make sure scale animation doesn't reveal the offscreen main/work recycler view on tablet in all apps to home transition

Bug: b/267226558
Test: manual, see before/after video in bug
Change-Id: I9a8add0ac2c902e3f4315de099939f9297f6604a
parent ba73400f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@
    android:layout_gravity="center_horizontal|top"
    android:layout_marginTop="@dimen/all_apps_header_pill_height"
    android:clipChildren="true"
    android:clipToOutline="true"
    android:clipToPadding="false"
    android:descendantFocusability="afterDescendants"
    android:paddingTop="@dimen/all_apps_paged_view_top_padding"
+17 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.launcher3.allapps;

import static com.android.launcher3.allapps.ActivityAllAppsContainerView.AdapterHolder.SEARCH;
import static com.android.launcher3.allapps.AllAppsTransitionController.SWIPE_ALL_APPS_TO_HOME_MIN_SCALE;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_COUNT;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_TAP_ON_PERSONAL_TAB;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ALLAPPS_TAP_ON_WORK_TAB;
@@ -26,6 +27,7 @@ import android.animation.ValueAnimator;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Outline;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.Path.Direction;
@@ -44,12 +46,14 @@ import android.view.KeyEvent;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewOutlineProvider;
import android.view.WindowInsets;
import android.widget.Button;
import android.widget.RelativeLayout;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Px;
import androidx.annotation.VisibleForTesting;
import androidx.core.graphics.ColorUtils;
import androidx.recyclerview.widget.RecyclerView;
@@ -502,6 +506,19 @@ public class ActivityAllAppsContainerView<T extends Context & ActivityContext>
            mViewPager = (AllAppsPagedView) rvContainer;
            mViewPager.initParentViews(this);
            mViewPager.getPageIndicator().setOnActivePageChangedListener(this);
            mViewPager.setOutlineProvider(new ViewOutlineProvider() {
                @Override
                public void getOutline(View view, Outline outline) {
                    @Px final int bottomOffsetPx =
                            (int) (ActivityAllAppsContainerView.this.getMeasuredHeight()
                                    * SWIPE_ALL_APPS_TO_HOME_MIN_SCALE);
                    outline.setRect(
                            0,
                            0,
                            view.getMeasuredWidth(),
                            view.getMeasuredHeight() + bottomOffsetPx);
                }
            });

            mWorkManager.reset();
            post(() -> mAH.get(AdapterHolder.WORK).applyPadding());