From 1805793c7cea8a3c56a8111e0a80d7ac5da95f63 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Mon, 12 Jun 2017 20:01:34 -0700 Subject: Add sliding activities --- sample/src/main/AndroidManifest.xml | 3 +++ .../kotlin/ca/allanwang/kau/sample/AnimActivity.kt | 22 ++++++++++++++++++++++ .../kotlin/ca/allanwang/kau/sample/MainActivity.kt | 11 ++--------- sample/src/main/res/layout/sample.xml | 13 +++++++++++++ sample/src/main/res/menu/menu_main.xml | 20 -------------------- sample/src/main/res/values/styles.xml | 1 + 6 files changed, 41 insertions(+), 29 deletions(-) create mode 100644 sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt create mode 100644 sample/src/main/res/layout/sample.xml (limited to 'sample') diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index 1934e71..03ca52c 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -19,6 +19,9 @@ + \ No newline at end of file diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt new file mode 100644 index 0000000..10f2065 --- /dev/null +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt @@ -0,0 +1,22 @@ +package ca.allanwang.kau.sample + +import android.os.Bundle +import android.support.v7.app.AppCompatActivity +import ca.allanwang.kau.utils.startActivitySlideOut + +/** + * Created by Allan Wang on 2017-06-12. + * + * Empty Activity for animations + */ +class AnimActivity : AppCompatActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.sample) + } + + override fun onBackPressed() { + startActivitySlideOut(MainActivity::class.java) + } +} \ 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 ac80fc6..2b11ced 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -7,7 +7,7 @@ import ca.allanwang.kau.kpref.KPrefActivity import ca.allanwang.kau.kpref.KPrefAdapterBuilder import ca.allanwang.kau.utils.darken import ca.allanwang.kau.utils.navigationBarColor -import ca.allanwang.kau.utils.showChangelog +import ca.allanwang.kau.utils.startActivitySlideIn import ca.allanwang.kau.views.RippleCanvas import com.mikepenz.google_material_typeface_library.GoogleMaterial @@ -65,14 +65,7 @@ class MainActivity : KPrefActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.action_settings -> { - - } - R.id.action_changelog -> showChangelog(R.xml.kau_changelog) - R.id.action_call -> { - } - R.id.action_db -> { - } - R.id.action_restart -> { + startActivitySlideIn(AnimActivity::class.java, clearStack = true) } else -> return super.onOptionsItemSelected(item) } diff --git a/sample/src/main/res/layout/sample.xml b/sample/src/main/res/layout/sample.xml new file mode 100644 index 0000000..c237fda --- /dev/null +++ b/sample/src/main/res/layout/sample.xml @@ -0,0 +1,13 @@ + + + + + + \ No newline at end of file diff --git a/sample/src/main/res/menu/menu_main.xml b/sample/src/main/res/menu/menu_main.xml index 5562ea4..3725b18 100644 --- a/sample/src/main/res/menu/menu_main.xml +++ b/sample/src/main/res/menu/menu_main.xml @@ -7,25 +7,5 @@ android:orderInCategory="100" android:title="Settings" app:showAsAction="never" /> - - - - diff --git a/sample/src/main/res/values/styles.xml b/sample/src/main/res/values/styles.xml index 7867278..ac2f9c8 100644 --- a/sample/src/main/res/values/styles.xml +++ b/sample/src/main/res/values/styles.xml @@ -6,6 +6,7 @@ @color/colorPrimary @color/colorPrimaryDark @color/colorAccent + #303030 true @android:color/transparent -- cgit v1.2.3