mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 19:28:10 +00:00
Merge "Handle configuration changes in floating rotation button" into sc-v2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
ed05712f04
@@ -37,6 +37,7 @@ import android.animation.ObjectAnimator;
|
||||
import android.annotation.DrawableRes;
|
||||
import android.annotation.IdRes;
|
||||
import android.annotation.LayoutRes;
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.Region;
|
||||
@@ -445,6 +446,12 @@ public class NavbarButtonsViewController {
|
||||
return mFloatingRotationButtonBounds.contains((int) ev.getX(), (int) ev.getY());
|
||||
}
|
||||
|
||||
public void onConfigurationChanged(@Config int configChanges) {
|
||||
if (mFloatingRotationButton != null) {
|
||||
mFloatingRotationButton.onConfigurationChanged(configChanges);
|
||||
}
|
||||
}
|
||||
|
||||
public void onDestroy() {
|
||||
mPropertyHolders.clear();
|
||||
mControllers.rotationButtonController.unregisterListeners();
|
||||
|
||||
@@ -30,6 +30,7 @@ import android.app.ActivityOptions;
|
||||
import android.content.ActivityNotFoundException;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
import android.content.pm.LauncherApps;
|
||||
import android.graphics.Insets;
|
||||
import android.graphics.PixelFormat;
|
||||
@@ -205,6 +206,10 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
mWindowManager.addView(mDragLayer, mWindowLayoutParams);
|
||||
}
|
||||
|
||||
public void onConfigurationChanged(@Config int configChanges) {
|
||||
mControllers.onConfigurationChanged(configChanges);
|
||||
}
|
||||
|
||||
public boolean isThreeButtonNav() {
|
||||
return mNavMode == Mode.THREE_BUTTONS;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package com.android.launcher3.taskbar;
|
||||
|
||||
import android.content.pm.ActivityInfo.Config;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.android.systemui.shared.rotation.RotationButtonController;
|
||||
@@ -108,6 +110,10 @@ public class TaskbarControllers {
|
||||
mPostInitCallbacks.clear();
|
||||
}
|
||||
|
||||
public void onConfigurationChanged(@Config int configChanges) {
|
||||
navbarButtonsViewController.onConfigurationChanged(configChanges);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cleans up all controllers.
|
||||
*/
|
||||
|
||||
@@ -106,6 +106,11 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
|
||||
if ((configDiff & configsRequiringRecreate) != 0) {
|
||||
// Color has changed, recreate taskbar to reload background color & icons.
|
||||
recreateTaskbar();
|
||||
} else {
|
||||
// Config change might be handled without re-creating the taskbar
|
||||
if (mTaskbarActivityContext != null) {
|
||||
mTaskbarActivityContext.onConfigurationChanged(configDiff);
|
||||
}
|
||||
}
|
||||
mOldConfig = newConfig;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user