aboutsummaryrefslogtreecommitdiff
path: root/sample/src
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2019-09-22 21:47:12 -0700
committerAllan Wang <me@allanwang.ca>2019-09-22 21:47:12 -0700
commit53ee262302fadfb3c42e951145511ba2c588e227 (patch)
tree9ca12a913a42895b6cb5961003d2c88e28399f37 /sample/src
parent00ba1bcf7a756252baa808e62a0916fd18e95946 (diff)
parentbfba246d84aa6a22bc02837f9fcbd97780867d10 (diff)
downloadkau-53ee262302fadfb3c42e951145511ba2c588e227.tar.gz
kau-53ee262302fadfb3c42e951145511ba2c588e227.tar.bz2
kau-53ee262302fadfb3c42e951145511ba2c588e227.zip
Merge dev
Diffstat (limited to 'sample/src')
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt4
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt6
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt10
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt6
-rw-r--r--sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt4
-rw-r--r--sample/src/main/res/xml/kau_changelog.xml6
6 files changed, 21 insertions, 15 deletions
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt
index 928070e..ffe769a 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt
@@ -18,7 +18,7 @@ package ca.allanwang.kau.sample
import ca.allanwang.kau.about.AboutActivityBase
import ca.allanwang.kau.adapters.FastItemThemedAdapter
import ca.allanwang.kau.iitems.CardIItem
-import com.mikepenz.fastadapter.IItem
+import com.mikepenz.fastadapter.GenericItem
/**
* Created by Allan Wang on 2017-06-27.
@@ -33,7 +33,7 @@ class AboutActivity : AboutActivityBase(R.string::class.java, {
faqParseNewLine = false
}) {
- override fun postInflateMainPage(adapter: FastItemThemedAdapter<IItem<*, *>>) {
+ override fun postInflateMainPage(adapter: FastItemThemedAdapter<GenericItem>) {
adapter.add(CardIItem {
title = "About KAU"
descRes = R.string.about_kau
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt
index a11a672..b166210 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt
@@ -20,9 +20,9 @@ import ca.allanwang.kau.adapters.fastAdapter
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.GenericItem
import com.mikepenz.fastadapter.adapters.ItemAdapter
-import com.mikepenz.google_material_typeface_library.GoogleMaterial
+import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
/**
* Created by Allan Wang on 2017-07-17.
@@ -30,7 +30,7 @@ import com.mikepenz.google_material_typeface_library.GoogleMaterial
class AdapterActivity : ElasticRecyclerActivity() {
override fun onCreate(savedInstanceState: Bundle?, configs: Configs): Boolean {
- val adapter = ItemAdapter<IItem<*, *>>()
+ val adapter = ItemAdapter<GenericItem>()
recycler.adapter = fastAdapter(adapter)
adapter.add(
listOf(
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 349e3d1..a5ef8c3 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt
@@ -30,7 +30,7 @@ import ca.allanwang.kau.utils.startActivity
import ca.allanwang.kau.utils.toast
import ca.allanwang.kau.utils.withAlpha
import ca.allanwang.kau.utils.withSlideOut
-import com.mikepenz.fastadapter.commons.adapters.FastItemAdapter
+import com.mikepenz.fastadapter.adapters.FastItemAdapter
/**
* Created by Allan Wang on 2017-06-12.
@@ -43,14 +43,18 @@ class AnimActivity : KauBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val adapter = FastItemAdapter<PermissionCheckbox>()
- setContentView(fullLinearRecycler(adapter).apply { setBackgroundColor(KPrefSample.bgColor.withAlpha(255)) })
+ setContentView(fullLinearRecycler(adapter).apply {
+ setBackgroundColor(
+ KPrefSample.bgColor.withAlpha(255)
+ )
+ })
adapter.add(listOf(
PERMISSION_ACCESS_COARSE_LOCATION,
PERMISSION_ACCESS_FINE_LOCATION,
PERMISSION_CAMERA
).map { PermissionCheckbox(it) })
- adapter.withOnClickListener { _, _, item, _ ->
+ adapter.onClickListener = { _, _, item, _ ->
KL.d { "Perm Click" }
kauRequestPermissions(item.permission) { granted, _ ->
toast("${item.permission} enabled: $granted")
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 9ce3f42..4fe941b 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt
@@ -39,7 +39,7 @@ import ca.allanwang.kau.utils.toast
import ca.allanwang.kau.utils.withSceneTransitionAnimation
import ca.allanwang.kau.xml.showChangelog
import com.afollestad.materialdialogs.input.input
-import com.mikepenz.google_material_typeface_library.GoogleMaterial
+import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial
class MainActivity : KPrefActivity() {
@@ -47,7 +47,7 @@ class MainActivity : KPrefActivity() {
companion object {
- //some of the most common english words for show
+ // some of the most common english words for show
val wordBank: List<String> by lazy {
listOf(
"the", "name", "of", "very", "to", "through",
@@ -106,7 +106,7 @@ class MainActivity : KPrefActivity() {
accentColor = KPrefSample::accentColor
}
- override fun onCreateKPrefs(savedInstanceState: android.os.Bundle?): KPrefAdapterBuilder.() -> Unit = {
+ override fun onCreateKPrefs(savedInstanceState: Bundle?): KPrefAdapterBuilder.() -> Unit = {
header(R.string.header)
diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt
index 025179d..68dde2a 100644
--- a/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt
+++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt
@@ -25,7 +25,7 @@ import ca.allanwang.kau.utils.hasPermission
/**
* Created by Allan Wang on 2017-07-03.
*/
-class PermissionCheckbox(val permission: String) : KauIItem<PermissionCheckbox, PermissionCheckbox.ViewHolder>(
+class PermissionCheckbox(val permission: String) : KauIItem<PermissionCheckbox.ViewHolder>(
R.layout.permission_checkbox, { ViewHolder(it) }) {
override fun bindView(holder: ViewHolder, payloads: MutableList<Any>) {
@@ -33,7 +33,7 @@ class PermissionCheckbox(val permission: String) : KauIItem<PermissionCheckbox,
holder.text.text = permission
holder.checkbox.isChecked = holder.itemView.context.hasPermission(permission)
holder.checkbox.isClickable = false
- holder.checkbox.jumpDrawablesToCurrentState() //Cancel the animation
+ holder.checkbox.jumpDrawablesToCurrentState() // Cancel the animation
}
class ViewHolder(v: View) : RecyclerView.ViewHolder(v) {
diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml
index f91355b..7baecd8 100644
--- a/sample/src/main/res/xml/kau_changelog.xml
+++ b/sample/src/main/res/xml/kau_changelog.xml
@@ -6,6 +6,10 @@
<item text="" />
-->
+ <version title="v5.2.0" />
+ <item text=":fastadapter: Migrate fastadapter to v4.x.x" />
+ <item text="" />
+
<version title="v5.1.0" />
<item text=":adapter: Moved fastadapter elements to new module, :fastadapter:. To migrate, simply rename the dependency. If you don't use fast adapter, no changes are necessary" />
<item text=":adapter: Make NoAnimatorChange an object; previously a class" />
@@ -23,13 +27,11 @@
<item text=":core: Remove cursor tinting in EditText as it used reflection" />
<item text=":colorpicker: Strip down to just the interface; unless you require the accent palette, it may be fine to just use MD's color extension" />
<item text=":gradle-plugin: Convert to kotlin, rework dependencies, and remove extension hooks" />
- <item text="" />
<version title="v4.1.0" />
<item text=":core: Deprecate NetworkUtils, as the underlying functions are deprecated" />
<item text=":core: Permission manager no longer synchronized, as all actions should occur in the main thread" />
<item text=":kpref-activity: Getter and setter now have action context, with the option to reload self" />
- <item text="" />
<version title="v4.0.0" />
<item text="Update translations" />