Dynamic density change handling
- In PWM, make sure to read the height values after the new
configuration has been applied.
- Reset all navigation bar button icons when density changes.
- Adjust height of notification bar.
- Reload divider height values in SysUI and WM.
- Snap divider handle to a new position after loading the
new configuration, as the snap points change.
Bug: 26844819
Bug: 27450471
Bug: 27921696
Change-Id: I9e28f0c49f6367c5fcfac010e7a6e98a42e85996
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java b/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java
index ddd3ea1..d294c80 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/Divider.java
@@ -34,8 +34,6 @@
* Controls the docked stack divider.
*/
public class Divider extends SystemUI {
- private static final String TAG = "Divider";
- private int mDividerWindowWidth;
private DividerWindowManager mWindowManager;
private DividerView mView;
private DockDividerVisibilityListener mDockDividerVisibilityListener;
@@ -46,8 +44,6 @@
@Override
public void start() {
mWindowManager = new DividerWindowManager(mContext);
- mDividerWindowWidth = mContext.getResources().getDimensionPixelSize(
- com.android.internal.R.dimen.docked_stack_divider_thickness);
update(mContext.getResources().getConfiguration());
putComponent(Divider.class, this);
mDockDividerVisibilityListener = new DockDividerVisibilityListener();
@@ -70,9 +66,11 @@
mView = (DividerView)
LayoutInflater.from(mContext).inflate(R.layout.docked_stack_divider, null);
mView.setVisibility(mVisible ? View.VISIBLE : View.INVISIBLE);
+ final int size = mContext.getResources().getDimensionPixelSize(
+ com.android.internal.R.dimen.docked_stack_divider_thickness);
final boolean landscape = configuration.orientation == ORIENTATION_LANDSCAPE;
- final int width = landscape ? mDividerWindowWidth : MATCH_PARENT;
- final int height = landscape ? MATCH_PARENT : mDividerWindowWidth;
+ final int width = landscape ? size : MATCH_PARENT;
+ final int height = landscape ? MATCH_PARENT : size;
mWindowManager.add(mView, width, height);
mView.setWindowManager(mWindowManager);
}