Loading packages/SystemUI/res/values/dimens.xml +4 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,7 @@ <dimen name="status_bar_padding_start">6dp</dimen> <!-- the padding on the end of the statusbar --> <dimen name="status_bar_padding_end">8dp</dimen> <dimen name="status_bar_padding_end">6dp</dimen> <!-- the radius of the overflow dot in the status bar --> <dimen name="overflow_dot_radius">1dp</dimen> Loading Loading @@ -1007,4 +1007,7 @@ <dimen name="logout_button_margin_bottom">12dp</dimen> <dimen name="logout_button_corner_radius">2dp</dimen> <!-- How much into a DisplayCutout's bounds we can go, on each side --> <dimen name="display_cutout_margin_consumption">0px</dimen> </resources> packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +9 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ public class KeyguardStatusBarView extends RelativeLayout private ViewGroup mStatusIconArea; private int mLayoutState = LAYOUT_NONE; /** * Draw this many pixels into the left/right side of the cutout to optimally use the space */ private int mCutoutSideNudge = 0; public KeyguardStatusBarView(Context context, AttributeSet attrs) { super(context, attrs); } Loading Loading @@ -158,6 +163,8 @@ public class KeyguardStatusBarView extends RelativeLayout R.dimen.system_icons_switcher_hidden_expanded_margin); mSystemIconsBaseMargin = res.getDimensionPixelSize( R.dimen.system_icons_super_container_avatarless_margin_end); mCutoutSideNudge = getResources().getDimensionPixelSize( R.dimen.display_cutout_margin_consumption); } private void updateVisibilities() { Loading Loading @@ -266,6 +273,8 @@ public class KeyguardStatusBarView extends RelativeLayout mCutoutSpace.setVisibility(View.VISIBLE); RelativeLayout.LayoutParams lp = (LayoutParams) mCutoutSpace.getLayoutParams(); bounds.left = bounds.left + mCutoutSideNudge; bounds.right = bounds.right - mCutoutSideNudge; lp.width = bounds.width(); lp.height = bounds.height(); lp.addRule(RelativeLayout.CENTER_IN_PARENT); Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +11 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,10 @@ public class PhoneStatusBarView extends PanelBar { private View mCutoutSpace; @Nullable private DisplayCutout mDisplayCutout; /** * Draw this many pixels into the left/right side of the cutout to optimally use the space */ private int mCutoutSideNudge = 0; public PhoneStatusBarView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -98,6 +102,8 @@ public class PhoneStatusBarView extends PanelBar { mBarTransitions.init(); mBattery = findViewById(R.id.battery); mCutoutSpace = findViewById(R.id.cutout_space_view); updateResources(); } @Override Loading Loading @@ -280,6 +286,9 @@ public class PhoneStatusBarView extends PanelBar { } public void updateResources() { mCutoutSideNudge = getResources().getDimensionPixelSize( R.dimen.display_cutout_margin_consumption); ViewGroup.LayoutParams layoutParams = getLayoutParams(); layoutParams.height = getResources().getDimensionPixelSize( R.dimen.status_bar_height); Loading Loading @@ -311,6 +320,8 @@ public class PhoneStatusBarView extends PanelBar { Rect bounds = new Rect(); boundsFromDirection(mDisplayCutout, Gravity.TOP, bounds); bounds.left = bounds.left + mCutoutSideNudge; bounds.right = bounds.right - mCutoutSideNudge; lp.width = bounds.width(); lp.height = bounds.height(); } Loading Loading
packages/SystemUI/res/values/dimens.xml +4 −1 Original line number Diff line number Diff line Loading @@ -201,7 +201,7 @@ <dimen name="status_bar_padding_start">6dp</dimen> <!-- the padding on the end of the statusbar --> <dimen name="status_bar_padding_end">8dp</dimen> <dimen name="status_bar_padding_end">6dp</dimen> <!-- the radius of the overflow dot in the status bar --> <dimen name="overflow_dot_radius">1dp</dimen> Loading Loading @@ -1007,4 +1007,7 @@ <dimen name="logout_button_margin_bottom">12dp</dimen> <dimen name="logout_button_corner_radius">2dp</dimen> <!-- How much into a DisplayCutout's bounds we can go, on each side --> <dimen name="display_cutout_margin_consumption">0px</dimen> </resources>
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +9 −0 Original line number Diff line number Diff line Loading @@ -90,6 +90,11 @@ public class KeyguardStatusBarView extends RelativeLayout private ViewGroup mStatusIconArea; private int mLayoutState = LAYOUT_NONE; /** * Draw this many pixels into the left/right side of the cutout to optimally use the space */ private int mCutoutSideNudge = 0; public KeyguardStatusBarView(Context context, AttributeSet attrs) { super(context, attrs); } Loading Loading @@ -158,6 +163,8 @@ public class KeyguardStatusBarView extends RelativeLayout R.dimen.system_icons_switcher_hidden_expanded_margin); mSystemIconsBaseMargin = res.getDimensionPixelSize( R.dimen.system_icons_super_container_avatarless_margin_end); mCutoutSideNudge = getResources().getDimensionPixelSize( R.dimen.display_cutout_margin_consumption); } private void updateVisibilities() { Loading Loading @@ -266,6 +273,8 @@ public class KeyguardStatusBarView extends RelativeLayout mCutoutSpace.setVisibility(View.VISIBLE); RelativeLayout.LayoutParams lp = (LayoutParams) mCutoutSpace.getLayoutParams(); bounds.left = bounds.left + mCutoutSideNudge; bounds.right = bounds.right - mCutoutSideNudge; lp.width = bounds.width(); lp.height = bounds.height(); lp.addRule(RelativeLayout.CENTER_IN_PARENT); Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +11 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,10 @@ public class PhoneStatusBarView extends PanelBar { private View mCutoutSpace; @Nullable private DisplayCutout mDisplayCutout; /** * Draw this many pixels into the left/right side of the cutout to optimally use the space */ private int mCutoutSideNudge = 0; public PhoneStatusBarView(Context context, AttributeSet attrs) { super(context, attrs); Loading @@ -98,6 +102,8 @@ public class PhoneStatusBarView extends PanelBar { mBarTransitions.init(); mBattery = findViewById(R.id.battery); mCutoutSpace = findViewById(R.id.cutout_space_view); updateResources(); } @Override Loading Loading @@ -280,6 +286,9 @@ public class PhoneStatusBarView extends PanelBar { } public void updateResources() { mCutoutSideNudge = getResources().getDimensionPixelSize( R.dimen.display_cutout_margin_consumption); ViewGroup.LayoutParams layoutParams = getLayoutParams(); layoutParams.height = getResources().getDimensionPixelSize( R.dimen.status_bar_height); Loading Loading @@ -311,6 +320,8 @@ public class PhoneStatusBarView extends PanelBar { Rect bounds = new Rect(); boundsFromDirection(mDisplayCutout, Gravity.TOP, bounds); bounds.left = bounds.left + mCutoutSideNudge; bounds.right = bounds.right - mCutoutSideNudge; lp.width = bounds.width(); lp.height = bounds.height(); } Loading