Loading packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotShelfViewProxy.kt +2 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ constructor( viewModel, LayoutInflater.from(context), onDismissalRequested = { event, velocity -> requestDismissal(event, velocity) }, onDismissalCancelled = { animationController.getSwipeReturnAnimation().start() } onDismissalCancelled = { animationController.getSwipeReturnAnimation().start() }, onUserInteraction = { callbacks?.onUserInteraction() } ) view.updateInsets(windowManager.currentWindowMetrics.windowInsets) addPredictiveBackListener { requestDismissal(SCREENSHOT_DISMISSED_OTHER) } Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +16 −0 Original line number Diff line number Diff line Loading @@ -39,11 +39,20 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : private lateinit var screenshotStatic: ViewGroup var onTouchInterceptListener: ((MotionEvent) -> Boolean)? = null var userInteractionCallback: (() -> Unit)? = null private val displayMetrics = context.resources.displayMetrics private val tmpRect = Rect() private lateinit var actionsContainerBackground: View private lateinit var dismissButton: View init { setOnTouchListener({ _: View, _: MotionEvent -> userInteractionCallback?.invoke() true }) } override fun onFinishInflate() { super.onFinishInflate() // Get focus so that the key events go to the layout. Loading Loading @@ -127,7 +136,14 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : private const val TOUCH_PADDING_DP = 12f } override fun onInterceptHoverEvent(event: MotionEvent): Boolean { userInteractionCallback?.invoke() return super.onInterceptHoverEvent(event) } override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { userInteractionCallback?.invoke() if (onTouchInterceptListener?.invoke(ev) == true) { return true } Loading packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ScreenshotShelfViewBinder.kt +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ object ScreenshotShelfViewBinder { layoutInflater: LayoutInflater, onDismissalRequested: (event: ScreenshotEvent, velocity: Float?) -> Unit, onDismissalCancelled: () -> Unit, onUserInteraction: () -> Unit ) { val swipeGestureListener = SwipeGestureListener( Loading @@ -55,6 +56,7 @@ object ScreenshotShelfViewBinder { onCancel = onDismissalCancelled ) view.onTouchInterceptListener = { swipeGestureListener.onMotionEvent(it) } view.userInteractionCallback = onUserInteraction val previewView: ImageView = view.requireViewById(R.id.screenshot_preview) val previewViewBlur: ImageView = view.requireViewById(R.id.screenshot_preview_blur) Loading Loading
packages/SystemUI/src/com/android/systemui/screenshot/ScreenshotShelfViewProxy.kt +2 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,8 @@ constructor( viewModel, LayoutInflater.from(context), onDismissalRequested = { event, velocity -> requestDismissal(event, velocity) }, onDismissalCancelled = { animationController.getSwipeReturnAnimation().start() } onDismissalCancelled = { animationController.getSwipeReturnAnimation().start() }, onUserInteraction = { callbacks?.onUserInteraction() } ) view.updateInsets(windowManager.currentWindowMetrics.windowInsets) addPredictiveBackListener { requestDismissal(SCREENSHOT_DISMISSED_OTHER) } Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/ScreenshotShelfView.kt +16 −0 Original line number Diff line number Diff line Loading @@ -39,11 +39,20 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : private lateinit var screenshotStatic: ViewGroup var onTouchInterceptListener: ((MotionEvent) -> Boolean)? = null var userInteractionCallback: (() -> Unit)? = null private val displayMetrics = context.resources.displayMetrics private val tmpRect = Rect() private lateinit var actionsContainerBackground: View private lateinit var dismissButton: View init { setOnTouchListener({ _: View, _: MotionEvent -> userInteractionCallback?.invoke() true }) } override fun onFinishInflate() { super.onFinishInflate() // Get focus so that the key events go to the layout. Loading Loading @@ -127,7 +136,14 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) : private const val TOUCH_PADDING_DP = 12f } override fun onInterceptHoverEvent(event: MotionEvent): Boolean { userInteractionCallback?.invoke() return super.onInterceptHoverEvent(event) } override fun onInterceptTouchEvent(ev: MotionEvent): Boolean { userInteractionCallback?.invoke() if (onTouchInterceptListener?.invoke(ev) == true) { return true } Loading
packages/SystemUI/src/com/android/systemui/screenshot/ui/binder/ScreenshotShelfViewBinder.kt +2 −0 Original line number Diff line number Diff line Loading @@ -45,6 +45,7 @@ object ScreenshotShelfViewBinder { layoutInflater: LayoutInflater, onDismissalRequested: (event: ScreenshotEvent, velocity: Float?) -> Unit, onDismissalCancelled: () -> Unit, onUserInteraction: () -> Unit ) { val swipeGestureListener = SwipeGestureListener( Loading @@ -55,6 +56,7 @@ object ScreenshotShelfViewBinder { onCancel = onDismissalCancelled ) view.onTouchInterceptListener = { swipeGestureListener.onMotionEvent(it) } view.userInteractionCallback = onUserInteraction val previewView: ImageView = view.requireViewById(R.id.screenshot_preview) val previewViewBlur: ImageView = view.requireViewById(R.id.screenshot_preview_blur) Loading