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

Commit 2a60ecc2 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin
Browse files

[Media] Secondary action buttons can be disabled.

Please refer to the screenshot at screen/43sXaFG3VAz27MH

Bug: 397989775
Test: tested in testbed app with fake data, see b/397989775#comment2 for
a screen recording of the entire thing in action in the compose gallery
app
Flag: EXEMPT none yet, code is currently unused

Change-Id: I06e6bb0a9c7fe2ed1f1ef624517a06f1ac64c35d
parent fc5a0392
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -207,6 +207,7 @@ private fun SecondaryActionContent(
        iconResource = (viewModel.icon as Icon.Resource).res,
        contentDescription = viewModel.icon.contentDescription?.load(),
        colors = IconButtonDefaults.iconButtonColors(contentColor = iconColor),
        enabled = viewModel.isEnabled,
        modifier = modifier.size(48.dp).padding(13.dp),
    )
}
+5 −1
Original line number Diff line number Diff line
@@ -19,4 +19,8 @@ package com.android.systemui.media.remedia.ui.viewmodel
import com.android.systemui.common.shared.model.Icon

/** Models UI state for a secondary action button within media controls. */
data class MediaSecondaryActionViewModel(val icon: Icon, val onClick: () -> Unit)
data class MediaSecondaryActionViewModel(
    val icon: Icon,
    val isEnabled: Boolean,
    val onClick: () -> Unit,
)