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

Commit f4f8f15f authored by Ben Lin's avatar Ben Lin Committed by Android (Google) Code Review
Browse files

Merge "Add "Restore" a11y text to maximize button when it's a restore state." into main

parents 413c79b3 517f861e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -53,6 +53,10 @@ class MaximizeButtonView(
        (stubProgressBarContainer.inflate() as FrameLayout)
            .requireViewById(R.id.progress_bar)
    }
    private val maximizeButtonText =
        context.resources.getString(R.string.desktop_mode_maximize_menu_maximize_button_text)
    private val restoreButtonText =
        context.resources.getString(R.string.desktop_mode_maximize_menu_restore_button_text)

    init {
        LayoutInflater.from(context).inflate(R.layout.maximize_menu_button, this, true)
@@ -154,6 +158,12 @@ class MaximizeButtonView(
    /** Set the drawable resource to use for the maximize button. */
    fun setIcon(@DrawableRes icon: Int) {
        maximizeWindow.setImageResource(icon)
        when (icon) {
            R.drawable.decor_desktop_mode_immersive_or_maximize_exit_button_dark ->
                maximizeWindow.contentDescription = restoreButtonText
            R.drawable.decor_desktop_mode_maximize_button_dark ->
                maximizeWindow.contentDescription = maximizeButtonText
        }
    }

    companion object {