Loading packages/SystemUI/res/values/integers.xml +8 −0 Original line number Diff line number Diff line Loading @@ -37,4 +37,12 @@ <dimen name="percent_displacement_at_fade_out" format="float">0.1066</dimen> <integer name="qs_carrier_max_em">7</integer> <!-- Maximum number of notification icons shown on the Always on Display (excluding overflow dot) --> <integer name="max_notif_icons_on_aod">3</integer> <!-- Maximum number of notification icons shown on the lockscreen (excluding overflow dot) --> <integer name="max_notif_icons_on_lockscreen">3</integer> <!-- Maximum number of notification icons shown in the status bar (excluding overflow dot) --> <integer name="max_notif_static_icons">4</integer> </resources> No newline at end of file packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +16 −9 Original line number Diff line number Diff line Loading @@ -136,11 +136,13 @@ public class NotificationIconContainer extends ViewGroup { } }.setDuration(CONTENT_FADE_DURATION); private static final int MAX_ICONS_ON_AOD = 3; /* Maximum number of icons on AOD when also showing overflow dot. */ private int mMaxIconsOnAod; /* Maximum number of icons in short shelf on lockscreen when also showing overflow dot. */ public static final int MAX_ICONS_ON_LOCKSCREEN = 3; public static final int MAX_STATIC_ICONS = 4; private int mMaxIconsOnLockscreen; /* Maximum number of icons in the status bar when also showing overflow dot. */ private int mMaxStaticIcons; private boolean mIsStaticLayout = true; private final HashMap<View, IconState> mIconStates = new HashMap<>(); Loading Loading @@ -174,14 +176,19 @@ public class NotificationIconContainer extends ViewGroup { public NotificationIconContainer(Context context, AttributeSet attrs) { super(context, attrs); initDimens(); initResources(); setWillNotDraw(!(DEBUG || DEBUG_OVERFLOW)); } private void initDimens() { private void initResources() { mMaxIconsOnAod = getResources().getInteger(R.integer.max_notif_icons_on_aod); mMaxIconsOnLockscreen = getResources().getInteger(R.integer.max_notif_icons_on_lockscreen); mMaxStaticIcons = getResources().getInteger(R.integer.max_notif_static_icons); mDotPadding = getResources().getDimensionPixelSize(R.dimen.overflow_icon_dot_padding); mStaticDotRadius = getResources().getDimensionPixelSize(R.dimen.overflow_dot_radius); mStaticDotDiameter = 2 * mStaticDotRadius; final Context themedContext = new ContextThemeWrapper(getContext(), com.android.internal.R.style.Theme_DeviceDefault_DayNight); mThemedTextColorPrimary = Utils.getColorAttr(themedContext, Loading Loading @@ -225,7 +232,7 @@ public class NotificationIconContainer extends ViewGroup { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); initDimens(); initResources(); } @Override Loading Loading @@ -424,7 +431,7 @@ public class NotificationIconContainer extends ViewGroup { return 0f; } final float contentWidth = mIconSize * MathUtils.min(numIcons, MAX_ICONS_ON_LOCKSCREEN + 1); mIconSize * MathUtils.min(numIcons, mMaxIconsOnLockscreen + 1); return getActualPaddingStart() + contentWidth + getActualPaddingEnd(); Loading Loading @@ -539,8 +546,8 @@ public class NotificationIconContainer extends ViewGroup { } private int getMaxVisibleIcons(int childCount) { return mOnLockScreen ? MAX_ICONS_ON_AOD : mIsStaticLayout ? MAX_STATIC_ICONS : childCount; return mOnLockScreen ? mMaxIconsOnAod : mIsStaticLayout ? mMaxStaticIcons : childCount; } private float getLayoutEnd() { Loading Loading
packages/SystemUI/res/values/integers.xml +8 −0 Original line number Diff line number Diff line Loading @@ -37,4 +37,12 @@ <dimen name="percent_displacement_at_fade_out" format="float">0.1066</dimen> <integer name="qs_carrier_max_em">7</integer> <!-- Maximum number of notification icons shown on the Always on Display (excluding overflow dot) --> <integer name="max_notif_icons_on_aod">3</integer> <!-- Maximum number of notification icons shown on the lockscreen (excluding overflow dot) --> <integer name="max_notif_icons_on_lockscreen">3</integer> <!-- Maximum number of notification icons shown in the status bar (excluding overflow dot) --> <integer name="max_notif_static_icons">4</integer> </resources> No newline at end of file
packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationIconContainer.java +16 −9 Original line number Diff line number Diff line Loading @@ -136,11 +136,13 @@ public class NotificationIconContainer extends ViewGroup { } }.setDuration(CONTENT_FADE_DURATION); private static final int MAX_ICONS_ON_AOD = 3; /* Maximum number of icons on AOD when also showing overflow dot. */ private int mMaxIconsOnAod; /* Maximum number of icons in short shelf on lockscreen when also showing overflow dot. */ public static final int MAX_ICONS_ON_LOCKSCREEN = 3; public static final int MAX_STATIC_ICONS = 4; private int mMaxIconsOnLockscreen; /* Maximum number of icons in the status bar when also showing overflow dot. */ private int mMaxStaticIcons; private boolean mIsStaticLayout = true; private final HashMap<View, IconState> mIconStates = new HashMap<>(); Loading Loading @@ -174,14 +176,19 @@ public class NotificationIconContainer extends ViewGroup { public NotificationIconContainer(Context context, AttributeSet attrs) { super(context, attrs); initDimens(); initResources(); setWillNotDraw(!(DEBUG || DEBUG_OVERFLOW)); } private void initDimens() { private void initResources() { mMaxIconsOnAod = getResources().getInteger(R.integer.max_notif_icons_on_aod); mMaxIconsOnLockscreen = getResources().getInteger(R.integer.max_notif_icons_on_lockscreen); mMaxStaticIcons = getResources().getInteger(R.integer.max_notif_static_icons); mDotPadding = getResources().getDimensionPixelSize(R.dimen.overflow_icon_dot_padding); mStaticDotRadius = getResources().getDimensionPixelSize(R.dimen.overflow_dot_radius); mStaticDotDiameter = 2 * mStaticDotRadius; final Context themedContext = new ContextThemeWrapper(getContext(), com.android.internal.R.style.Theme_DeviceDefault_DayNight); mThemedTextColorPrimary = Utils.getColorAttr(themedContext, Loading Loading @@ -225,7 +232,7 @@ public class NotificationIconContainer extends ViewGroup { @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); initDimens(); initResources(); } @Override Loading Loading @@ -424,7 +431,7 @@ public class NotificationIconContainer extends ViewGroup { return 0f; } final float contentWidth = mIconSize * MathUtils.min(numIcons, MAX_ICONS_ON_LOCKSCREEN + 1); mIconSize * MathUtils.min(numIcons, mMaxIconsOnLockscreen + 1); return getActualPaddingStart() + contentWidth + getActualPaddingEnd(); Loading Loading @@ -539,8 +546,8 @@ public class NotificationIconContainer extends ViewGroup { } private int getMaxVisibleIcons(int childCount) { return mOnLockScreen ? MAX_ICONS_ON_AOD : mIsStaticLayout ? MAX_STATIC_ICONS : childCount; return mOnLockScreen ? mMaxIconsOnAod : mIsStaticLayout ? mMaxStaticIcons : childCount; } private float getLayoutEnd() { Loading