diff options
author | Allan Wang <me@allanwang.ca> | 2021-01-11 00:19:31 -0800 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2021-01-11 00:19:31 -0800 |
commit | 5f5389b0fde9d12c56e337dff169fa6319b449cf (patch) | |
tree | 8f5ec6bc4c5470b6c6fc3c4b2d732bec5d0d3016 /about/src/main | |
parent | 038ad9c3aa4d6678d9ede06cf1ce68b8bdf85021 (diff) | |
download | kau-5f5389b0fde9d12c56e337dff169fa6319b449cf.tar.gz kau-5f5389b0fde9d12c56e337dff169fa6319b449cf.tar.bz2 kau-5f5389b0fde9d12c56e337dff169fa6319b449cf.zip |
Remove kotlin synethetics
Diffstat (limited to 'about/src/main')
-rw-r--r-- | about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt | 27 |
1 files changed, 17 insertions, 10 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 4fe97da..286d95e 100644 --- a/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt +++ b/about/src/main/kotlin/ca/allanwang/kau/about/AboutActivityBase.kt @@ -23,6 +23,7 @@ import android.view.View import android.view.ViewGroup import androidx.viewpager.widget.PagerAdapter import androidx.viewpager.widget.ViewPager +import ca.allanwang.kau.about.databinding.KauActivityAboutBinding import ca.allanwang.kau.adapters.FastItemThemedAdapter import ca.allanwang.kau.adapters.ThemableIItemColors import ca.allanwang.kau.adapters.ThemableIItemColorsDelegate @@ -34,7 +35,6 @@ import ca.allanwang.kau.utils.dimenPixelSize import com.mikepenz.aboutlibraries.Libs import com.mikepenz.aboutlibraries.entity.Library import com.mikepenz.fastadapter.GenericItem -import kotlinx.android.synthetic.main.kau_activity_about.* /** * Created by Allan Wang on 2017-06-28. @@ -51,7 +51,7 @@ abstract class AboutActivityBase(val rClass: Class<*>?) : KauBaseActivity(), ViewPager.OnPageChangeListener { val currentPage: Int - get() = about_pager.currentItem + get() = binding.aboutPager.currentItem /** * Holds some common configurations that may be added directly from the constructor @@ -77,31 +77,38 @@ abstract class AboutActivityBase(val rClass: Class<*>?) : defaultPanels } + private lateinit var binding: KauActivityAboutBinding + override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) - setContentView(R.layout.kau_activity_about) + binding = KauActivityAboutBinding.inflate(layoutInflater) + setContentView(binding.root) + binding.init() + } + + private fun KauActivityAboutBinding.init() { pageStatus = IntArray(panels.size) pageStatus[0] = 2 // the first page is instantly visible if (configs.textColor != null) { - about_indicator.setColour(configs.textColor!!) + aboutIndicator.setColour(configs.textColor!!) } - with(about_pager) { + with(aboutPager) { adapter = AboutPagerAdapter() pageMargin = dimenPixelSize(R.dimen.kau_spacing_normal) offscreenPageLimit = panels.size - 1 addOnPageChangeListener(this@AboutActivityBase) } - about_indicator.setViewPager(about_pager) - about_draggable_frame.addListener(object : - ElasticDragDismissFrameLayout.SystemChromeFader(this) { + aboutIndicator.setViewPager(aboutPager) + aboutDraggableFrame.addListener(object : + ElasticDragDismissFrameLayout.SystemChromeFader(this@AboutActivityBase) { override fun onDragDismissed() { window.returnTransition = TransitionInflater.from(this@AboutActivityBase) - .inflateTransition(if (about_draggable_frame.translationY > 0) R.transition.kau_exit_slide_bottom else R.transition.kau_exit_slide_top) + .inflateTransition(if (aboutDraggableFrame.translationY > 0) R.transition.kau_exit_slide_bottom else R.transition.kau_exit_slide_top) panels[currentPage].recycler?.stopScroll() finishAfterTransition() } }) - panels.forEachIndexed { index, contract -> contract.loadItems(this, index) } + panels.forEachIndexed { index, contract -> contract.loadItems(this@AboutActivityBase, index) } } class Configs : ThemableIItemColors by ThemableIItemColorsDelegate() { |