Loading packages/SystemUI/res/layout/screenshot_shelf.xml +3 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/screenshot_static" android:layout_width="match_parent" android:layout_height="match_parent"> android:layout_height="match_parent" android:clipChildren="false" android:clipToPadding="false"> <FrameLayout android:id="@+id/actions_container_background" android:visibility="gone" Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotAnimationController.kt +16 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ class ScreenshotAnimationController(private val view: ScreenshotShelfView) { private val staticUI = listOf<View>( view.requireViewById(R.id.screenshot_preview_border), view.requireViewById(R.id.actions_container_background), view.requireViewById(R.id.screenshot_badge), view.requireViewById(R.id.screenshot_dismiss_button) ) Loading Loading @@ -71,6 +70,8 @@ class ScreenshotAnimationController(private val view: ScreenshotShelfView) { entranceAnimation.doOnStart { screenshotPreview.visibility = View.INVISIBLE } } entranceAnimation.play(getActionsAnimator()).with(previewAnimator) val fadeInAnimator = ValueAnimator.ofFloat(0f, 1f) fadeInAnimator.addUpdateListener { for (child in staticUI) { Loading Loading @@ -123,6 +124,20 @@ class ScreenshotAnimationController(private val view: ScreenshotShelfView) { animator?.cancel() } private fun getActionsAnimator(): Animator { val startingOffset = view.height - actionContainer.top val actionsYAnimator = ValueAnimator.ofFloat(startingOffset.toFloat(), 0f).apply { duration = PREVIEW_Y_ANIMATION_DURATION_MS interpolator = fastOutSlowIn } actionsYAnimator.addUpdateListener { actionContainer.translationY = it.animatedValue as Float } actionContainer.translationY = startingOffset.toFloat() return actionsYAnimator } private fun getPreviewAnimator(bounds: Rect): Animator { val targetPosition = Rect() screenshotPreview.getHitRect(targetPosition) Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +3 −6 Original line number Diff line number Diff line Loading @@ -77,15 +77,14 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : fun updateInsets(insets: WindowInsets) { val orientation = mContext.resources.configuration.orientation val inPortrait = orientation == Configuration.ORIENTATION_PORTRAIT val p = screenshotStatic.layoutParams as LayoutParams val cutout = insets.displayCutout val navBarInsets = insets.getInsets(WindowInsets.Type.navigationBars()) if (cutout == null) { p.setMargins(0, 0, 0, navBarInsets.bottom) screenshotStatic.setPadding(0, 0, 0, navBarInsets.bottom) } else { val waterfall = cutout.waterfallInsets if (inPortrait) { p.setMargins( screenshotStatic.setPadding( waterfall.left, max(cutout.safeInsetTop.toDouble(), waterfall.top.toDouble()).toInt(), waterfall.right, Loading @@ -96,7 +95,7 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : .toInt() ) } else { p.setMargins( screenshotStatic.setPadding( max(cutout.safeInsetLeft.toDouble(), waterfall.left.toDouble()).toInt(), waterfall.top, max(cutout.safeInsetRight.toDouble(), waterfall.right.toDouble()).toInt(), Loading @@ -104,8 +103,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : ) } } screenshotStatic.layoutParams = p screenshotStatic.requestLayout() } private fun getSwipeRegion(): Region { Loading Loading
packages/SystemUI/res/layout/screenshot_shelf.xml +3 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/screenshot_static" android:layout_width="match_parent" android:layout_height="match_parent"> android:layout_height="match_parent" android:clipChildren="false" android:clipToPadding="false"> <FrameLayout android:id="@+id/actions_container_background" android:visibility="gone" Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotAnimationController.kt +16 −1 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ class ScreenshotAnimationController(private val view: ScreenshotShelfView) { private val staticUI = listOf<View>( view.requireViewById(R.id.screenshot_preview_border), view.requireViewById(R.id.actions_container_background), view.requireViewById(R.id.screenshot_badge), view.requireViewById(R.id.screenshot_dismiss_button) ) Loading Loading @@ -71,6 +70,8 @@ class ScreenshotAnimationController(private val view: ScreenshotShelfView) { entranceAnimation.doOnStart { screenshotPreview.visibility = View.INVISIBLE } } entranceAnimation.play(getActionsAnimator()).with(previewAnimator) val fadeInAnimator = ValueAnimator.ofFloat(0f, 1f) fadeInAnimator.addUpdateListener { for (child in staticUI) { Loading Loading @@ -123,6 +124,20 @@ class ScreenshotAnimationController(private val view: ScreenshotShelfView) { animator?.cancel() } private fun getActionsAnimator(): Animator { val startingOffset = view.height - actionContainer.top val actionsYAnimator = ValueAnimator.ofFloat(startingOffset.toFloat(), 0f).apply { duration = PREVIEW_Y_ANIMATION_DURATION_MS interpolator = fastOutSlowIn } actionsYAnimator.addUpdateListener { actionContainer.translationY = it.animatedValue as Float } actionContainer.translationY = startingOffset.toFloat() return actionsYAnimator } private fun getPreviewAnimator(bounds: Rect): Animator { val targetPosition = Rect() screenshotPreview.getHitRect(targetPosition) Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +3 −6 Original line number Diff line number Diff line Loading @@ -77,15 +77,14 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : fun updateInsets(insets: WindowInsets) { val orientation = mContext.resources.configuration.orientation val inPortrait = orientation == Configuration.ORIENTATION_PORTRAIT val p = screenshotStatic.layoutParams as LayoutParams val cutout = insets.displayCutout val navBarInsets = insets.getInsets(WindowInsets.Type.navigationBars()) if (cutout == null) { p.setMargins(0, 0, 0, navBarInsets.bottom) screenshotStatic.setPadding(0, 0, 0, navBarInsets.bottom) } else { val waterfall = cutout.waterfallInsets if (inPortrait) { p.setMargins( screenshotStatic.setPadding( waterfall.left, max(cutout.safeInsetTop.toDouble(), waterfall.top.toDouble()).toInt(), waterfall.right, Loading @@ -96,7 +95,7 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : .toInt() ) } else { p.setMargins( screenshotStatic.setPadding( max(cutout.safeInsetLeft.toDouble(), waterfall.left.toDouble()).toInt(), waterfall.top, max(cutout.safeInsetRight.toDouble(), waterfall.right.toDouble()).toInt(), Loading @@ -104,8 +103,6 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : ) } } screenshotStatic.layoutParams = p screenshotStatic.requestLayout() } private fun getSwipeRegion(): Region { Loading