aboutsummaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2017-06-27 20:00:44 -0700
committerAllan Wang <me@allanwang.ca>2017-06-27 20:00:44 -0700
commita6ee77a4f1d78252b15059d51f2533fa03483d8c (patch)
treeb27b4a9cddfccce6f1edcdcdffba92c08bf33642 /sample
parent8179e50208192e2b18b4df3bfc100d9cf779891a (diff)
downloadkau-a6ee77a4f1d78252b15059d51f2533fa03483d8c.tar.gz
kau-a6ee77a4f1d78252b15059d51f2533fa03483d8c.tar.bz2
kau-a6ee77a4f1d78252b15059d51f2533fa03483d8c.zip
Testing about activity and chained adapters
Diffstat (limited to 'sample')
-rw-r--r--sample/proguard-rules.pro8
-rw-r--r--sample/src/main/AndroidManifest.xml3
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt34
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt9
-rw-r--r--sample/src/main/res/xml/changelog.xml2
5 files changed, 53 insertions, 3 deletions
diff --git a/sample/proguard-rules.pro b/sample/proguard-rules.pro
index 2b766bc..b76c0ff 100644
--- a/sample/proguard-rules.pro
+++ b/sample/proguard-rules.pro
@@ -17,9 +17,15 @@
#}
# Uncomment this to preserve the line number information for
-# debugging stack traces.
+# debugging indexStack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
+
+# About library
+-keep class .R
+-keep class **.R$* {
+ <fields>;
+} \ No newline at end of file
diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml
index b8b54bf..2a55f62 100644
--- a/sample/src/main/AndroidManifest.xml
+++ b/sample/src/main/AndroidManifest.xml
@@ -22,6 +22,9 @@
<activity
android:name=".AnimActivity"
android:theme="@style/AppTheme.Slide" />
+ <activity
+ android:name=".AboutActivity"
+ android:theme="@style/Theme.AppCompat.NoActionBar" />
</application>
</manifest> \ No newline at end of file
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt
new file mode 100644
index 0000000..574922d
--- /dev/null
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt
@@ -0,0 +1,34 @@
+package ca.allanwang.kau.sample
+
+import android.os.Bundle
+import android.os.PersistableBundle
+import ca.allanwang.kau.about.AboutActivityBase
+import ca.allanwang.kau.about.MainItem
+import ca.allanwang.kau.utils.string
+import com.mikepenz.fastadapter.adapters.HeaderAdapter
+
+/**
+ * Created by Allan Wang on 2017-06-27.
+ */
+class AboutActivity : AboutActivityBase(R.string::class.java) {
+
+ val mainHeader = HeaderAdapter<MainItem>()
+
+// override fun onCreateSections(): List<Pair<String, HeaderAdapter<*>>> = listOf(
+// String.format(string(R.string.kau_about_x), "KAU") to mainHeader
+// )
+
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+// mainHeader.add(MainItem {
+// title = string(R.string.app_name)
+// author = "Allan Wang"
+// version = BuildConfig.VERSION_NAME
+// })
+ }
+
+ override fun onPostCreate(savedInstanceState: Bundle?, persistentState: PersistableBundle?) {
+ super.onPostCreate(savedInstanceState, persistentState)
+ recycler.adapter.notifyDataSetChanged()
+ }
+} \ 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 3cd714e..d8e7e33 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -3,6 +3,7 @@ package ca.allanwang.kau.sample
import android.os.Bundle
import android.view.Menu
import android.view.MenuItem
+import ca.allanwang.kau.about.AboutActivityBase
import ca.allanwang.kau.email.sendEmail
import ca.allanwang.kau.kpref.CoreAttributeContract
import ca.allanwang.kau.kpref.KPrefActivity
@@ -146,7 +147,13 @@ class MainActivity : KPrefActivity() {
descRes = R.string.sub_item_desc
}
- plainText(R.string.kau_lorem_ipsum)
+ plainText(R.string.kau_lorem_ipsum) {
+ onClick = {
+ _, _, _ ->
+ startActivity(AboutActivity::class.java)
+ false
+ }
+ }
}
diff --git a/sample/src/main/res/xml/changelog.xml b/sample/src/main/res/xml/changelog.xml
index 003ee8b..b3dcdde 100644
--- a/sample/src/main/res/xml/changelog.xml
+++ b/sample/src/main/res/xml/changelog.xml
@@ -33,7 +33,7 @@
<item text="Attached source files" />
<item text="Created color dialog" />
<item text="Added more utilities" />
- <item text="Fixed stack clearing when starting activity" />
+ <item text="Fixed indexStack clearing when starting activity" />
<version title="v1.0" />
<item text="Initial Changelog" />