aboutsummaryrefslogtreecommitdiff
path: root/kpref-activity/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'kpref-activity/README.md')
-rw-r--r--kpref-activity/README.md16
1 files changed, 13 insertions, 3 deletions
diff --git a/kpref-activity/README.md b/kpref-activity/README.md
index 5ec94a6..015d0d8 100644
--- a/kpref-activity/README.md
+++ b/kpref-activity/README.md
@@ -39,9 +39,6 @@ An example of the adapter builder:
```kotlin
override fun onCreateKPrefs(savedInstanceState: android.os.Bundle?): KPrefAdapterBuilder.() -> Unit = {
-
- textColor = { KPrefSample.textColor } // getter function so the new text color will be retrieved for every reload
- accentColor = { KPrefSample.accentColor }
header(R.string.header)
@@ -66,4 +63,17 @@ override fun onCreateKPrefs(savedInstanceState: android.os.Bundle?): KPrefAdapte
}
}
}
+```
+
+On top of per item configurations, `KPrefActivity` has some core attributes that you can define on creation.
+It is done through the abstract function:
+
+```kotlin
+
+ override fun kPrefCoreAttributes(): CoreAttributeContract.() -> Unit = {
+ textColor = { Prefs.textColor } // text color getter; refreshes automatically on reload
+ accentColor = { Prefs.accentColor } // accent color getter
+ // background color does not exist as it is done through the ripple canvas
+ }
+
``` \ No newline at end of file