Fix private space icons disappearing from search state.

This is because during onBind() that the icon alpha should be set to 0 ONLY in the case
when animation + scroll is happening.

The repro cuj is this:
user has private space unlocked -> goes to toast and clicks qs tile -> onBind() happens
and animationScrolling = true -> icon alpha is now 0. Instead we should check getAnimate() && scrolling()
&& isStateTransitioning()

bug: 340836439
Test: manually -
before: https://drive.google.com/file/d/1WLZRPsz-hm1d3fVRNGXs_Ps_AcdJhkPs/view?usp=sharing
after: https://drive.google.com/file/d/1LidDKhx2ijOXmX_tcPAmng5P56WNPyyx/view?usp=sharing
Flag: ACONFIG com.android.launcher3.Flags.private_space_animation NEXTFOOD
Change-Id: I10b8ee5d8449acdb3d2c64e0e311f7dde89a464a
This commit is contained in:
Brandon Dayauon
2024-05-28 09:09:53 -07:00
parent a2bbe1c5c8
commit 987efd6ea4
3 changed files with 41 additions and 25 deletions
@@ -267,13 +267,15 @@ public abstract class BaseAllAppsAdapter<T extends Context & ActivityContext> ex
PrivateProfileManager privateProfileManager = mApps.getPrivateProfileManager();
if (privateProfileManager != null) {
// Set the alpha of the private space icon to 0 upon expanding the header so the
// alpha can animate -> 1.
// alpha can animate -> 1. This should only be in effect when doing a
// transitioning between Locked/Unlocked state.
boolean isPrivateSpaceItem =
privateProfileManager.isPrivateSpaceItem(adapterItem);
if (icon.getAlpha() == 0 || icon.getAlpha() == 1) {
icon.setAlpha(isPrivateSpaceItem
&& (privateProfileManager.getAnimationScrolling() ||
privateProfileManager.getAnimate())
&& privateProfileManager.isStateTransitioning()
&& (privateProfileManager.isScrolling() ||
privateProfileManager.getReadyToAnimate())
&& privateProfileManager.getCurrentState() == STATE_ENABLED
? 0 : 1);
}