diff options
author | Allan Wang <me@allanwang.ca> | 2020-02-23 15:34:01 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2020-02-23 15:34:01 -0800 |
commit | 3e7f62f89bc4e95cfae7394463e3fd503777011f (patch) | |
tree | 0df25ed277c2084d22005bc48be17e05f88dd539 /about/src/main/kotlin/ca | |
parent | 3fa13a3a84d34fd0d96f26d6c5dea0e0671dd6c4 (diff) | |
download | kau-3e7f62f89bc4e95cfae7394463e3fd503777011f.tar.gz kau-3e7f62f89bc4e95cfae7394463e3fd503777011f.tar.bz2 kau-3e7f62f89bc4e95cfae7394463e3fd503777011f.zip |
Move config builder out of constructor
Diffstat (limited to 'about/src/main/kotlin/ca')
-rw-r--r-- | about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt | 11 |
1 files changed, 5 insertions, 6 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 6b57825..71f7d78 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -40,17 +40,14 @@ import kotlinx.android.synthetic.main.kau_activity_about.* * Created by Allan Wang on 2017-06-28. * * Floating About Activity Panel for your app - * This contains all the necessary layouts, and can be extended and configured using the [configBuilder] + * This contains all the necessary layouts, and can be extended and configured using [buildConfigs] * The [rClass] is necessary to generate the list of libraries used in your app, and should point to your app's * R.string::class.java * If you don't need auto detect, you can pass null instead * Note that for the auto detection to work, the R fields must be excluded from Proguard * Manual lib listings and other extra modifications can be done so by overriding the open functions */ -abstract class AboutActivityBase( - val rClass: Class<*>?, - private val configBuilder: Configs.() -> Unit = {} -) : +abstract class AboutActivityBase(val rClass: Class<*>?) : KauBaseActivity(), ViewPager.OnPageChangeListener { val currentPage: Int @@ -60,7 +57,9 @@ abstract class AboutActivityBase( * Holds some common configurations that may be added directly from the constructor * Applied lazily since it needs the context to fetch resources */ - val configs: Configs by lazy { Configs().apply { configBuilder() } } + val configs: Configs by lazy { Configs().apply{buildConfigs()} } + + open fun Configs.buildConfigs() = Unit /** * Holds that status of each page |