Skip to content

Commit 9c59163

Browse files
committed
Added option for changing ListPref button color
1 parent a46071c commit 9c59163

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

ComposePrefs3/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ afterEvaluate {
5454

5555
groupId = 'com.github.jamalmulla'
5656
artifactId = 'ComposePrefs3'
57-
version = '1.0.1'
57+
version = '1.0.2'
5858
}
5959
}
6060
}

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
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ maven { url "https://jitpack.io" }
219219
and in your module `build.gradle` file add the dependencies
220220

221221
``` groovy
222-
implementation "com.github.JamalMulla:ComposePrefs3:<version>" // Current is 1.0.1
222+
implementation "com.github.JamalMulla:ComposePrefs3:<version>" // Current is 1.0.2
223223
implementation "androidx.datastore:datastore-preferences:1.0.0"
224224
```
225225

0 commit comments

Comments
 (0)