Skip to content

Commit 6516ce5

Browse files
committed
Added option for changing ListPref button color
1 parent a46071c commit 6516ce5

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • ComposePrefs3/src/main/java/com/jamal/composeprefs3/ui/prefs

ComposePrefs3/src/main/java/com/jamal/composeprefs3/ui/prefs/ListPref.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import java.lang.Exception
3434
* @param contentColor Preferred content color passed to dialog's children
3535
* @param textColor Text colour of the [title] and [summary]
3636
* @param selectionColor Colour of the radiobutton of the selected item
37+
* @param buttonColor Colour of the cancel button
3738
* @param enabled If false, this Pref cannot be clicked and the Dialog cannot be shown.
3839
* @param entries Map of keys to values for entries that should be shown in the Dialog.
3940
*/
@@ -52,6 +53,7 @@ fun ListPref(
5253
contentColor: Color = contentColorFor(dialogBackgroundColor),
5354
textColor: Color = MaterialTheme.colorScheme.onBackground,
5455
selectionColor: Color = MaterialTheme.colorScheme.primary,
56+
buttonColor: Color = MaterialTheme.colorScheme.primary,
5557
enabled: Boolean = true,
5658
entries: Map<String, String> = mapOf(), //TODO: Change to List?
5759
) {
@@ -135,7 +137,7 @@ fun ListPref(
135137
TextButton(
136138
onClick = { showDialog = false },
137139
) {
138-
Text("Cancel", style = MaterialTheme.typography.bodyLarge)
140+
Text("Cancel", style = MaterialTheme.typography.bodyLarge, color = buttonColor)
139141
}
140142

141143
},

0 commit comments

Comments
 (0)