Merge "Fix an issue with nav bar translations not being updated" into udc-dev am: a53261b9cd
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/23923806 Change-Id: Ifc99248dda1a45f3034a80ddca47e8dcc506cd3a Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -50,6 +50,7 @@ import com.android.quickstep.util.GroupTask;
|
|||||||
import com.android.quickstep.views.RecentsView;
|
import com.android.quickstep.views.RecentsView;
|
||||||
|
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A data source which integrates with a Launcher instance
|
* A data source which integrates with a Launcher instance
|
||||||
@@ -105,6 +106,10 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
|||||||
|
|
||||||
// Restore the in-app display progress from before Taskbar was recreated.
|
// Restore the in-app display progress from before Taskbar was recreated.
|
||||||
float[] prevProgresses = mControllers.getSharedState().inAppDisplayProgressMultiPropValues;
|
float[] prevProgresses = mControllers.getSharedState().inAppDisplayProgressMultiPropValues;
|
||||||
|
// Make a copy of the previous progress to set since updating the multiprop will update
|
||||||
|
// the property which also calls onInAppDisplayProgressChanged() which writes the current
|
||||||
|
// values into the shared state
|
||||||
|
prevProgresses = Arrays.copyOf(prevProgresses, prevProgresses.length);
|
||||||
for (int i = 0; i < prevProgresses.length; i++) {
|
for (int i = 0; i < prevProgresses.length; i++) {
|
||||||
mTaskbarInAppDisplayProgressMultiProp.get(i).setValue(prevProgresses[i]);
|
mTaskbarInAppDisplayProgressMultiProp.get(i).setValue(prevProgresses[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -923,6 +923,15 @@ public class NavbarButtonsViewController implements TaskbarControllers.LoggableT
|
|||||||
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
|
insetsInfo.setTouchableInsets(TOUCHABLE_INSETS_REGION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called whenever a new ui controller is set, and should update anything that depends on the
|
||||||
|
* ui controller.
|
||||||
|
*/
|
||||||
|
public void onUiControllerChanged() {
|
||||||
|
updateNavButtonInAppDisplayProgressForSysui();
|
||||||
|
updateNavButtonTranslationY();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dumpLogs(String prefix, PrintWriter pw) {
|
public void dumpLogs(String prefix, PrintWriter pw) {
|
||||||
pw.println(prefix + "NavbarButtonsViewController:");
|
pw.println(prefix + "NavbarButtonsViewController:");
|
||||||
|
|||||||
@@ -591,9 +591,7 @@ public class TaskbarActivityContext extends BaseTaskbarContext {
|
|||||||
* Sets a new data-source for this taskbar instance
|
* Sets a new data-source for this taskbar instance
|
||||||
*/
|
*/
|
||||||
public void setUIController(@NonNull TaskbarUIController uiController) {
|
public void setUIController(@NonNull TaskbarUIController uiController) {
|
||||||
mControllers.uiController.onDestroy();
|
mControllers.setUiController(uiController);
|
||||||
mControllers.uiController = uiController;
|
|
||||||
mControllers.uiController.init(mControllers);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -196,6 +196,19 @@ public class TaskbarControllers {
|
|||||||
mPostInitCallbacks.clear();
|
mPostInitCallbacks.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the ui controller.
|
||||||
|
*/
|
||||||
|
public void setUiController(@NonNull TaskbarUIController newUiController) {
|
||||||
|
uiController.onDestroy();
|
||||||
|
uiController = newUiController;
|
||||||
|
uiController.init(this);
|
||||||
|
uiController.updateStateForSysuiFlags(mSharedState.sysuiStateFlags);
|
||||||
|
|
||||||
|
// Notify that the ui controller has changed
|
||||||
|
navbarButtonsViewController.onUiControllerChanged();
|
||||||
|
}
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
public TaskbarSharedState getSharedState() {
|
public TaskbarSharedState getSharedState() {
|
||||||
// This should only be null if called before init() and after destroy().
|
// This should only be null if called before init() and after destroy().
|
||||||
|
|||||||
Reference in New Issue
Block a user