Skip to content

Commit

Permalink
Added option for changing ListPref button color
Browse files Browse the repository at this point in the history
  • Loading branch information
JamalMulla committed May 22, 2022
1 parent a46071c commit 6516ce5
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import java.lang.Exception
* @param contentColor Preferred content color passed to dialog's children
* @param textColor Text colour of the [title] and [summary]
* @param selectionColor Colour of the radiobutton of the selected item
* @param buttonColor Colour of the cancel button
* @param enabled If false, this Pref cannot be clicked and the Dialog cannot be shown.
* @param entries Map of keys to values for entries that should be shown in the Dialog.
*/
Expand All @@ -52,6 +53,7 @@ fun ListPref(
contentColor: Color = contentColorFor(dialogBackgroundColor),
textColor: Color = MaterialTheme.colorScheme.onBackground,
selectionColor: Color = MaterialTheme.colorScheme.primary,
buttonColor: Color = MaterialTheme.colorScheme.primary,
enabled: Boolean = true,
entries: Map<String, String> = mapOf(), //TODO: Change to List?
) {
Expand Down Expand Up @@ -135,7 +137,7 @@ fun ListPref(
TextButton(
onClick = { showDialog = false },
) {
Text("Cancel", style = MaterialTheme.typography.bodyLarge)
Text("Cancel", style = MaterialTheme.typography.bodyLarge, color = buttonColor)
}

},
Expand Down

0 comments on commit 6516ce5

Please sign in to comment.