mirror of
https://github.com/Michatec/michas-droid.git
synced 2026-05-30 18:02:43 +02:00
- Updated the ScreenActivity.kt
- Some settings updated - Fix some bugs
This commit is contained in:
+2
-2
@@ -5,8 +5,8 @@ buildscript {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:9.0.1'
|
classpath 'com.android.tools.build:gradle:9.1.0'
|
||||||
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.2.10'
|
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.3.10'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,2 +1,5 @@
|
|||||||
|
plugins {
|
||||||
|
id 'org.gradle.toolchains.foojay-resolver-convention' version '1.0.0'
|
||||||
|
}
|
||||||
rootProject.name = "michas-droid"
|
rootProject.name = "michas-droid"
|
||||||
include ':'
|
include ':'
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ abstract class ScreenActivity: FragmentActivity() {
|
|||||||
|
|
||||||
private fun replaceFragment(fragment: Fragment, open: Boolean?) {
|
private fun replaceFragment(fragment: Fragment, open: Boolean?) {
|
||||||
if (open != null) {
|
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
|
supportFragmentManager
|
||||||
.beginTransaction()
|
.beginTransaction()
|
||||||
|
|||||||
@@ -283,13 +283,15 @@ class TabsFragment: ScreenFragment() {
|
|||||||
}
|
}
|
||||||
this.sectionsList = sectionsList
|
this.sectionsList = sectionsList
|
||||||
|
|
||||||
val lastContentHeight = -1
|
var lastContentHeight = -1
|
||||||
|
var initial = true
|
||||||
content.viewTreeObserver.addOnGlobalLayoutListener {
|
content.viewTreeObserver.addOnGlobalLayoutListener {
|
||||||
if (this.view != null) {
|
if (this.view != null) {
|
||||||
val initial = true
|
|
||||||
val contentHeight = content.height
|
val contentHeight = content.height
|
||||||
if (lastContentHeight != contentHeight) {
|
if (lastContentHeight != contentHeight) {
|
||||||
if (initial) {
|
lastContentHeight = contentHeight
|
||||||
|
if (initial) {
|
||||||
|
initial = false
|
||||||
sectionsList.layoutParams.height = if (showSections) contentHeight else 0
|
sectionsList.layoutParams.height = if (showSections) contentHeight else 0
|
||||||
sectionsList.visibility = if (showSections) View.VISIBLE else View.GONE
|
sectionsList.visibility = if (showSections) View.VISIBLE else View.GONE
|
||||||
sectionsList.requestLayout()
|
sectionsList.requestLayout()
|
||||||
|
|||||||
Reference in New Issue
Block a user