Hide task bar when folding before the new config renders the correct task bar

Currently on folding, onConfigurationChange doesn't return about 0.5sec after the small screen turns on. The old bar is visible on the new screen before a visual jump from rendering the new bar.

While the ideal solution is to figure out what causes the delay, we can mitigate the visual jump by dimming the old bar when folded listener returns folded

Test: repeatedly fold and unfold, observe that there is no glare task bar change in task bar area after folding
Bug: 291562764
Change-Id: Ic6834d2d3b7df01a8ef841dde601cdb6a3e481b0
This commit is contained in:
Tracy Zhou committed 2024-02-12 17:06:04 -08:00
1 parent e5451b10e4
commit dfb334f1e1
3 files changed
+58 -1

No files matched your search

@@ -36,12 +36,14 @@ import static com.android.launcher3.config.FeatureFlags.enableTaskbarPinning;
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_DRAGGING;
import static com.android.launcher3.taskbar.TaskbarAutohideSuspendController.FLAG_AUTOHIDE_SUSPEND_FULLSCREEN;
import static com.android.launcher3.taskbar.TaskbarDragLayerController.TASKBAR_REAPPEAR_DELAY_MS;
import static com.android.launcher3.testing.shared.ResourceUtils.getBoolByName;
import static com.android.quickstep.util.AnimUtils.completeRunnableListCallback;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_NOTIFICATION_PANEL_VISIBLE;
import static com.android.systemui.shared.system.QuickStepContract.SYSUI_STATE_VOICE_INTERACTION_WINDOW_SHOWING;
import android.animation.AnimatorSet;
import android.animation.ObjectAnimator;
import android.animation.ValueAnimator;
import android.app.ActivityOptions;
import android.content.ActivityNotFoundException;
@@ -77,6 +79,7 @@ import com.android.launcher3.DeviceProfile;
import com.android.launcher3.LauncherPrefs;
import com.android.launcher3.LauncherSettings.Favorites;
import com.android.launcher3.R;
import com.android.launcher3.anim.AnimatedFloat;
import com.android.launcher3.anim.AnimatorPlaybackController;
import com.android.launcher3.apppairs.AppPairIcon;
import com.android.launcher3.config.FeatureFlags;
@@ -1377,6 +1380,23 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
});
}
public void hideTaskbarWhenFolding() {
AnimatedFloat alphaAnim = mControllers.taskbarDragLayerController.getTaskbarAlpha();
alphaAnim.cancelAnimation();
alphaAnim.updateValue(0);
ObjectAnimator animator = alphaAnim.animateToValue(1).setDuration(0);
animator.setStartDelay(TASKBAR_REAPPEAR_DELAY_MS);
animator.start();
}
public void cancelHideTaskbarWhenFolding() {
mControllers.taskbarDragLayerController.getTaskbarAlpha().cancelAnimation();
}
public void resetHideTaskbarWhenUnfolding() {
mControllers.taskbarDragLayerController.getTaskbarAlpha().updateValue(1);
}
protected boolean isUserSetupComplete() {
return mIsUserSetupComplete;
}