From a4177af60ad70af5f3883ef31b26c6c31bcaa866 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 19 Jan 2020 21:21:29 -0800 Subject: Remove synthetics for intro fragment theme --- app/build.gradle | 1 + .../pitchedapps/frost/intro/IntroFragmentTheme.kt | 33 ++++++++++++++-------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 88432866..7c65ea33 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -183,6 +183,7 @@ android { androidExtensions { experimental = true +// features = ["parcelize"] } } diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt index 64d675e1..4561fa6e 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroFragmentTheme.kt @@ -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) { + private lateinit var binding: IntroThemeBinding + val themeList - get() = listOf(intro_theme_light, intro_theme_dark, intro_theme_amoled, intro_theme_glass) + get() = with(binding) { + listOf(introThemeLight, introThemeDark, introThemeAmoled, introThemeGlass) + } - override fun viewArray(): Array> = arrayOf( - arrayOf(title), - arrayOf(intro_theme_light, intro_theme_dark), - arrayOf(intro_theme_amoled, intro_theme_glass) - ) + override fun viewArray(): Array> = 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 -> -- cgit v1.2.3 From 309e1ec5f16120af678377324be36ab013617a4e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 19 Jan 2020 21:24:05 -0800 Subject: Remove synthetics for IntroMainFragments --- .../pitchedapps/frost/intro/IntroMainFragments.kt | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt index 5ae29809..c86e560c 100644 --- a/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt +++ b/app/src/main/kotlin/com/pitchedapps/frost/intro/IntroMainFragments.kt @@ -35,9 +35,9 @@ import ca.allanwang.kau.utils.setOnSingleTapListener import com.mikepenz.iconics.typeface.library.googlematerial.GoogleMaterial import com.pitchedapps.frost.R import com.pitchedapps.frost.activities.IntroActivity +import com.pitchedapps.frost.databinding.IntroAnalyticsBinding import com.pitchedapps.frost.utils.Prefs import kotlin.math.abs -import kotlinx.android.synthetic.main.intro_analytics.* /** * Created by Allan Wang on 2017-07-28. @@ -142,10 +142,14 @@ class IntroFragmentAnalytics : BaseIntroFragment(R.layout.intro_analytics) { val container: ConstraintLayout by bindViewResettable(R.id.intro_analytics_container) - override fun viewArray(): Array> = arrayOf( - arrayOf(title), arrayOf(image), - arrayOf(intro_switch), arrayOf(desc) - ) + private lateinit var binding: IntroAnalyticsBinding + + override fun viewArray(): Array> = with(binding) { + arrayOf( + arrayOf(title), arrayOf(image), + arrayOf(introSwitch), arrayOf(desc) + ) + } override fun themeFragmentImpl() { super.themeFragmentImpl() @@ -155,9 +159,14 @@ class IntroFragmentAnalytics : BaseIntroFragment(R.layout.intro_analytics) { @SuppressLint("ClickableViewAccessibility") override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) + binding = IntroAnalyticsBinding.bind(view) + binding.init() + } + + private fun IntroAnalyticsBinding.init() { image.setIcon(GoogleMaterial.Icon.gmd_bug_report, 120) - intro_switch.isSelected = Prefs.analytics - intro_switch.setOnCheckedChangeListener { _, isChecked -> + introSwitch.isSelected = Prefs.analytics + introSwitch.setOnCheckedChangeListener { _, isChecked -> Prefs.analytics = isChecked } } -- cgit v1.2.3 From 68d0efbc9ecb4b04eb7680314a479ec340aaab31 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 19 Jan 2020 21:26:02 -0800 Subject: Disable synthetics feature --- app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/build.gradle b/app/build.gradle index 7c65ea33..60fe385e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -183,7 +183,7 @@ android { androidExtensions { experimental = true -// features = ["parcelize"] + features = ["parcelize"] } } -- cgit v1.2.3 From dfa215e7ed32766e24ada5c3a2eebe2c4ffefeb2 Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Sun, 19 Jan 2020 21:31:13 -0800 Subject: Apply spotless and update changelog --- app/src/main/play/en-US/whatsnew | 11 ++--------- app/src/main/res/xml/frost_changelog.xml | 8 +++++++- docs/Changelog.md | 3 +++ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/src/main/play/en-US/whatsnew b/app/src/main/play/en-US/whatsnew index 747dbf83..47b06212 100644 --- a/app/src/main/play/en-US/whatsnew +++ b/app/src/main/play/en-US/whatsnew @@ -1,10 +1,3 @@ -v2.4.2 +v2.4.3 -* Fix townhall loading -* Fix search suggestions -* Redesign navigation layout -* Update theme -* Open formatted urls from context menu -* Allow copying text with emojis -* Theme webview js dialogs -* Fix create post FAB \ No newline at end of file +* Fix Android theme \ No newline at end of file diff --git a/app/src/main/res/xml/frost_changelog.xml b/app/src/main/res/xml/frost_changelog.xml index c1360b73..eb968743 100644 --- a/app/src/main/res/xml/frost_changelog.xml +++ b/app/src/main/res/xml/frost_changelog.xml @@ -6,6 +6,13 @@ --> + + + + + + + @@ -15,7 +22,6 @@ - diff --git a/docs/Changelog.md b/docs/Changelog.md index 338f369e..7ab5b3e2 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -1,5 +1,8 @@ # Changelog +## v2.4.3 +* Fix Android theme + ## v2.4.2 * Fix townhall loading * Fix search suggestions -- cgit v1.2.3