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

Commit 21f93075 authored by Mady Mellor's avatar Mady Mellor Committed by Android (Google) Code Review
Browse files

Merge "Set a view id for the bubble dismiss view (shell)" into main

parents 27ccd0ae aceb4ed8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -42,4 +42,6 @@
    <item type="id" name="action_move_top_right"/>
    <item type="id" name="action_move_bottom_left"/>
    <item type="id" name="action_move_bottom_right"/>

    <item type="id" name="dismiss_view"/>
</resources>
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import com.android.wm.shell.common.bubbles.DismissView

fun DismissView.setup() {
    setup(DismissView.Config(
            dismissViewResId = R.id.dismiss_view,
            targetSizeResId = R.dimen.dismiss_circle_size,
            iconSizeResId = R.dimen.dismiss_target_x_size,
            bottomMarginResId = R.dimen.floating_dismiss_bottom_margin,
+3 −0
Original line number Diff line number Diff line
@@ -49,6 +49,8 @@ class DismissView(context: Context) : FrameLayout(context) {
     * @see [setup] method
     */
    data class Config(
            /** The resource id to set on the dismiss target circle view */
            val dismissViewResId: Int,
            /** dimen resource id of the dismiss target circle view size */
            @DimenRes val targetSizeResId: Int,
            /** dimen resource id of the icon size in the dismiss target */
@@ -121,6 +123,7 @@ class DismissView(context: Context) : FrameLayout(context) {
        setBackgroundDrawable(gradientDrawable)

        // Setup DismissCircleView
        circle.id = config.dismissViewResId
        circle.setup(config.backgroundResId, config.iconResId, config.iconSizeResId)
        val targetSize: Int = resources.getDimensionPixelSize(config.targetSizeResId)
        circle.layoutParams = LayoutParams(targetSize, targetSize,