Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +25 −18 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.MotionEvent import android.view.View import android.view.ViewGroup import android.view.WindowInsets import android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL import android.widget.FrameLayout import android.widget.ImageView import com.android.systemui.res.R Loading Loading @@ -59,17 +60,17 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : ev1: MotionEvent?, ev2: MotionEvent, distanceX: Float, distanceY: Float distanceY: Float, ): Boolean { actionsContainer.getBoundsOnScreen(tmpRect) val touchedInActionsContainer = tmpRect.contains(ev2.rawX.toInt(), ev2.rawY.toInt()) val canHandleInternallyByScrolling = touchedInActionsContainer && actionsContainer.canScrollHorizontally(distanceX.toInt()) touchedInActionsContainer && actionsContainer.canScrollHorizontally(distanceX.toInt()) return !canHandleInternallyByScrolling } } }, ) init { Loading Loading @@ -106,6 +107,11 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : fun getTouchRegion(gestureInsets: Insets): Region { val region = getSwipeRegion() // only add gesture insets to touch region in gestural mode if ( resources.getInteger(com.android.internal.R.integer.config_navBarInteractionMode) == NAV_BAR_MODE_GESTURAL ) { // Receive touches in gesture insets so they don't cause TOUCH_OUTSIDE // left edge gesture region val insetRect = Rect(0, 0, gestureInsets.left, displayMetrics.heightPixels) Loading @@ -115,9 +121,10 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : displayMetrics.widthPixels - gestureInsets.right, 0, displayMetrics.widthPixels, displayMetrics.heightPixels displayMetrics.heightPixels, ) region.op(insetRect, Region.Op.UNION) } return region } Loading Loading @@ -153,7 +160,7 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : cutout.safeInsetBottom + verticalPadding, waterfall.bottom + verticalPadding, minimumBottomPadding, ) ), ) } else { screenshotStatic.setPadding( Loading @@ -164,7 +171,7 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : navBarInsets.bottom + verticalPadding, waterfall.bottom + verticalPadding, minimumBottomPadding, ) ), ) } } Loading Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +25 −18 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.MotionEvent import android.view.View import android.view.ViewGroup import android.view.WindowInsets import android.view.WindowManagerPolicyConstants.NAV_BAR_MODE_GESTURAL import android.widget.FrameLayout import android.widget.ImageView import com.android.systemui.res.R Loading Loading @@ -59,17 +60,17 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : ev1: MotionEvent?, ev2: MotionEvent, distanceX: Float, distanceY: Float distanceY: Float, ): Boolean { actionsContainer.getBoundsOnScreen(tmpRect) val touchedInActionsContainer = tmpRect.contains(ev2.rawX.toInt(), ev2.rawY.toInt()) val canHandleInternallyByScrolling = touchedInActionsContainer && actionsContainer.canScrollHorizontally(distanceX.toInt()) touchedInActionsContainer && actionsContainer.canScrollHorizontally(distanceX.toInt()) return !canHandleInternallyByScrolling } } }, ) init { Loading Loading @@ -106,6 +107,11 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : fun getTouchRegion(gestureInsets: Insets): Region { val region = getSwipeRegion() // only add gesture insets to touch region in gestural mode if ( resources.getInteger(com.android.internal.R.integer.config_navBarInteractionMode) == NAV_BAR_MODE_GESTURAL ) { // Receive touches in gesture insets so they don't cause TOUCH_OUTSIDE // left edge gesture region val insetRect = Rect(0, 0, gestureInsets.left, displayMetrics.heightPixels) Loading @@ -115,9 +121,10 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : displayMetrics.widthPixels - gestureInsets.right, 0, displayMetrics.widthPixels, displayMetrics.heightPixels displayMetrics.heightPixels, ) region.op(insetRect, Region.Op.UNION) } return region } Loading Loading @@ -153,7 +160,7 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : cutout.safeInsetBottom + verticalPadding, waterfall.bottom + verticalPadding, minimumBottomPadding, ) ), ) } else { screenshotStatic.setPadding( Loading @@ -164,7 +171,7 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : navBarInsets.bottom + verticalPadding, waterfall.bottom + verticalPadding, minimumBottomPadding, ) ), ) } } Loading