Loading packages/SystemUI/res/values/dimens.xml +19 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,25 @@ <dimen name="navigation_edge_cancelled_arrow_height">0dp</dimen> <dimen name="navigation_edge_cancelled_arrow_height">0dp</dimen> <dimen name="navigation_edge_cancelled_edge_corners">6dp</dimen> <dimen name="navigation_edge_cancelled_edge_corners">6dp</dimen> <!-- NOTICE: STATUS BAR INTERNALS. DO NOT READ THESE OUTSIDE OF STATUS BAR. Below are the bottom margin values for each rotation [1]. Only used when the value is >= 0. A value of 0 means that the content has 0 bottom margin, and will be at the bottom of the status bar. When the value is < 0, the value is ignored, and content will be centered vertically. [1] Rotation defined as in android.view.Surface.Rotation. Rotation 0 means natural orientation. If a device is naturally portrait (e.g. a phone), rotation 0 is portrait. If a device is naturally landscape (e.g a tablet), rotation 0 is landscape. --> <dimen name="status_bar_bottom_aligned_margin_rotation_0">-1px</dimen> <dimen name="status_bar_bottom_aligned_margin_rotation_90">-1px</dimen> <dimen name="status_bar_bottom_aligned_margin_rotation_180">-1px</dimen> <dimen name="status_bar_bottom_aligned_margin_rotation_270">-1px</dimen> <!-- Height of the system icons container view in the status bar --> <!-- Height of the system icons container view in the status bar --> <dimen name="status_bar_system_icons_height">@dimen/status_bar_icon_size_sp</dimen> <dimen name="status_bar_system_icons_height">@dimen/status_bar_icon_size_sp</dimen> Loading packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt +4 −4 Original line number Original line Diff line number Diff line Loading @@ -23,11 +23,11 @@ import android.app.PendingIntent import android.app.StatusBarManager import android.app.StatusBarManager import android.content.Intent import android.content.Intent import android.content.res.Configuration import android.content.res.Configuration import android.graphics.Insets import android.os.Bundle import android.os.Bundle import android.os.Trace import android.os.Trace import android.os.Trace.TRACE_TAG_APP import android.os.Trace.TRACE_TAG_APP import android.provider.AlarmClock import android.provider.AlarmClock import android.util.Pair import android.view.DisplayCutout import android.view.DisplayCutout import android.view.View import android.view.View import android.view.WindowInsets import android.view.WindowInsets Loading Loading @@ -402,9 +402,9 @@ constructor( private fun updateConstraintsForInsets(view: MotionLayout, insets: WindowInsets) { private fun updateConstraintsForInsets(view: MotionLayout, insets: WindowInsets) { val cutout = insets.displayCutout.also { this.cutout = it } val cutout = insets.displayCutout.also { this.cutout = it } val sbInsets: Pair<Int, Int> = insetsProvider.getStatusBarContentInsetsForCurrentRotation() val sbInsets: Insets = insetsProvider.getStatusBarContentInsetsForCurrentRotation() val cutoutLeft = sbInsets.first val cutoutLeft = sbInsets.left val cutoutRight = sbInsets.second val cutoutRight = sbInsets.right val hasCornerCutout: Boolean = insetsProvider.currentRotationHasCornerCutout() val hasCornerCutout: Boolean = insetsProvider.currentRotationHasCornerCutout() updateQQSPaddings() updateQQSPaddings() // Set these guides as the left/right limits for content that lives in the top row, using // Set these guides as the left/right limits for content that lives in the top row, using Loading packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -278,6 +278,7 @@ open class PrivacyDotViewController @Inject constructor( var contentInsets = state.contentRectForRotation(rot) var contentInsets = state.contentRectForRotation(rot) tl.setPadding(0, state.paddingTop, 0, 0) tl.setPadding(0, state.paddingTop, 0, 0) (tl.layoutParams as FrameLayout.LayoutParams).apply { (tl.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading @@ -290,6 +291,7 @@ open class PrivacyDotViewController @Inject constructor( contentInsets = state.contentRectForRotation(rot) contentInsets = state.contentRectForRotation(rot) tr.setPadding(0, state.paddingTop, 0, 0) tr.setPadding(0, state.paddingTop, 0, 0) (tr.layoutParams as FrameLayout.LayoutParams).apply { (tr.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading @@ -302,6 +304,7 @@ open class PrivacyDotViewController @Inject constructor( contentInsets = state.contentRectForRotation(rot) contentInsets = state.contentRectForRotation(rot) br.setPadding(0, state.paddingTop, 0, 0) br.setPadding(0, state.paddingTop, 0, 0) (br.layoutParams as FrameLayout.LayoutParams).apply { (br.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading @@ -314,6 +317,7 @@ open class PrivacyDotViewController @Inject constructor( contentInsets = state.contentRectForRotation(rot) contentInsets = state.contentRectForRotation(rot) bl.setPadding(0, state.paddingTop, 0, 0) bl.setPadding(0, state.paddingTop, 0, 0) (bl.layoutParams as FrameLayout.LayoutParams).apply { (bl.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt +3 −3 Original line number Original line Diff line number Diff line Loading @@ -87,8 +87,8 @@ class SystemEventChipAnimationController @Inject constructor( animationWindowView.addView( animationWindowView.addView( it.view, it.view, layoutParamsDefault( layoutParamsDefault( if (animationWindowView.isLayoutRtl) insets.first if (animationWindowView.isLayoutRtl) insets.left else insets.second)) else insets.right)) it.view.alpha = 0f it.view.alpha = 0f // For some reason, the window view's measured width is always 0 here, so use the // For some reason, the window view's measured width is always 0 here, so use the // parent (status bar) // parent (status bar) Loading Loading @@ -289,7 +289,7 @@ class SystemEventChipAnimationController @Inject constructor( */ */ private fun updateChipBounds(chip: BackgroundAnimatableView, contentArea: Rect) { private fun updateChipBounds(chip: BackgroundAnimatableView, contentArea: Rect) { // decide which direction we're animating from, and then set some screen coordinates // decide which direction we're animating from, and then set some screen coordinates val chipTop = (contentArea.bottom - chip.view.measuredHeight) / 2 val chipTop = contentArea.top + (contentArea.height() - chip.view.measuredHeight) / 2 val chipBottom = chipTop + chip.view.measuredHeight val chipBottom = chipTop + chip.view.measuredHeight val chipRight: Int val chipRight: Int val chipLeft: Int val chipLeft: Int Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -24,11 +24,11 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Color; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.os.Trace; import android.os.Trace; import android.util.AttributeSet; import android.util.AttributeSet; import android.util.Pair; import android.util.TypedValue; import android.util.TypedValue; import android.view.DisplayCutout; import android.view.DisplayCutout; import android.view.Gravity; import android.view.Gravity; Loading Loading @@ -103,7 +103,7 @@ public class KeyguardStatusBarView extends RelativeLayout { private DisplayCutout mDisplayCutout; private DisplayCutout mDisplayCutout; private int mRoundedCornerPadding = 0; private int mRoundedCornerPadding = 0; // right and left padding applied to this view to account for cutouts and rounded corners // right and left padding applied to this view to account for cutouts and rounded corners private Pair<Integer, Integer> mPadding = new Pair(0, 0); private Insets mPadding = Insets.of(0, 0, 0, 0); /** /** * The clipping on the top * The clipping on the top Loading Loading @@ -184,7 +184,7 @@ public class KeyguardStatusBarView extends RelativeLayout { int marginStart = calculateMargin( int marginStart = calculateMargin( getResources().getDimensionPixelSize(R.dimen.keyguard_carrier_text_margin), getResources().getDimensionPixelSize(R.dimen.keyguard_carrier_text_margin), mPadding.first); mPadding.left); lp.setMarginStart(marginStart); lp.setMarginStart(marginStart); mCarrierLabel.setLayoutParams(lp); mCarrierLabel.setLayoutParams(lp); Loading Loading @@ -303,9 +303,9 @@ public class KeyguardStatusBarView extends RelativeLayout { // consider privacy dot space // consider privacy dot space final int minLeft = (isLayoutRtl() && mIsPrivacyDotEnabled) final int minLeft = (isLayoutRtl() && mIsPrivacyDotEnabled) ? Math.max(mMinDotWidth, mPadding.first) : mPadding.first; ? Math.max(mMinDotWidth, mPadding.left) : mPadding.left; final int minRight = (!isLayoutRtl() && mIsPrivacyDotEnabled) final int minRight = (!isLayoutRtl() && mIsPrivacyDotEnabled) ? Math.max(mMinDotWidth, mPadding.second) : mPadding.second; ? Math.max(mMinDotWidth, mPadding.right) : mPadding.right; setPadding(minLeft, waterfallTop, minRight, 0); setPadding(minLeft, waterfallTop, minRight, 0); } } Loading Loading
packages/SystemUI/res/values/dimens.xml +19 −0 Original line number Original line Diff line number Diff line Loading @@ -125,6 +125,25 @@ <dimen name="navigation_edge_cancelled_arrow_height">0dp</dimen> <dimen name="navigation_edge_cancelled_arrow_height">0dp</dimen> <dimen name="navigation_edge_cancelled_edge_corners">6dp</dimen> <dimen name="navigation_edge_cancelled_edge_corners">6dp</dimen> <!-- NOTICE: STATUS BAR INTERNALS. DO NOT READ THESE OUTSIDE OF STATUS BAR. Below are the bottom margin values for each rotation [1]. Only used when the value is >= 0. A value of 0 means that the content has 0 bottom margin, and will be at the bottom of the status bar. When the value is < 0, the value is ignored, and content will be centered vertically. [1] Rotation defined as in android.view.Surface.Rotation. Rotation 0 means natural orientation. If a device is naturally portrait (e.g. a phone), rotation 0 is portrait. If a device is naturally landscape (e.g a tablet), rotation 0 is landscape. --> <dimen name="status_bar_bottom_aligned_margin_rotation_0">-1px</dimen> <dimen name="status_bar_bottom_aligned_margin_rotation_90">-1px</dimen> <dimen name="status_bar_bottom_aligned_margin_rotation_180">-1px</dimen> <dimen name="status_bar_bottom_aligned_margin_rotation_270">-1px</dimen> <!-- Height of the system icons container view in the status bar --> <!-- Height of the system icons container view in the status bar --> <dimen name="status_bar_system_icons_height">@dimen/status_bar_icon_size_sp</dimen> <dimen name="status_bar_system_icons_height">@dimen/status_bar_icon_size_sp</dimen> Loading
packages/SystemUI/src/com/android/systemui/shade/ShadeHeaderController.kt +4 −4 Original line number Original line Diff line number Diff line Loading @@ -23,11 +23,11 @@ import android.app.PendingIntent import android.app.StatusBarManager import android.app.StatusBarManager import android.content.Intent import android.content.Intent import android.content.res.Configuration import android.content.res.Configuration import android.graphics.Insets import android.os.Bundle import android.os.Bundle import android.os.Trace import android.os.Trace import android.os.Trace.TRACE_TAG_APP import android.os.Trace.TRACE_TAG_APP import android.provider.AlarmClock import android.provider.AlarmClock import android.util.Pair import android.view.DisplayCutout import android.view.DisplayCutout import android.view.View import android.view.View import android.view.WindowInsets import android.view.WindowInsets Loading Loading @@ -402,9 +402,9 @@ constructor( private fun updateConstraintsForInsets(view: MotionLayout, insets: WindowInsets) { private fun updateConstraintsForInsets(view: MotionLayout, insets: WindowInsets) { val cutout = insets.displayCutout.also { this.cutout = it } val cutout = insets.displayCutout.also { this.cutout = it } val sbInsets: Pair<Int, Int> = insetsProvider.getStatusBarContentInsetsForCurrentRotation() val sbInsets: Insets = insetsProvider.getStatusBarContentInsetsForCurrentRotation() val cutoutLeft = sbInsets.first val cutoutLeft = sbInsets.left val cutoutRight = sbInsets.second val cutoutRight = sbInsets.right val hasCornerCutout: Boolean = insetsProvider.currentRotationHasCornerCutout() val hasCornerCutout: Boolean = insetsProvider.currentRotationHasCornerCutout() updateQQSPaddings() updateQQSPaddings() // Set these guides as the left/right limits for content that lives in the top row, using // Set these guides as the left/right limits for content that lives in the top row, using Loading
packages/SystemUI/src/com/android/systemui/statusbar/events/PrivacyDotViewController.kt +4 −0 Original line number Original line Diff line number Diff line Loading @@ -278,6 +278,7 @@ open class PrivacyDotViewController @Inject constructor( var contentInsets = state.contentRectForRotation(rot) var contentInsets = state.contentRectForRotation(rot) tl.setPadding(0, state.paddingTop, 0, 0) tl.setPadding(0, state.paddingTop, 0, 0) (tl.layoutParams as FrameLayout.LayoutParams).apply { (tl.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading @@ -290,6 +291,7 @@ open class PrivacyDotViewController @Inject constructor( contentInsets = state.contentRectForRotation(rot) contentInsets = state.contentRectForRotation(rot) tr.setPadding(0, state.paddingTop, 0, 0) tr.setPadding(0, state.paddingTop, 0, 0) (tr.layoutParams as FrameLayout.LayoutParams).apply { (tr.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading @@ -302,6 +304,7 @@ open class PrivacyDotViewController @Inject constructor( contentInsets = state.contentRectForRotation(rot) contentInsets = state.contentRectForRotation(rot) br.setPadding(0, state.paddingTop, 0, 0) br.setPadding(0, state.paddingTop, 0, 0) (br.layoutParams as FrameLayout.LayoutParams).apply { (br.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading @@ -314,6 +317,7 @@ open class PrivacyDotViewController @Inject constructor( contentInsets = state.contentRectForRotation(rot) contentInsets = state.contentRectForRotation(rot) bl.setPadding(0, state.paddingTop, 0, 0) bl.setPadding(0, state.paddingTop, 0, 0) (bl.layoutParams as FrameLayout.LayoutParams).apply { (bl.layoutParams as FrameLayout.LayoutParams).apply { topMargin = contentInsets.top height = contentInsets.height() height = contentInsets.height() if (rtl) { if (rtl) { width = contentInsets.left width = contentInsets.left Loading
packages/SystemUI/src/com/android/systemui/statusbar/events/SystemEventChipAnimationController.kt +3 −3 Original line number Original line Diff line number Diff line Loading @@ -87,8 +87,8 @@ class SystemEventChipAnimationController @Inject constructor( animationWindowView.addView( animationWindowView.addView( it.view, it.view, layoutParamsDefault( layoutParamsDefault( if (animationWindowView.isLayoutRtl) insets.first if (animationWindowView.isLayoutRtl) insets.left else insets.second)) else insets.right)) it.view.alpha = 0f it.view.alpha = 0f // For some reason, the window view's measured width is always 0 here, so use the // For some reason, the window view's measured width is always 0 here, so use the // parent (status bar) // parent (status bar) Loading Loading @@ -289,7 +289,7 @@ class SystemEventChipAnimationController @Inject constructor( */ */ private fun updateChipBounds(chip: BackgroundAnimatableView, contentArea: Rect) { private fun updateChipBounds(chip: BackgroundAnimatableView, contentArea: Rect) { // decide which direction we're animating from, and then set some screen coordinates // decide which direction we're animating from, and then set some screen coordinates val chipTop = (contentArea.bottom - chip.view.measuredHeight) / 2 val chipTop = contentArea.top + (contentArea.height() - chip.view.measuredHeight) / 2 val chipBottom = chipTop + chip.view.measuredHeight val chipBottom = chipTop + chip.view.measuredHeight val chipRight: Int val chipRight: Int val chipLeft: Int val chipLeft: Int Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardStatusBarView.java +5 −5 Original line number Original line Diff line number Diff line Loading @@ -24,11 +24,11 @@ import android.content.Context; import android.content.res.Configuration; import android.content.res.Configuration; import android.content.res.Resources; import android.content.res.Resources; import android.graphics.Color; import android.graphics.Color; import android.graphics.Insets; import android.graphics.Rect; import android.graphics.Rect; import android.graphics.drawable.Drawable; import android.graphics.drawable.Drawable; import android.os.Trace; import android.os.Trace; import android.util.AttributeSet; import android.util.AttributeSet; import android.util.Pair; import android.util.TypedValue; import android.util.TypedValue; import android.view.DisplayCutout; import android.view.DisplayCutout; import android.view.Gravity; import android.view.Gravity; Loading Loading @@ -103,7 +103,7 @@ public class KeyguardStatusBarView extends RelativeLayout { private DisplayCutout mDisplayCutout; private DisplayCutout mDisplayCutout; private int mRoundedCornerPadding = 0; private int mRoundedCornerPadding = 0; // right and left padding applied to this view to account for cutouts and rounded corners // right and left padding applied to this view to account for cutouts and rounded corners private Pair<Integer, Integer> mPadding = new Pair(0, 0); private Insets mPadding = Insets.of(0, 0, 0, 0); /** /** * The clipping on the top * The clipping on the top Loading Loading @@ -184,7 +184,7 @@ public class KeyguardStatusBarView extends RelativeLayout { int marginStart = calculateMargin( int marginStart = calculateMargin( getResources().getDimensionPixelSize(R.dimen.keyguard_carrier_text_margin), getResources().getDimensionPixelSize(R.dimen.keyguard_carrier_text_margin), mPadding.first); mPadding.left); lp.setMarginStart(marginStart); lp.setMarginStart(marginStart); mCarrierLabel.setLayoutParams(lp); mCarrierLabel.setLayoutParams(lp); Loading Loading @@ -303,9 +303,9 @@ public class KeyguardStatusBarView extends RelativeLayout { // consider privacy dot space // consider privacy dot space final int minLeft = (isLayoutRtl() && mIsPrivacyDotEnabled) final int minLeft = (isLayoutRtl() && mIsPrivacyDotEnabled) ? Math.max(mMinDotWidth, mPadding.first) : mPadding.first; ? Math.max(mMinDotWidth, mPadding.left) : mPadding.left; final int minRight = (!isLayoutRtl() && mIsPrivacyDotEnabled) final int minRight = (!isLayoutRtl() && mIsPrivacyDotEnabled) ? Math.max(mMinDotWidth, mPadding.second) : mPadding.second; ? Math.max(mMinDotWidth, mPadding.right) : mPadding.right; setPadding(minLeft, waterfallTop, minRight, 0); setPadding(minLeft, waterfallTop, minRight, 0); } } Loading