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

Commit c9f8e2d6 authored by Daichi Hirono's avatar Daichi Hirono
Browse files

Fix hover effect on open_by_default_button

This change updates the open_by_default_button's size, padding, and
background to ensure the hover effect matches other buttons.

Video: http://recall/-/dvR0xNyCWFr2PAfPfPhsQ6/f9pbqmEkOvCfniPyNoxnsn
Bug: 403072612
Flag: com.android.window.flags.enable_desktop_windowing_mode
Test: manually check the hover
Change-Id: I54746eb6d086909372e7beaedf2327a69f224b58
parent 1c157f26
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -186,14 +186,13 @@

        <ImageButton
            android:id="@+id/open_by_default_button"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:layout_gravity="end|center_vertical"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="16dp"
            android:paddingStart="12dp"
            android:paddingEnd="16dp"
            android:contentDescription="@string/open_by_default_settings_text"
            android:src="@drawable/desktop_mode_ic_handle_menu_open_by_default_settings"
            android:tint="@androidprv:color/materialColorOnSurface"/>
            android:tint="@androidprv:color/materialColorOnSurface"
            style="@style/DesktopModeHandleMenuWindowingButton"/>
    </LinearLayout>
</LinearLayout>
+12 −7
Original line number Diff line number Diff line
@@ -500,6 +500,12 @@ class HandleMenu(
            t = iconButtondrawableBaseInset,
            b = iconButtondrawableBaseInset, l = 0, r = iconButtondrawableShiftInset
        )
        private val iconButtonDrawableInsetStart
            get() =
                if (context.isRtl) iconButtonDrawableInsetsRight else iconButtonDrawableInsetsLeft
        private val iconButtonDrawableInsetEnd
            get() =
                if (context.isRtl) iconButtonDrawableInsetsLeft else iconButtonDrawableInsetsRight

        // App Info Pill.
        private val appInfoPill = rootView.requireViewById<View>(R.id.app_info_pill)
@@ -760,16 +766,11 @@ class HandleMenu(
            desktopBtn.isEnabled = !taskInfo.isFreeform
            desktopBtn.imageTintList = style.windowingButtonColor

            val startInsets = if (context.isRtl) iconButtonDrawableInsetsRight
            else iconButtonDrawableInsetsLeft
            val endInsets = if (context.isRtl) iconButtonDrawableInsetsLeft
            else iconButtonDrawableInsetsRight

            fullscreenBtn.apply {
                background = createBackgroundDrawable(
                    color = style.textColor,
                    cornerRadius = iconButtonRippleRadius,
                    drawableInsets = startInsets
                    drawableInsets = iconButtonDrawableInsetStart
                )
            }

@@ -793,7 +794,7 @@ class HandleMenu(
                background = createBackgroundDrawable(
                    color = style.textColor,
                    cornerRadius = iconButtonRippleRadius,
                    drawableInsets = endInsets
                    drawableInsets = iconButtonDrawableInsetEnd
                )
            }
        }
@@ -843,6 +844,10 @@ class HandleMenu(
            openByDefaultBtn.apply {
                isGone = isBrowserApp
                imageTintList = ColorStateList.valueOf(style.textColor)
                background = createBackgroundDrawable(
                    color = style.textColor,
                    cornerRadius = iconButtonRippleRadius,
                    drawableInsets = iconButtonDrawableInsetEnd)
            }
        }