From 71f5dc2f7ce5b8183421586e6a77be65040a4dff Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 1 Jan 2018 23:22:51 -0500 Subject: Format everything and use reified generics --- .../src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt | 2 +- .../src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt | 11 ++++++----- sample/src/main/kotlin/ca/allanwang/kau/sample/SampleApp.kt | 1 - .../src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'sample/src/main/kotlin') 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 2ba3366..c0f928f 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt @@ -50,7 +50,7 @@ class AnimActivity : KauBaseActivity() { } override fun onBackPressed() { - startActivity(MainActivity::class.java, bundleBuilder = { + startActivity(bundleBuilder = { withSlideOut(this@AnimActivity) }) } 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 e735b38..6784705 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -162,22 +162,23 @@ class MainActivity : KPrefActivity() { } plainText(R.string.image_showcase) { - onClick = { kauLaunchMediaPicker(ImagePickerActivity::class.java, REQUEST_MEDIA) } + onClick = { kauLaunchMediaPicker(REQUEST_MEDIA) } } plainText(R.string.video_overlay_showcase) { - onClick = { kauLaunchMediaPicker(VideoPickerActivityOverlay::class.java, REQUEST_MEDIA) } + onClick = { kauLaunchMediaPicker(REQUEST_MEDIA) } } plainText(R.string.adapter_showcase) { - onClick = { startActivity(AdapterActivity::class.java, bundleBuilder = { + onClick = { + startActivity(bundleBuilder = { withSceneTransitionAnimation(this@MainActivity) }) } } plainText(R.string.kau_about_app) { - onClick = { kauLaunchAbout(AboutActivity::class.java) } + onClick = { kauLaunchAbout() } } header(R.string.long_prefs) @@ -268,7 +269,7 @@ class MainActivity : KPrefActivity() { backgroundColor(KPrefSample.bgColor) positiveColor(KPrefSample.accentColor) } - R.id.action_settings -> startActivity(AnimActivity::class.java) + R.id.action_settings -> startActivity() R.id.action_email -> sendEmail(R.string.your_email, R.string.your_subject) else -> return super.onOptionsItemSelected(item) } diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/SampleApp.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/SampleApp.kt index 8853c86..6060245 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/SampleApp.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/SampleApp.kt @@ -1,7 +1,6 @@ package ca.allanwang.kau.sample import android.app.Application -import ca.allanwang.kau.logging.KL /** * Created by Allan Wang on 2017-06-08. diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt index da088cf..bc2d4a4 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/SwipeActivity.kt @@ -15,7 +15,7 @@ import ca.allanwang.kau.utils.* private const val SWIPE_EDGE = "swipe_edge" fun Activity.startActivityWithEdge(flag: Int) { - startActivity(SwipeActivity::class.java) { + startActivity { putExtra(SWIPE_EDGE, flag) } } -- cgit v1.2.3