aboutsummaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
Diffstat (limited to 'sample')
-rw-r--r--sample/src/main/AndroidManifest.xml3
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt51
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt18
-rw-r--r--sample/src/main/res/values/strings.xml2
-rw-r--r--sample/src/main/res/xml/kau_changelog.xml (renamed from sample/src/main/res/xml/changelog.xml)19
5 files changed, 80 insertions, 13 deletions
diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml
index 66b73c3..ab5b6d8 100644
--- a/sample/src/main/AndroidManifest.xml
+++ b/sample/src/main/AndroidManifest.xml
@@ -31,6 +31,9 @@
<activity
android:name=".ImageActivity"
android:theme="@style/Kau.Translucent.ImagePicker" />
+ <activity
+ android:name=".AdapterActivity"
+ android:theme="@style/Kau.Translucent.SlideBottom" />
</application>
</manifest> \ No newline at end of file
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt
new file mode 100644
index 0000000..874e73b
--- /dev/null
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt
@@ -0,0 +1,51 @@
+package ca.allanwang.kau.sample
+
+import android.os.Bundle
+import ca.allanwang.kau.iitems.CardIItem
+import ca.allanwang.kau.ui.activities.ElasticRecyclerActivity
+import ca.allanwang.kau.utils.toast
+import com.mikepenz.fastadapter.IItem
+import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
+import com.mikepenz.google_material_typeface_library.GoogleMaterial
+
+/**
+ * Created by Allan Wang on 2017-07-17.
+ */
+class AdapterActivity : ElasticRecyclerActivity() {
+
+ val adapter = FastItemAdapter<IItem<*, *>>()
+
+ override fun onCreate(savedInstanceState: Bundle?, configs: Configs): Boolean {
+ recycler.adapter = adapter
+ adapter.add(listOf(
+ CardIItem {
+ titleRes = R.string.kau_text_copied
+ descRes = R.string.kau_lorem_ipsum
+ imageIIcon = GoogleMaterial.Icon.gmd_file_download
+ },
+ CardIItem {
+ titleRes = R.string.kau_text_copied
+ descRes = R.string.kau_lorem_ipsum
+ },
+ CardIItem {
+ titleRes = R.string.kau_text_copied
+ imageIIcon = GoogleMaterial.Icon.gmd_file_download
+ cardClick = { toast("Card click") }
+ },
+ CardIItem {
+ titleRes = R.string.kau_text_copied
+ descRes = R.string.kau_lorem_ipsum
+ imageIIcon = GoogleMaterial.Icon.gmd_file_download
+ button = "Test"
+ buttonClick = { toast("T") }
+ },
+ CardIItem {
+ titleRes = R.string.kau_text_copied
+ button = "Test"
+ buttonClick = { toast("HI") }
+ }
+ ))
+ setOutsideTapListener { finishAfterTransition() }
+ return true
+ }
+} \ 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 9a874cb..53ec745 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -154,12 +154,16 @@ class MainActivity : KPrefActivity() {
descRes = R.string.sub_item_desc
}
- plainText(R.string.kau_lorem_ipsum) {
- onClick = {
- _, _, _ ->
- startActivity(AboutActivity::class.java, transition = true)
- false
- }
+ plainText(R.string.gallery_showcase) {
+ onClick = { _, _, _ -> startActivity(ImageActivity::class.java, transition = true); false }
+ }
+
+ plainText(R.string.adapter_showcase) {
+ onClick = { _, _, _ -> startActivity(AdapterActivity::class.java, transition = true); false }
+ }
+
+ plainText(R.string.kau_about_app) {
+ onClick = { _, _, _ -> startActivity(AboutActivity::class.java, transition = true); false }
}
}
@@ -215,7 +219,7 @@ class MainActivity : KPrefActivity() {
noResultsFound = R.string.kau_no_results_found
shouldClearOnClose = false
onItemClick = {
- position, key, content, searchView ->
+ _, _, content, searchView ->
toast(content)
searchView.revealClose()
}
diff --git a/sample/src/main/res/values/strings.xml b/sample/src/main/res/values/strings.xml
index 0be46ec..f3880b2 100644
--- a/sample/src/main/res/values/strings.xml
+++ b/sample/src/main/res/values/strings.xml
@@ -20,5 +20,7 @@
<string name="sub_item_desc">Press this to view the next subset of preferences</string>
<string name="your_email">your.email@here.com</string>
<string name="your_subject">Your subject</string>
+ <string name="gallery_showcase">Gallery Showcase</string>
+ <string name="adapter_showcase">Adapter Showcase</string>
<string name="about_kau">KAU (Kotlin Android Utils) is a collection of common extension functions and complex UIs that can be used in almost all apps. It is meant to implement the shared components, so you can focus on what makes your app unique.</string>
</resources>
diff --git a/sample/src/main/res/xml/changelog.xml b/sample/src/main/res/xml/kau_changelog.xml
index d9bebfc..1599f08 100644
--- a/sample/src/main/res/xml/changelog.xml
+++ b/sample/src/main/res/xml/kau_changelog.xml
@@ -7,12 +7,19 @@
-->
<version title="v2.1"/>
- <item text="" />
- <item text="" />
- <item text="" />
- <item text="" />
- <item text="" />
- <item text="" />
+ <item text=":adapter: Fix up CardIItem" />
+ <item text=":adapter: Modularized kau animators" />
+ <item text=":adapter: Switched from mutablelist to list inputs for themed animator" />
+ <item text=":core-ui: Create ElasticRecyclerActivity" />
+ <item text=":core-ui: Create MeasuredImageView" />
+ <item text=":core: Create MeasureSpecDelegate" />
+ <item text=":core: Improve PermissionManager logging" />
+ <item text=":core: Inline all util variables with getters" />
+ <item text=":core: Introduce fade animation style templates" />
+ <item text=":core: Introduce slide transition style templates" />
+ <item text=":core: Update utils and remove StringHolder" />
+ <item text=":imagepicker: Create full image picker with blurrable selections" />
+ <item text="Update dependencies" />
<version title="v2.0"/>
<item text="Huge refactoring to separate functions to their own submodules" />