summaryrefslogtreecommitdiff
path: root/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
diff options
context:
space:
mode:
authorFengjiang Li <fengjial@google.com>2023-01-29 16:57:22 -0800
committerFengjiang Li <fengjial@google.com>2023-02-01 10:18:52 -0800
commita007740815e96876d5a4c294245e45358915f222 (patch)
tree9e0cc90b05067efaf4bf90b116204fecf9abb174 /src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
parentba73400fe15034ff79e75b3f9c4b71e0e49cb4d5 (diff)
downloadLauncher3-a007740815e96876d5a4c294245e45358915f222.tar.gz
[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
Diffstat (limited to 'src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java')
-rw-r--r--src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
index 3bb8fb4391..f413318a10 100644
--- a/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
+++ b/src/com/android/launcher3/allapps/ActivityAllAppsContainerView.java
@@ -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());