aboutsummaryrefslogtreecommitdiff
path: root/sample/src
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-26 19:55:04 -0700
committerAllan Wang <me@allanwang.ca>2017-06-26 19:55:04 -0700
commita931fa42e3e938dcc1a60fec92b882aebd49a744 (patch)
treec693c837f93dd6998818f4e2cc42db96ac8c3d81 /sample/src
parentcb2da7537c544e847373981a861b6a8ec151b847 (diff)
downloadkau-a931fa42e3e938dcc1a60fec92b882aebd49a744.tar.gz
kau-a931fa42e3e938dcc1a60fec92b882aebd49a744.tar.bz2
kau-a931fa42e3e938dcc1a60fec92b882aebd49a744.zip
Add some comments
Diffstat (limited to 'sample/src')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt6
-rw-r--r--sample/src/main/res/xml/changelog.xml12
2 files changed, 12 insertions, 6 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 4c22c2a..3cd714e 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -20,7 +20,7 @@ import com.mikepenz.google_material_typeface_library.GoogleMaterial
class MainActivity : KPrefActivity() {
- lateinit var searchView: SearchView
+ var searchView: SearchView? = null
//some of the most common english words for show
val wordBank: List<String> by lazy {
listOf("the", "name", "of", "very", "to", "through",
@@ -178,7 +178,7 @@ class MainActivity : KPrefActivity() {
override fun onCreateOptionsMenu(menu: Menu): Boolean {
menuInflater.inflate(R.menu.menu_main, menu)
- searchView = bindSearchView(menu, R.id.action_search) {
+ if (searchView == null) searchView = bindSearchView(menu, R.id.action_search) {
textObserver = {
observable, searchView ->
/*
@@ -213,6 +213,6 @@ class MainActivity : KPrefActivity() {
}
override fun onBackPressed() {
- if (!searchView.onBackPressed()) super.onBackPressed()
+ if (!(searchView?.onBackPressed() ?: false)) super.onBackPressed()
}
}
diff --git a/sample/src/main/res/xml/changelog.xml b/sample/src/main/res/xml/changelog.xml
index d864f74..003ee8b 100644
--- a/sample/src/main/res/xml/changelog.xml
+++ b/sample/src/main/res/xml/changelog.xml
@@ -6,15 +6,21 @@
<item text="" />
-->
+ <version title="v1.4"/>
+ <item text="" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
+ <item text="" />
+
<version title="v1.3"/>
<item text="Added kpref subitems" />
<item text="Added DSL markers" />
<item text="Added transition utils and other utils" />
<item text="Added custom searchview with binders" />
<item text="Added KauBoundedCardView" />
- <item text="" />
- <item text="" />
- <item text="" />
<version title="v1.2"/>
<item text="Fix title attribute in changelog" />