aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-17 12:09:28 -0700
committerAllan Wang <me@allanwang.ca>2017-06-17 12:09:28 -0700
commit56f423dfe0ad9605907d8ba4d13482378c208ba3 (patch)
treedca143314c18b4a71b9f8d440cfb2286f69f4e9b /README.md
parent575b3827baa7d74ac723a6131433993ea2935da4 (diff)
downloadkau-56f423dfe0ad9605907d8ba4d13482378c208ba3.tar.gz
kau-56f423dfe0ad9605907d8ba4d13482378c208ba3.tar.bz2
kau-56f423dfe0ad9605907d8ba4d13482378c208ba3.zip
Add more readme
Diffstat (limited to 'README.md')
-rw-r--r--README.md34
1 files changed, 34 insertions, 0 deletions
diff --git a/README.md b/README.md
index c8c9935..29bac91 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,7 @@ dependencies {
# Features
* [KPrefs](#kprefs)
+* [KPref Items](#kpref-items)
* [Changelog XML](#changelog)
* [Ripple Canvas](#ripple-canvas)
* [Timber Logger](#timber-logger)
@@ -81,6 +82,39 @@ The object inherits the initializer method `fun initialize(c: Context, preferenc
There is also a `reset()` method to clear the local values and have them retrieve from the SharedPreference again
+<a name="kpref-items"></a>
+## KPref Items
+
+KAU supports Preferences that are created without xmls and through AppCompat.
+The items are backed by a [FastAdapter](https://github.com/mikepenz/FastAdapter) and support [iicons](https://github.com/mikepenz/Android-Iconics)
+
+The easiest way to create the settings is to extend `KPrefActivity`.
+
+We will then override `onCreateKPrefs` to generate our adapter builder.
+
+The adapter builder implements `CoreAttributeContract` that will be added to every kpref item.
+Each item also extends a bunch of other contracts that allow for mandatory arguments and optional configurations.
+
+The contracts are as follows:
+
+Contract | Mandatory | Optional | Description
+:--- | :--- | :---
+`CoreAttributeContract` | `NA` | `textColor` `accentColor` | Defines stylings that are added in every item
+`CoreContract` | `titleRes` | `descRes` `iicon` | Implemented by every item
+`BaseContract` | `getter` `setter` | `enabler` `onClick` `onDisabledClick` | Implemented by every preference item
+`KPrefColorContract` | `NA` | `showPreview` | Additional configurations for the color picker
+`KPrefTextContract` | `NA` | `textGetter` | Additional configurations for the text item
+
+The kpref items are as followed:
+
+Item | Implements | Description
+:--- | :---
+`checkbox` | `CoreContract` `BaseContract` | Checkbox item; by default, clicking it will toggle the checkbox and the kpref
+`colorPicker` | `CoreContract` `BaseContract` `KPrefColorContract` | Color picker item; by default, clicking it will open a dialog which will change the color (int)
+`header` | `CoreContract` | Header; just a title that isn't clickable
+ `text` | `CoreContract` `BaseContract` `KPrefTextContract` | Text item; displays the kpref as a String on the right; does not have click implementation by default
+
+
<a name="changelog"></a>
## Changelog XML