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 /about | |
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 'about')
6 files changed, 38 insertions, 28 deletions
diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt index 286d95e..59c3eb2 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -101,13 +101,13 @@ abstract class AboutActivityBase(val rClass: Class<*>?) : aboutIndicator.setViewPager(aboutPager) aboutDraggableFrame.addListener(object : ElasticDragDismissFrameLayout.SystemChromeFader(this@AboutActivityBase) { - override fun onDragDismissed() { - window.returnTransition = TransitionInflater.from(this@AboutActivityBase) + override fun onDragDismissed() { + window.returnTransition = TransitionInflater.from(this@AboutActivityBase) .inflateTransition(if (aboutDraggableFrame.translationY > 0) R.transition.kau_exit_slide_bottom else R.transition.kau_exit_slide_top) - panels[currentPage].recycler?.stopScroll() - finishAfterTransition() - } - }) + panels[currentPage].recycler?.stopScroll() + finishAfterTransition() + } + }) panels.forEachIndexed { index, contract -> contract.loadItems(this@AboutActivityBase, index) } } diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutBinder.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutBinder.kt index 1183113..89715e2 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutBinder.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutBinder.kt @@ -27,6 +27,8 @@ import ca.allanwang.kau.utils.withSceneTransitionAnimation * About activity launcher */ inline fun <reified T : AboutActivityBase> Context.kauLaunchAbout() = - startActivity<T>(bundleBuilder = { - withSceneTransitionAnimation(this@kauLaunchAbout) - }) + startActivity<T>( + bundleBuilder = { + withSceneTransitionAnimation(this@kauLaunchAbout) + } + ) diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt index 1d9b2b0..ad8a7f4 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutPanelDelegate.kt @@ -35,10 +35,10 @@ import ca.allanwang.kau.utils.withMarginDecoration import ca.allanwang.kau.xml.kauParseFaq import com.mikepenz.aboutlibraries.Libs import com.mikepenz.fastadapter.GenericItem -import java.lang.reflect.Field import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch import kotlinx.coroutines.withContext +import java.lang.reflect.Field /** * Created by Allan Wang on 2017-08-02. @@ -154,16 +154,18 @@ open class AboutPanelMain : AboutPanelRecycler() { with(activity) { adapter = FastItemThemedAdapter(configs) recycler = fullLinearRecycler(adapter) - adapter.add(CutoutIItem { - with(configs) { - text = string(cutoutTextRes, cutoutText) - drawable = drawable(cutoutDrawableRes, cutoutDrawable) - if (configs.cutoutForeground != null) foregroundColor = - configs.cutoutForeground!! + adapter.add( + CutoutIItem { + with(configs) { + text = string(cutoutTextRes, cutoutText) + drawable = drawable(cutoutDrawableRes, cutoutDrawable) + if (configs.cutoutForeground != null) foregroundColor = + configs.cutoutForeground!! + } + }.apply { + themeEnabled = configs.cutoutForeground == null } - }.apply { - themeEnabled = configs.cutoutForeground == null - }) + ) postInflateMainPage(adapter) return recycler!! } diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt index 2a1588c..addbe5f 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/CutoutIItem.kt @@ -27,9 +27,11 @@ import ca.allanwang.kau.ui.views.CutoutView * * Just a cutout item with some defaults in [R.layout.kau_iitem_cutout] */ -class CutoutIItem(val config: CutoutView.() -> Unit = {}) : KauIItem<CutoutIItem.ViewHolder>( - R.layout.kau_iitem_cutout, ::ViewHolder, R.id.kau_item_cutout -), ThemableIItem by ThemableIItemDelegate() { +class CutoutIItem(val config: CutoutView.() -> Unit = {}) : + KauIItem<CutoutIItem.ViewHolder>( + R.layout.kau_iitem_cutout, ::ViewHolder, R.id.kau_item_cutout + ), + ThemableIItem by ThemableIItemDelegate() { override var isSelectable: Boolean get() = false diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt index ddb9a18..4495cc1 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/FaqIItem.kt @@ -37,9 +37,11 @@ import com.mikepenz.fastadapter.select.getSelectExtension /** * Created by Allan Wang on 2017-08-02. */ -class FaqIItem(val content: FaqItem) : KauIItem<FaqIItem.ViewHolder>( - R.layout.kau_iitem_faq, ::ViewHolder, R.id.kau_item_faq -), ThemableIItem by ThemableIItemDelegate() { +class FaqIItem(val content: FaqItem) : + KauIItem<FaqIItem.ViewHolder>( + R.layout.kau_iitem_faq, ::ViewHolder, R.id.kau_item_faq + ), + ThemableIItem by ThemableIItemDelegate() { companion object { fun bindEvents(fastAdapter: FastAdapter<GenericItem>) { diff --git a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt index c64fe4e..1c9a8b3 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/LibraryIItem.kt @@ -35,9 +35,11 @@ import com.mikepenz.fastadapter.select.getSelectExtension /** * Created by Allan Wang on 2017-06-27. */ -class LibraryIItem(val lib: Library) : KauIItem<LibraryIItem.ViewHolder>( - R.layout.kau_iitem_library, ::ViewHolder, R.id.kau_item_library -), ThemableIItem by ThemableIItemDelegate() { +class LibraryIItem(val lib: Library) : + KauIItem<LibraryIItem.ViewHolder>( + R.layout.kau_iitem_library, ::ViewHolder, R.id.kau_item_library + ), + ThemableIItem by ThemableIItemDelegate() { companion object { fun bindEvents(fastAdapter: FastAdapter<GenericItem>) { |