diff options
author | Allan Wang <me@allanwang.ca> | 2021-11-18 14:45:22 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-18 14:45:22 -0800 |
commit | 4c06d0ae4a4b2c8450ec68dd9b64d472cdd0202d (patch) | |
tree | 859d3dc7021d31f807c5ad90ddea31f711fa793d /sample/src/main | |
parent | e2ac8e3e82b842ea05c8c7a2c92d566553d8ea91 (diff) | |
parent | a9b8b69ab5e053e9106a98564e3a4047628387d6 (diff) | |
download | kau-4c06d0ae4a4b2c8450ec68dd9b64d472cdd0202d.tar.gz kau-4c06d0ae4a4b2c8450ec68dd9b64d472cdd0202d.tar.bz2 kau-4c06d0ae4a4b2c8450ec68dd9b64d472cdd0202d.zip |
Merge pull request #270 from AllanWang/versions6.4.0
Diffstat (limited to 'sample/src/main')
8 files changed, 73 insertions, 42 deletions
diff --git a/sample/src/main/AndroidManifest.xml b/sample/src/main/AndroidManifest.xml index b205c51..aa94481 100644 --- a/sample/src/main/AndroidManifest.xml +++ b/sample/src/main/AndroidManifest.xml @@ -16,7 +16,7 @@ android:theme="@style/AppTheme"> <activity android:name=".MainActivity" - android:label="@string/app_name" + android:exported="true" android:theme="@style/AppTheme.NoActionBar.Transparent"> <intent-filter> <action android:name="android.intent.action.MAIN" /> @@ -59,7 +59,7 @@ </provider> <meta-data android:name="com.bugsnag.android.API_KEY" - android:value="0a09e498a253b98237500fb5f948e5c6"/> + android:value="0a09e498a253b98237500fb5f948e5c6" /> </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 index 59f1c92..cb907c6 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AboutActivity.kt @@ -36,9 +36,11 @@ class AboutActivity : AboutActivityBase(R.string::class.java) { } override fun postInflateMainPage(adapter: FastItemThemedAdapter<GenericItem>) { - adapter.add(CardIItem { - title = "About KAU" - descRes = R.string.about_kau - }) + 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 b166210..cb38f29 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AdapterActivity.kt @@ -59,7 +59,8 @@ class AdapterActivity : ElasticRecyclerActivity() { titleRes = R.string.kau_text_copied button = "Test" buttonClick = { toast("HI") } - }) + } + ) ) setOutsideTapListener { finishAfterTransition() } return true 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 b3560c5..30fcc45 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/AnimActivity.kt @@ -46,17 +46,21 @@ class AnimActivity : KauBaseActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) val adapter = SingleFastAdapter() - setContentView(fullLinearRecycler(adapter).apply { - setBackgroundColor( - pref.bgColor.withAlpha(255) - ) - }) + setContentView( + fullLinearRecycler(adapter).apply { + setBackgroundColor( + pref.bgColor.withAlpha(255) + ) + } + ) - adapter.add(listOf( - PERMISSION_ACCESS_COARSE_LOCATION, - PERMISSION_ACCESS_FINE_LOCATION, - PERMISSION_CAMERA - ).map { PermissionCheckboxModel(it).vh() }) + adapter.add( + listOf( + PERMISSION_ACCESS_COARSE_LOCATION, + PERMISSION_ACCESS_FINE_LOCATION, + PERMISSION_CAMERA + ).map { PermissionCheckboxModel(it).vh() } + ) adapter.addEventHook(PermissionCheckboxViewBinding.clickHook()) kauSwipeOnCreate { edgeFlag = SWIPE_EDGE_LEFT @@ -69,8 +73,10 @@ class AnimActivity : KauBaseActivity() { } override fun onBackPressed() { - startActivity<MainActivity>(bundleBuilder = { - withSlideOut(this@AnimActivity) - }) + startActivity<MainActivity>( + 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 e6841c8..b47bc48 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MainActivity.kt @@ -574,10 +574,12 @@ class MainActivity : KPrefActivity() { /** * This is how the setup looks like with all the proper tags */ - checkbox(title = R.string.checkbox_1, getter = pref::check1, setter = { pref.check1 = it }, + checkbox( + title = R.string.checkbox_1, getter = pref::check1, setter = { pref.check1 = it }, builder = { descRes = R.string.desc - }) + } + ) /** * Since we know the order, we may omit the tags @@ -585,7 +587,8 @@ class MainActivity : KPrefActivity() { checkbox( R.string.checkbox_2, pref::check2, - { pref.check2 = it; reloadByTitle(R.string.checkbox_3) }) + { pref.check2 = it; reloadByTitle(R.string.checkbox_3) } + ) /** * Since the builder is the last argument and is a lambda, we may write the setup cleanly like so: @@ -601,19 +604,25 @@ class MainActivity : KPrefActivity() { allowCustom = true } - colorPicker(R.string.accent_color, pref::accentColor, { - pref.accentColor = it - reload() - this@MainActivity.navigationBarColor = it - toolbarCanvas.ripple(it, RippleCanvas.MIDDLE, RippleCanvas.END, duration = 500L) - }) { + colorPicker( + R.string.accent_color, pref::accentColor, + { + pref.accentColor = it + reload() + this@MainActivity.navigationBarColor = it + toolbarCanvas.ripple(it, RippleCanvas.MIDDLE, RippleCanvas.END, duration = 500L) + } + ) { descRes = R.string.color_no_custom allowCustom = false } - colorPicker(R.string.background_color, pref::bgColor, { - pref.bgColor = it; bgCanvas.ripple(it, duration = 500L) - }) { + colorPicker( + R.string.background_color, pref::bgColor, + { + pref.bgColor = it; bgCanvas.ripple(it, duration = 500L) + } + ) { iicon = GoogleMaterial.Icon.gmd_colorize descRes = R.string.color_custom_alpha allowCustomAlpha = true @@ -663,9 +672,11 @@ class MainActivity : KPrefActivity() { plainText(R.string.adapter_showcase) { onClick = { - startActivity<AdapterActivity>(bundleBuilder = { - withSceneTransitionAnimation(this@MainActivity) - }) + startActivity<AdapterActivity>( + bundleBuilder = { + withSceneTransitionAnimation(this@MainActivity) + } + ) } } @@ -682,7 +693,8 @@ class MainActivity : KPrefActivity() { checkbox( R.string.checkbox_2, pref::check2, - { pref.check2 = it; reloadByTitle(R.string.checkbox_3) }) { + { pref.check2 = it; reloadByTitle(R.string.checkbox_3) } + ) { titleFun = { R.string.checkbox_3 } descRes = R.string.kau_lorem_ipsum } diff --git a/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt b/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt index 0e6b22f..ce45d85 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/MediaPicker.kt @@ -29,13 +29,16 @@ import java.io.File /** * Created by Allan Wang on 2017-07-23. */ -private fun actions(multiple: Boolean) = listOf(object : MediaActionCamera() { +private fun actions(multiple: Boolean) = listOf( + object : MediaActionCamera() { - override fun createFile(context: Context): File = createMediaFile("KAU", ".jpg") + override fun createFile(context: Context): File = createMediaFile("KAU", ".jpg") - override fun createUri(context: Context, file: File): Uri = - FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", file) -}, MediaActionGallery(multiple)) + override fun createUri(context: Context, file: File): Uri = + FileProvider.getUriForFile(context, BuildConfig.APPLICATION_ID + ".provider", file) + }, + MediaActionGallery(multiple) +) class ImagePickerActivity : MediaPickerActivityBase(MediaType.IMAGE, actions(true)) 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 7bd2851..a9a67b6 100644 --- a/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt +++ b/sample/src/main/kotlin/ca/allanwang/kau/sample/PermissionCheckbox.kt @@ -39,7 +39,8 @@ import com.mikepenz.fastadapter.listeners.EventHook * Created by Allan Wang on 2017-07-03. */ class PermissionCheckbox(val permission: String) : KauIItem<PermissionCheckbox.ViewHolder>( - R.layout.permission_checkbox, { ViewHolder(it) }) { + R.layout.permission_checkbox, { ViewHolder(it) } +) { override fun bindView(holder: ViewHolder, payloads: List<Any>) { super.bindView(holder, payloads) diff --git a/sample/src/main/res/xml/kau_changelog.xml b/sample/src/main/res/xml/kau_changelog.xml index 18b8f31..bea7091 100644 --- a/sample/src/main/res/xml/kau_changelog.xml +++ b/sample/src/main/res/xml/kau_changelog.xml @@ -6,6 +6,12 @@ <item text="" /> --> + <version title="v6.4.0" /> + <item text="Add support for Bumblebee 2021.1.1" /> + <item text="Remove Koin" /> + <item text="Many version bumps" /> + <item text="Update target SDK to 31" /> + <version title="v6.3.0" /> <item text="Add support for Arctic Fox 2020.3.1" /> <item text="Move to new maven release system" /> |