Notify System UI about taskbar state

We want to move the rotation suggestion button to the middle
of the taskbar when it is visible and not stashed.
To do this we need to update System UI about the current
state of the taskbar.

Test: manual
Fixes: 187410455
Change-Id: Id918e10a44631362f7c3a8a8bb624ee80bdd3c8b
This commit is contained in:
Alex Chau
2021-06-30 10:24:11 +00:00
committed by Nick Chameyev
4 changed files with 33 additions and 8 deletions

View File

@@ -28,6 +28,7 @@ import com.android.launcher3.R;
import com.android.launcher3.Utilities;
import com.android.launcher3.util.MultiValueAlpha.AlphaProperty;
import com.android.quickstep.AnimatedFloat;
import com.android.quickstep.SystemUiProxy;
/**
* Coordinates between controllers such as TaskbarViewController and StashedHandleViewController to
@@ -104,6 +105,9 @@ public class TaskbarStashController {
mIsStashedInApp = supportsStashing()
&& mPrefs.getBoolean(SHARED_PREFS_STASHED_KEY, DEFAULT_STASHED_PREF);
SystemUiProxy.INSTANCE.get(mActivity)
.notifyTaskbarStatus(/* visible */ true, /* stashed */ mIsStashedInApp);
}
/**
@@ -166,6 +170,8 @@ public class TaskbarStashController {
mPrefs.edit().putBoolean(SHARED_PREFS_STASHED_KEY, mIsStashedInApp).apply();
boolean isStashed = mIsStashedInApp;
if (wasStashed != isStashed) {
SystemUiProxy.INSTANCE.get(mActivity)
.notifyTaskbarStatus(/* visible */ true, /* stashed */ isStashed);
createAnimToIsStashed(isStashed, TASKBAR_STASH_DURATION).start();
return true;
}