aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin/ca/allanwang
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-21 21:10:18 -0700
committerAllan Wang <me@allanwang.ca>2017-06-21 21:10:18 -0700
commit621c083b4ee1a81c67665ebf4b442f0ea98b5d4a (patch)
treedfed2a9fedc185aee4315f71e5a993bd1c374438 /sample/src/main/kotlin/ca/allanwang
parent5c1a82b943e148ef6109b1d1ec65f89198458735 (diff)
downloadkau-621c083b4ee1a81c67665ebf4b442f0ea98b5d4a.tar.gz
kau-621c083b4ee1a81c67665ebf4b442f0ea98b5d4a.tar.bz2
kau-621c083b4ee1a81c67665ebf4b442f0ea98b5d4a.zip
Remapped kprefs to support sub items
Diffstat (limited to 'sample/src/main/kotlin/ca/allanwang')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
index 8867a00..d4c8c6e 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
import ca.allanwang.kau.email.sendEmail
+import ca.allanwang.kau.kpref.CoreAttributeContract
import ca.allanwang.kau.kpref.KPrefActivity
import ca.allanwang.kau.kpref.KPrefAdapterBuilder
import ca.allanwang.kau.utils.*
@@ -13,9 +14,12 @@ import com.mikepenz.google_material_typeface_library.GoogleMaterial
class MainActivity : KPrefActivity() {
- override fun onCreateKPrefs(savedInstanceState: android.os.Bundle?): KPrefAdapterBuilder.() -> Unit = {
+ override fun kPrefCoreAttributes(): CoreAttributeContract.() -> Unit = {
textColor = { KPrefSample.textColor }
accentColor = { KPrefSample.accentColor }
+ }
+
+ override fun onCreateKPrefs(savedInstanceState: android.os.Bundle?): KPrefAdapterBuilder.() -> Unit = {
header(R.string.header)
@@ -105,6 +109,7 @@ class MainActivity : KPrefActivity() {
when (item.itemId) {
R.id.action_settings -> startActivity(AnimActivity::class.java, clearStack = true)
R.id.action_email -> sendEmail(R.string.your_email, R.string.your_subject)
+ R.id.test -> prefHolder.showNext()
else -> return super.onOptionsItemSelected(item)
}
return true