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

Commit 40432f26 authored by Yein Jo's avatar Yein Jo Committed by Android (Google) Code Review
Browse files

Merge "Add thumbnail blur view for ripple reveal effect in the screenshot thumbnail" into 24D1-dev

parents 90d23edf c3e36a62
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -84,6 +84,22 @@
            android:clickable="true"
            app:layout_constraintStart_toStartOf="@id/screenshot_preview_border"
            app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border"/>
        <!--  Keep the same dimension with screenshot_preview.  -->
        <ImageView
            android:id="@+id/screenshot_preview_blur"
            android:layout_width="@dimen/overlay_x_scale"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/overlay_border_width"
            android:layout_marginBottom="@dimen/overlay_border_width"
            android:layout_gravity="center"
            android:elevation="4dp"
            android:contentDescription="@string/screenshot_edit_description"
            android:scaleType="fitEnd"
            android:background="@drawable/overlay_preview_background"
            android:adjustViewBounds="true"
            android:visibility="invisible"
            app:layout_constraintStart_toStartOf="@id/screenshot_preview_border"
            app:layout_constraintBottom_toBottomOf="@id/screenshot_preview_border"/>
        <ImageView
            android:id="@+id/screenshot_badge"
            android:layout_width="56dp"
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ constructor(
        }
        screenshotPreview = view.screenshotPreview
        thumbnailObserver.setViews(
            view.screenshotPreview,
            view.blurredScreenshotPreview,
            view.requireViewById(R.id.screenshot_preview_border)
        )
    }
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import kotlin.math.max
class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) :
    FrameLayout(context, attrs) {
    lateinit var screenshotPreview: ImageView
    lateinit var blurredScreenshotPreview: ImageView
    private lateinit var screenshotStatic: ViewGroup
    var onTouchInterceptListener: ((MotionEvent) -> Boolean)? = null

@@ -48,6 +49,7 @@ class ScreenshotShelfView(context: Context, attrs: AttributeSet? = null) :
        // Get focus so that the key events go to the layout.
        isFocusableInTouchMode = true
        screenshotPreview = requireViewById(R.id.screenshot_preview)
        blurredScreenshotPreview = requireViewById(R.id.screenshot_preview_blur)
        screenshotStatic = requireViewById(R.id.screenshot_static)
        actionsContainerBackground = requireViewById(R.id.actions_container_background)
        dismissButton = requireViewById(R.id.screenshot_dismiss_button)
+3 −0
Original line number Diff line number Diff line
@@ -55,8 +55,10 @@ object ScreenshotShelfViewBinder {
        view.onTouchInterceptListener = { swipeGestureListener.onMotionEvent(it) }

        val previewView: ImageView = view.requireViewById(R.id.screenshot_preview)
        val previewViewBlur: ImageView = view.requireViewById(R.id.screenshot_preview_blur)
        val previewBorder = view.requireViewById<View>(R.id.screenshot_preview_border)
        previewView.clipToOutline = true
        previewViewBlur.clipToOutline = true
        val actionsContainer: LinearLayout = view.requireViewById(R.id.screenshot_actions)
        val dismissButton = view.requireViewById<View>(R.id.screenshot_dismiss_button)
        dismissButton.visibility = if (viewModel.showDismissButton) View.VISIBLE else View.GONE
@@ -72,6 +74,7 @@ object ScreenshotShelfViewBinder {
                        viewModel.preview.collect { bitmap ->
                            if (bitmap != null) {
                                setScreenshotBitmap(previewView, bitmap)
                                setScreenshotBitmap(previewViewBlur, bitmap)
                                previewView.visibility = View.VISIBLE
                                previewBorder.visibility = View.VISIBLE
                            } else {