From 040e59ee58a590c2ada7e04d45e0ae65470a0c43 Mon Sep 17 00:00:00 2001 From: Michatec Date: Sun, 8 Mar 2026 13:03:31 +0100 Subject: [PATCH] - Updated the ScreenActivity.kt - Some settings updated - Fix some bugs --- build.gradle | 4 ++-- settings.gradle | 3 +++ .../kotlin/com/michatec/store/screen/ScreenActivity.kt | 2 +- src/main/kotlin/com/michatec/store/screen/TabsFragment.kt | 8 +++++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 0af0f61..f7b2ef7 100644 --- a/build.gradle +++ b/build.gradle @@ -5,8 +5,8 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:9.0.1' - classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.10' + classpath 'com.android.tools.build:gradle:9.1.0' + classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.10' } } diff --git a/settings.gradle b/settings.gradle index 9d8d6b8..c6d07c5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,5 @@ +plugins { + id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0' +} rootProject.name = "michas-droid" include ':' diff --git a/src/main/kotlin/com/michatec/store/screen/ScreenActivity.kt b/src/main/kotlin/com/michatec/store/screen/ScreenActivity.kt index a4b9f9d..573c515 100644 --- a/src/main/kotlin/com/michatec/store/screen/ScreenActivity.kt +++ b/src/main/kotlin/com/michatec/store/screen/ScreenActivity.kt @@ -125,7 +125,7 @@ abstract class ScreenActivity: FragmentActivity() { private fun replaceFragment(fragment: Fragment, open: Boolean?) { if (open != null) { - currentFragment?.view?.translationZ = (if (open) Int.MIN_VALUE else Int.MAX_VALUE).toFloat() + currentFragment?.view?.translationZ = (if (open) -1f else 1f) } supportFragmentManager .beginTransaction() diff --git a/src/main/kotlin/com/michatec/store/screen/TabsFragment.kt b/src/main/kotlin/com/michatec/store/screen/TabsFragment.kt index 6256b20..85782fe 100644 --- a/src/main/kotlin/com/michatec/store/screen/TabsFragment.kt +++ b/src/main/kotlin/com/michatec/store/screen/TabsFragment.kt @@ -283,13 +283,15 @@ class TabsFragment: ScreenFragment() { } this.sectionsList = sectionsList - val lastContentHeight = -1 + var lastContentHeight = -1 + var initial = true content.viewTreeObserver.addOnGlobalLayoutListener { if (this.view != null) { - val initial = true val contentHeight = content.height if (lastContentHeight != contentHeight) { - if (initial) { + lastContentHeight = contentHeight + if (initial) { + initial = false sectionsList.layoutParams.height = if (showSections) contentHeight else 0 sectionsList.visibility = if (showSections) View.VISIBLE else View.GONE sectionsList.requestLayout()