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 2d7ab93 commit aa8bad2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions ComposePrefs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
minSdk 21
targetSdk 31
versionCode 2
versionName "1.0.3"
versionName "1.0.4"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
Expand Down Expand Up @@ -54,7 +54,7 @@ afterEvaluate {

groupId = 'com.github.jamalmulla'
artifactId = 'ComposePrefs'
version = '1.0.3'
version = '1.0.4'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ import java.lang.Exception
* @param useSelectedAsSummary If true, uses the current selected item as the summary
* @param dialogBackgroundColor Background color of the Dialog
* @param contentColor Preferred content color passed to dialog's children
* @param textColor Text colour of the [title] and [summary]
* @param textColor Text colour of the [title], [summary] and [entries]
* @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 @@ -54,6 +55,7 @@ fun ListPref(
contentColor: Color = contentColorFor(dialogBackgroundColor),
textColor: Color = MaterialTheme.colors.onBackground,
selectionColor: Color = MaterialTheme.colors.primary,
buttonColor: Color = MaterialTheme.colors.primary,
enabled: Boolean = true,
entries: Map<String, String> = mapOf(), //TODO: Change to List?
) {
Expand Down Expand Up @@ -137,7 +139,7 @@ fun ListPref(
TextButton(
onClick = { showDialog = false },
) {
Text("Cancel", style = MaterialTheme.typography.body1, color = textColor)
Text("Cancel", style = MaterialTheme.typography.body1, color = buttonColor)
}

},
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ maven { url "https://jitpack.io" }
and in your module `build.gradle` file add the dependencies

``` groovy
implementation "com.github.JamalMulla:ComposePrefs:<version>" // Current is 1.0.3
implementation "com.github.JamalMulla:ComposePrefs:<version>" // Current is 1.0.4
implementation "androidx.datastore:datastore-preferences:1.0.0"
```

Expand Down

0 comments on commit aa8bad2

Please sign in to comment.