1
0
mirror of https://github.com/AllanWang/Frost-for-Facebook.git synced 2024-11-09 20:42:34 +01:00

Remove synthetics for intro fragment theme

This commit is contained in:
Allan Wang 2020-01-19 21:21:29 -08:00
parent 172f8209a1
commit a4177af60a
No known key found for this signature in database
GPG Key ID: C93E3F9C679D7A56
2 changed files with 24 additions and 12 deletions

View File

@ -183,6 +183,7 @@ android {
androidExtensions {
experimental = true
// features = ["parcelize"]
}
}

View File

@ -21,30 +21,41 @@ import android.view.View
import ca.allanwang.kau.utils.scaleXY
import com.pitchedapps.frost.R
import com.pitchedapps.frost.activities.IntroActivity
import com.pitchedapps.frost.databinding.IntroThemeBinding
import com.pitchedapps.frost.enums.Theme
import com.pitchedapps.frost.utils.Prefs
import kotlinx.android.synthetic.main.intro_theme.*
/**
* Created by Allan Wang on 2017-07-28.
*/
class IntroFragmentTheme : BaseIntroFragment(R.layout.intro_theme) {
val themeList
get() = listOf(intro_theme_light, intro_theme_dark, intro_theme_amoled, intro_theme_glass)
private lateinit var binding: IntroThemeBinding
override fun viewArray(): Array<Array<out View>> = arrayOf(
arrayOf(title),
arrayOf(intro_theme_light, intro_theme_dark),
arrayOf(intro_theme_amoled, intro_theme_glass)
)
val themeList
get() = with(binding) {
listOf(introThemeLight, introThemeDark, introThemeAmoled, introThemeGlass)
}
override fun viewArray(): Array<Array<out View>> = with(binding) {
arrayOf(
arrayOf(title),
arrayOf(introThemeLight, introThemeDark),
arrayOf(introThemeAmoled, introThemeGlass)
)
}
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
intro_theme_light.setThemeClick(Theme.LIGHT)
intro_theme_dark.setThemeClick(Theme.DARK)
intro_theme_amoled.setThemeClick(Theme.AMOLED)
intro_theme_glass.setThemeClick(Theme.GLASS)
binding = IntroThemeBinding.bind(view)
binding.init()
}
private fun IntroThemeBinding.init() {
introThemeLight.setThemeClick(Theme.LIGHT)
introThemeDark.setThemeClick(Theme.DARK)
introThemeAmoled.setThemeClick(Theme.AMOLED)
introThemeGlass.setThemeClick(Theme.GLASS)
val currentTheme = Prefs.theme - 1
if (currentTheme in 0..3)
themeList.forEachIndexed { index, v ->