@@ -9,14 +9,35 @@ import androidx.compose.foundation.layout.defaultMinSize
9
9
import androidx.compose.foundation.layout.padding
10
10
import androidx.compose.foundation.shape.CircleShape
11
11
import androidx.compose.runtime.Composable
12
+ import androidx.compose.runtime.ReadOnlyComposable
12
13
import androidx.compose.ui.Alignment
13
14
import androidx.compose.ui.Modifier
15
+ import androidx.compose.ui.graphics.Color
14
16
import androidx.compose.ui.graphics.Shape
15
17
import androidx.compose.ui.unit.dp
18
+ import org.jellyfin.androidtv.ui.base.JellyfinTheme
16
19
17
20
object ButtonDefaults {
18
21
val Shape : Shape = CircleShape
19
22
val ContentPadding : PaddingValues = PaddingValues (horizontal = 16 .dp, vertical = 10 .dp)
23
+
24
+ @ReadOnlyComposable
25
+ @Composable
26
+ fun colors (
27
+ containerColor : Color = JellyfinTheme .colorScheme.button,
28
+ contentColor : Color = JellyfinTheme .colorScheme.onButton,
29
+ focusedContainerColor : Color = JellyfinTheme .colorScheme.buttonFocused,
30
+ focusedContentColor : Color = JellyfinTheme .colorScheme.onButtonFocused,
31
+ disabledContainerColor : Color = JellyfinTheme .colorScheme.buttonDisabled,
32
+ disabledContentColor : Color = JellyfinTheme .colorScheme.onButtonDisabled,
33
+ ) = ButtonColors (
34
+ containerColor = containerColor,
35
+ contentColor = contentColor,
36
+ focusedContainerColor = focusedContainerColor,
37
+ focusedContentColor = focusedContentColor,
38
+ disabledContainerColor = disabledContainerColor,
39
+ disabledContentColor = disabledContentColor,
40
+ )
20
41
}
21
42
22
43
@Composable
@@ -26,6 +47,7 @@ fun Button(
26
47
onLongClick : (() -> Unit )? = null,
27
48
enabled : Boolean = true,
28
49
shape : Shape = ButtonDefaults .Shape ,
50
+ colors : ButtonColors = ButtonDefaults .colors(),
29
51
contentPadding : PaddingValues = ButtonDefaults .ContentPadding ,
30
52
interactionSource : MutableInteractionSource ? = null,
31
53
content : @Composable RowScope .() -> Unit
@@ -36,6 +58,7 @@ fun Button(
36
58
onLongClick = onLongClick,
37
59
enabled = enabled,
38
60
shape = shape,
61
+ colors = colors,
39
62
interactionSource = interactionSource,
40
63
) {
41
64
ButtonRow (
@@ -53,6 +76,7 @@ fun ProgressButton(
53
76
onLongClick : (() -> Unit )? = null,
54
77
enabled : Boolean = true,
55
78
shape : Shape = ButtonDefaults .Shape ,
79
+ colors : ButtonColors = ButtonDefaults .colors(),
56
80
contentPadding : PaddingValues = ButtonDefaults .ContentPadding ,
57
81
interactionSource : MutableInteractionSource ? = null,
58
82
content : @Composable RowScope .() -> Unit
@@ -64,6 +88,7 @@ fun ProgressButton(
64
88
onLongClick = onLongClick,
65
89
enabled = enabled,
66
90
shape = shape,
91
+ colors = colors,
67
92
interactionSource = interactionSource,
68
93
) {
69
94
ButtonRow (
0 commit comments