aboutsummaryrefslogtreecommitdiff
path: root/sample/src/main/kotlin/ca
diff options
context:
space:
mode:
Diffstat (limited to 'sample/src/main/kotlin/ca')
-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