Add a auto hide flag for Growth Framework nudge.

Test: manual
Bug: 411210699
Flag: com.android.launcher3.enable_growth_nudge
Change-Id: I2b13dbaf82c6d80410ede6610533846ced314f32
This commit is contained in:
Li Lin
2025-04-30 15:25:43 -07:00
parent bcceb28d2e
commit c78096c69e
2 changed files with 8 additions and 4 deletions
@@ -51,6 +51,8 @@ public class TaskbarAutohideSuspendController implements
public static final int FLAG_AUTOHIDE_SUSPEND_MULTI_INSTANCE_MENU_OPEN = 1 << 7;
// User has taskbar overflow open.
public static final int FLAG_AUTOHIDE_SUSPEND_TASKBAR_OVERFLOW = 1 << 8;
// Growth Framework nudge overlay is open above the Taskbar.
public static final int FLAG_AUTOHIDE_SUSPEND_GROWTH_NUDGE_OPEN = 1 << 9;
@IntDef(flag = true, value = {
FLAG_AUTOHIDE_SUSPEND_FULLSCREEN,
@@ -62,6 +64,7 @@ public class TaskbarAutohideSuspendController implements
FLAG_AUTOHIDE_SUSPEND_HOVERING_ICONS,
FLAG_AUTOHIDE_SUSPEND_MULTI_INSTANCE_MENU_OPEN,
FLAG_AUTOHIDE_SUSPEND_TASKBAR_OVERFLOW,
FLAG_AUTOHIDE_SUSPEND_GROWTH_NUDGE_OPEN,
})
@Retention(RetentionPolicy.SOURCE)
public @interface AutohideSuspendFlag {}
@@ -143,6 +146,8 @@ public class TaskbarAutohideSuspendController implements
"FLAG_AUTOHIDE_SUSPEND_MULTI_INSTANCE_MENU_OPEN");
appendFlag(str, flags, FLAG_AUTOHIDE_SUSPEND_TASKBAR_OVERFLOW,
"FLAG_AUTOHIDE_SUSPEND_TASKBAR_OVERFLOW");
appendFlag(str, flags, FLAG_AUTOHIDE_SUSPEND_GROWTH_NUDGE_OPEN,
"FLAG_AUTOHIDE_SUSPEND_GROWTH_NUDGE_OPEN");
return str.toString();
}
}
@@ -32,7 +32,7 @@ import com.airbnb.lottie.LottieAnimationView
import com.android.launcher3.R
import com.android.launcher3.Utilities
import com.android.launcher3.taskbar.TaskbarActivityContext
import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_EDU_OPEN
import com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_GROWTH_NUDGE_OPEN
import com.android.launcher3.taskbar.TaskbarControllers
import com.android.launcher3.taskbar.TaskbarControllers.LoggableTaskbarController
import com.android.launcher3.views.ActivityContext
@@ -151,16 +151,15 @@ class NudgeController(context: Context) : LoggableTaskbarController {
false,
) as NudgeView
// TODO: b/411210699 - considering adding a auto hide suspend flag for the nudge.
controllers.taskbarAutohideSuspendController.updateFlag(
FLAG_AUTOHIDE_SUSPEND_EDU_OPEN,
FLAG_AUTOHIDE_SUSPEND_GROWTH_NUDGE_OPEN,
true,
)
nudgeView.onCloseCallback = {
this.nudgeView = null
controllers.taskbarAutohideSuspendController.updateFlag(
FLAG_AUTOHIDE_SUSPEND_EDU_OPEN,
FLAG_AUTOHIDE_SUSPEND_GROWTH_NUDGE_OPEN,
false,
)
controllers.taskbarStashController.updateAndAnimateTransientTaskbar(true)