diff options
author | Allan Wang <me@allanwang.ca> | 2017-06-29 16:27:09 -0700 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-06-29 16:27:09 -0700 |
commit | 22edec658f1ca9ad8f87cf3345eb883b18848b35 (patch) | |
tree | 04068f32e64e9cc410fed1d314d91e8c2ba540ac | |
parent | d00d7203c391c7954a4cd16a5f1d1f81ba873eb1 (diff) | |
download | kau-22edec658f1ca9ad8f87cf3345eb883b18848b35.tar.gz kau-22edec658f1ca9ad8f87cf3345eb883b18848b35.tar.bz2 kau-22edec658f1ca9ad8f87cf3345eb883b18848b35.zip |
More comments
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | library/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt | 13 |
2 files changed, 11 insertions, 4 deletions
@@ -215,7 +215,7 @@ About Activity aims to fix that by preparing a beautiful overlay activity that d <img src="https://github.com/AllanWang/Storage-Hub/blob/master/kau/kau_about_activity.gif"> The overlay is heavily based off of the about section in [Plaid](https://github.com/nickbutcher/plaid), -and adds on the power of [About Libraries](https://github.com/mikepenz/AboutLibraries) to automatically find the dependencies +and adds on the power of [About Libraries](https://github.com/mikepenz/AboutLibraries) to automatically find the dependencies. This activity can be easily added by extending `AboutActivityBase`. Everything is already prepared, but you can modify the theme or other components through the config DSL or through the open functions. diff --git a/library/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt b/library/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt index d27f32f..1b80a46 100644 --- a/library/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/library/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -15,7 +15,6 @@ import ca.allanwang.kau.adapters.FastItemThemedAdapter import ca.allanwang.kau.adapters.ThemableIItemColors import ca.allanwang.kau.adapters.ThemableIItemColorsDelegate import ca.allanwang.kau.animators.FadeScaleAnimator -import ca.allanwang.kau.iitems.CardIItem import ca.allanwang.kau.iitems.CutoutIItem import ca.allanwang.kau.iitems.HeaderIItem import ca.allanwang.kau.iitems.LibraryIItem @@ -107,7 +106,7 @@ abstract class AboutActivityBase(val rClass: Class<*>, val configBuilder: Config var cutoutDrawable: Drawable? = null var cutoutForeground: Int? = null var libPageTitleRes: Int = -1 - var libPageTitle: String? = string(R.string.kau_about_libraries_intro) + var libPageTitle: String? = string(R.string.kau_about_libraries_intro) //This is in the string by default since it's lower priority /** * Transition to be called if the view is dragged down */ @@ -152,6 +151,10 @@ abstract class AboutActivityBase(val rClass: Class<*>, val configBuilder: Config return recycler } + /** + * Open hook called just before the main page view is returned + * Feel free to add your own items to the adapter in here + */ open fun postInflateMainPage(adapter: FastItemThemedAdapter<IItem<*, *>>) { } @@ -216,7 +219,11 @@ abstract class AboutActivityBase(val rClass: Class<*>, val configBuilder: Config } } - internal fun addLibItems() { + /** + * Function that is called when the view is ready to add the lib items + * Feel free to add your own items here + */ + open fun addLibItems() { libAdapter.add(HeaderIItem(text = configs.libPageTitle, textRes = configs.libPageTitleRes)) .add(libItems) } |