Don't play enter transtition when launcher is already in foreground
This commit is contained in:
parent
b0ee0c63d8
commit
c0a97d0d67
@ -143,10 +143,12 @@ abstract class SharedLauncherActivity(
|
||||
.currentTransition
|
||||
.flowWithLifecycle(lifecycle, Lifecycle.State.RESUMED)
|
||||
.collect {
|
||||
enterTransitionProgress.value = 0f
|
||||
enterTransition = it
|
||||
enterTransitionProgress.animateTo(1f)
|
||||
enterTransition = null
|
||||
if (it != null) {
|
||||
enterTransitionProgress.value = 0f
|
||||
enterTransition = it
|
||||
enterTransitionProgress.animateTo(1f)
|
||||
enterTransition = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,6 +232,7 @@ abstract class SharedLauncherActivity(
|
||||
.imePadding()
|
||||
)
|
||||
enterTransition?.let {
|
||||
if (it.startBounds == null || it.targetBounds == null) return@let
|
||||
val dX = it.startBounds.center.x - it.targetBounds.center.x
|
||||
val dY = it.startBounds.center.y - it.targetBounds.center.y
|
||||
val s =
|
||||
|
||||
@ -5,7 +5,7 @@ import androidx.compose.ui.geometry.Offset
|
||||
import androidx.compose.ui.geometry.Rect
|
||||
|
||||
data class EnterHomeTransition(
|
||||
val startBounds: Rect,
|
||||
val targetBounds: Rect,
|
||||
val startBounds: Rect? = null,
|
||||
val targetBounds: Rect? = null,
|
||||
val icon: (@Composable (animVector: Offset, progress: () -> Float) -> Unit)? = null
|
||||
)
|
||||
@ -30,7 +30,7 @@ class EnterHomeTransitionManager {
|
||||
return
|
||||
}
|
||||
}
|
||||
currentTransition.tryEmit(null)
|
||||
currentTransition.tryEmit(EnterHomeTransition())
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user