diff options
author | Allan Wang <me@allanwang.ca> | 2017-12-10 23:39:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-10 23:39:57 -0500 |
commit | fb9ca21757068c0fb4123a5e30b1471ae4c32cf3 (patch) | |
tree | 7d5b5bbe749f24d522ebe6a57c1bf73f1590de48 /sample/src | |
parent | 1269a026da6a4597f7123e310768e3377e8c63e8 (diff) | |
download | kau-fb9ca21757068c0fb4123a5e30b1471ae4c32cf3.tar.gz kau-fb9ca21757068c0fb4123a5e30b1471ae4c32cf3.tar.bz2 kau-fb9ca21757068c0fb4123a5e30b1471ae4c32cf3.zip |
Unify start activity design (#112)
Diffstat (limited to 'sample/src')
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt | 12 | ||||
-rw-r--r-- | sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 7 |
2 files changed, 11 insertions, 8 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt index f052d97..3f25ac3 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt @@ -10,10 +10,7 @@ import ca.allanwang.kau.permissions.kauRequestPermissions import ca.allanwang.kau.swipe.SWIPE_EDGE_LEFT import ca.allanwang.kau.swipe.kauSwipeOnCreate import ca.allanwang.kau.swipe.kauSwipeOnDestroy -import ca.allanwang.kau.utils.fullLinearRecycler -import ca.allanwang.kau.utils.startActivitySlideOut -import ca.allanwang.kau.utils.toast -import ca.allanwang.kau.utils.withAlpha +import ca.allanwang.kau.utils.* import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter /** @@ -36,8 +33,7 @@ class AnimActivity : KauBaseActivity() { ).map { PermissionCheckbox(it) }) adapter.withOnClickListener { _, _, item, _ -> KL.d("Perm Click") - kauRequestPermissions(item.permission) { - granted, _ -> + kauRequestPermissions(item.permission) { granted, _ -> toast("${item.permission} enabled: $granted") adapter.notifyAdapterDataSetChanged() } @@ -54,7 +50,9 @@ class AnimActivity : KauBaseActivity() { } override fun onBackPressed() { - startActivitySlideOut(MainActivity::class.java) + startActivity(MainActivity::class.java, bundleBuilder = { + withSlideOut(this@AnimActivity) + }) } }
\ No newline at end of file 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 482c911..dd81ce1 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -173,7 +173,12 @@ class MainActivity : KPrefActivity() { } plainText(R.string.adapter_showcase) { - onClick = { _, _, _ -> startActivity(AdapterActivity::class.java, transition = true); false } + onClick = { _, _, _ -> + startActivity(AdapterActivity::class.java, bundleBuilder = { + withSceneTransitionAnimation(this@MainActivity) + }) + false + } } plainText(R.string.kau_about_app) { |