Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 32d6dd5e authored by Miranda Kephart's avatar Miranda Kephart Committed by Android (Google) Code Review
Browse files

Merge "Convert (new) ScreenshotController to kotlin" into main

parents 2da3de29 b3db0a1e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -505,8 +505,8 @@ public class LegacyScreenshotController implements InteractiveScreenshotHandler
            return;
        }
        // delay starting scroll capture to make sure scrim is up before the app moves
        mViewProxy.prepareScrollingTransition(response, mScreenBitmap, newScreenshot,
                mScreenshotTakenInPortrait, () -> executeBatchScrollCapture(response, owner));
        mViewProxy.prepareScrollingTransition(response, newScreenshot, mScreenshotTakenInPortrait,
                () -> executeBatchScrollCapture(response, owner));
    }

    private void executeBatchScrollCapture(ScrollCaptureResponse response, UserHandle owner) {
+0 −663

File deleted.

Preview size limit exceeded, changes collapsed.

+632 −0

File added.

Preview size limit exceeded, changes collapsed.

+6 −7
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ constructor(
    shelfViewBinder: ScreenshotShelfViewBinder,
    private val thumbnailObserver: ThumbnailObserver,
    @Assisted private val context: Context,
    @Assisted private val displayId: Int
    @Assisted private val displayId: Int,
) {

    interface ScreenshotViewCallback {
@@ -117,7 +117,7 @@ constructor(
            animationController,
            LayoutInflater.from(context),
            onDismissalRequested = { event, velocity -> requestDismissal(event, velocity) },
            onUserInteraction = { callbacks?.onUserInteraction() }
            onUserInteraction = { callbacks?.onUserInteraction() },
        )
        view.updateInsets(windowManager.currentWindowMetrics.windowInsets)
        addPredictiveBackListener { requestDismissal(SCREENSHOT_DISMISSED_OTHER) }
@@ -130,7 +130,7 @@ constructor(
        screenshotPreview = view.screenshotPreview
        thumbnailObserver.setViews(
            view.blurredScreenshotPreview,
            view.requireViewById(R.id.screenshot_preview_border)
            view.requireViewById(R.id.screenshot_preview_border),
        )
        view.addOnAttachStateChangeListener(
            object : View.OnAttachStateChangeListener {
@@ -204,7 +204,6 @@ constructor(

    fun prepareScrollingTransition(
        response: ScrollCaptureResponse,
        screenBitmap: Bitmap, // unused
        newScreenshot: Bitmap,
        screenshotTakenInPortrait: Boolean,
        onTransitionPrepared: Runnable,
@@ -224,7 +223,7 @@ constructor(
                0,
                0,
                context.resources.displayMetrics.widthPixels,
                context.resources.displayMetrics.heightPixels
                context.resources.displayMetrics.heightPixels,
            )
        )
        return r
@@ -239,7 +238,7 @@ constructor(
            animationController.runLongScreenshotTransition(
                transitionDestination,
                longScreenshot,
                onTransitionEnd
                onTransitionEnd,
            )
        transitionAnimation.doOnEnd { callbacks?.onDismiss() }
        transitionAnimation.start()
@@ -295,7 +294,7 @@ constructor(
                        .findOnBackInvokedDispatcher()
                        ?.registerOnBackInvokedCallback(
                            OnBackInvokedDispatcher.PRIORITY_DEFAULT,
                            onBackInvokedCallback
                            onBackInvokedCallback,
                        )
                }