[Search] Resolve afterimage when closing allapps

Preview: https://drive.google.com/file/d/1AM6WAY4kImCgHueNvH6eXUtnHgK3U6vo/view?usp=sharing&resourcekey=0-3mzBobzFuzQXCNZRUlToYA
Test: Manual
Bug: 184711608
Bug: 188556051
Change-Id: Ib43c71083460c236347dd1f340b1ad95d7d4aa15
This commit is contained in:
Samuel Fufa
2021-05-25 15:42:39 -05:00
parent 3350508bb6
commit 41f15a107f
5 changed files with 20 additions and 9 deletions

View File

@@ -37,6 +37,7 @@ import com.android.launcher3.Launcher;
import com.android.launcher3.LauncherState;
import com.android.launcher3.Utilities;
import com.android.launcher3.anim.AnimatorListeners;
import com.android.launcher3.anim.Interpolators;
import com.android.launcher3.anim.PendingAnimation;
import com.android.launcher3.anim.PropertySetter;
import com.android.launcher3.config.FeatureFlags;
@@ -56,6 +57,7 @@ import com.android.launcher3.views.ScrimView;
*/
public class AllAppsTransitionController
implements StateHandler<LauncherState>, OnDeviceProfileChangeListener {
private static final float CONTENT_VISIBLE_MAX_THRESHOLD = 0.5f;
public static final FloatProperty<AllAppsTransitionController> ALL_APPS_PROGRESS =
new FloatProperty<AllAppsTransitionController>("allAppsProgress") {
@@ -177,7 +179,8 @@ public class AllAppsTransitionController
int visibleElements = state.getVisibleElements(mLauncher);
boolean hasAllAppsContent = (visibleElements & ALL_APPS_CONTENT) != 0;
Interpolator allAppsFade = config.getInterpolator(ANIM_ALL_APPS_FADE, LINEAR);
Interpolator allAppsFade = config.getInterpolator(ANIM_ALL_APPS_FADE,
Interpolators.clampToProgress(LINEAR, 0, CONTENT_VISIBLE_MAX_THRESHOLD));
setter.setViewAlpha(mAppsView, hasAllAppsContent ? 1 : 0, allAppsFade);
boolean shouldProtectHeader =