Fix DemoMode icon spacing
- Use the same margin on the left of Wi-Fi (2.5dp)
- DemoMode uses the padding of the view it's replacing, and WRAP_CONTENT
for the width of its children
- Fix DemoMode etc dot color
- Don't constrain number of icons if DemoMode is replacing an
unconstrained container
Test: visual;
adb shell settings put global sysui_demo_allowed 1 && \
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 0900 && \
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4 && \
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e datatype none -e level 4 && \
adb shell am broadcast -a com.android.systemui.demo -e command status -e bluetooth disconnected && \
adb shell am broadcast -a com.android.systemui.demo -e command battery -e level 100 -e plugged false
Change-Id: I1d1389f9c6d6cb7d6078af5bbe4bc21e42771560
Fixes: 79094455
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusIconContainer.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusIconContainer.java
index c97c8eb..8398879 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusIconContainer.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusIconContainer.java
@@ -73,19 +73,23 @@
public StatusIconContainer(Context context, AttributeSet attrs) {
super(context, attrs);
+ initDimens();
+ setWillNotDraw(!DEBUG_OVERFLOW);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
- setWillNotDraw(!DEBUG_OVERFLOW);
- initDimens();
}
public void setShouldRestrictIcons(boolean should) {
mShouldRestrictIcons = should;
}
+ public boolean isRestrictingIcons() {
+ return mShouldRestrictIcons;
+ }
+
private void initDimens() {
// This is the same value that StatusBarIconView uses
mIconDotFrameWidth = getResources().getDimensionPixelSize(
@@ -209,8 +213,8 @@
int childCount = getChildCount();
// Underflow === don't show content until that index
int firstUnderflowIndex = -1;
- if (DEBUG) android.util.Log.d(TAG, "calculateIconTransitions: start=" + translationX
- + " width=" + width);
+ if (DEBUG) android.util.Log.d(TAG, "calculateIconTranslations: start=" + translationX
+ + " width=" + width + " underflow=" + mNeedsUnderflow);
// Collect all of the states which want to be visible
for (int i = childCount - 1; i >= 0; i--) {