Loading packages/SystemUI/animation/res/values/ids.xml +2 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ --> <resources> <!-- DialogLaunchAnimator --> <item type="id" name="launch_animation_running"/> <item type="id" name="tag_launch_animation_running"/> <item type="id" name="tag_dialog_background"/> <!-- ViewBoundsAnimator --> <item type="id" name="tag_animator"/> Loading packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +3 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ class DialogLaunchAnimator @JvmOverloads constructor( positionXInterpolator = ActivityLaunchAnimator.INTERPOLATORS.positionInterpolator ) private val TAG_LAUNCH_ANIMATION_RUNNING = R.id.launch_animation_running private val TAG_LAUNCH_ANIMATION_RUNNING = R.id.tag_launch_animation_running } /** Loading Loading @@ -447,6 +447,7 @@ private class AnimatedDialog( dialogContentWithBackground } this.dialogContentWithBackground = dialogContentWithBackground dialogContentWithBackground.setTag(R.id.tag_dialog_background, true) val background = dialogContentWithBackground.background originalDialogBackgroundColor = Loading Loading @@ -584,7 +585,7 @@ private class AnimatedDialog( GhostView.removeGhost(touchSurface) }, onLaunchAnimationEnd = { touchSurface.setTag(R.id.launch_animation_running, null) touchSurface.setTag(R.id.tag_launch_animation_running, null) // We hide the touch surface when the dialog is showing. We will make this // view visible again when dismissing the dialog. Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java +9 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.os.Looper; import android.os.SystemProperties; import android.os.UserHandle; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import android.view.ViewRootImpl; import android.view.Window; Loading Loading @@ -376,11 +377,17 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh } private static int getHorizontalInsets(Dialog dialog) { if (dialog.getWindow().getDecorView() == null) { View decorView = dialog.getWindow().getDecorView(); if (decorView == null) { return 0; } Drawable background = dialog.getWindow().getDecorView().getBackground(); // We first look for the background on the dialogContentWithBackground added by // DialogLaunchAnimator. If it's not there, we use the background of the DecorView. View viewWithBackground = decorView.findViewByPredicate( view -> view.getTag(R.id.tag_dialog_background) != null); Drawable background = viewWithBackground != null ? viewWithBackground.getBackground() : decorView.getBackground(); Insets insets = background != null ? background.getOpticalInsets() : Insets.NONE; return insets.left + insets.right; } Loading Loading
packages/SystemUI/animation/res/values/ids.xml +2 −1 Original line number Diff line number Diff line Loading @@ -16,7 +16,8 @@ --> <resources> <!-- DialogLaunchAnimator --> <item type="id" name="launch_animation_running"/> <item type="id" name="tag_launch_animation_running"/> <item type="id" name="tag_dialog_background"/> <!-- ViewBoundsAnimator --> <item type="id" name="tag_animator"/> Loading
packages/SystemUI/animation/src/com/android/systemui/animation/DialogLaunchAnimator.kt +3 −2 Original line number Diff line number Diff line Loading @@ -62,7 +62,7 @@ class DialogLaunchAnimator @JvmOverloads constructor( positionXInterpolator = ActivityLaunchAnimator.INTERPOLATORS.positionInterpolator ) private val TAG_LAUNCH_ANIMATION_RUNNING = R.id.launch_animation_running private val TAG_LAUNCH_ANIMATION_RUNNING = R.id.tag_launch_animation_running } /** Loading Loading @@ -447,6 +447,7 @@ private class AnimatedDialog( dialogContentWithBackground } this.dialogContentWithBackground = dialogContentWithBackground dialogContentWithBackground.setTag(R.id.tag_dialog_background, true) val background = dialogContentWithBackground.background originalDialogBackgroundColor = Loading Loading @@ -584,7 +585,7 @@ private class AnimatedDialog( GhostView.removeGhost(touchSurface) }, onLaunchAnimationEnd = { touchSurface.setTag(R.id.launch_animation_running, null) touchSurface.setTag(R.id.tag_launch_animation_running, null) // We hide the touch surface when the dialog is showing. We will make this // view visible again when dismissing the dialog. Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/SystemUIDialog.java +9 −2 Original line number Diff line number Diff line Loading @@ -31,6 +31,7 @@ import android.os.Looper; import android.os.SystemProperties; import android.os.UserHandle; import android.util.TypedValue; import android.view.View; import android.view.ViewGroup; import android.view.ViewRootImpl; import android.view.Window; Loading Loading @@ -376,11 +377,17 @@ public class SystemUIDialog extends AlertDialog implements ViewRootImpl.ConfigCh } private static int getHorizontalInsets(Dialog dialog) { if (dialog.getWindow().getDecorView() == null) { View decorView = dialog.getWindow().getDecorView(); if (decorView == null) { return 0; } Drawable background = dialog.getWindow().getDecorView().getBackground(); // We first look for the background on the dialogContentWithBackground added by // DialogLaunchAnimator. If it's not there, we use the background of the DecorView. View viewWithBackground = decorView.findViewByPredicate( view -> view.getTag(R.id.tag_dialog_background) != null); Drawable background = viewWithBackground != null ? viewWithBackground.getBackground() : decorView.getBackground(); Insets insets = background != null ? background.getOpticalInsets() : Insets.NONE; return insets.left + insets.right; } Loading