mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-02-21 10:17:56 +00:00
Be a bit smarter about choosing our anchor to animate to.
This commit is contained in:
@@ -387,9 +387,16 @@ class MainActivity : PassphraseRequiredActivity(), VoiceNoteMediaControllerOwner
|
||||
}
|
||||
|
||||
LaunchedEffect(windowSizeClass) {
|
||||
val anchor = anchors[paneAnchorIndex]
|
||||
val index = when {
|
||||
paneAnchorIndex < 0 -> 1
|
||||
paneAnchorIndex > anchors.lastIndex -> anchors.lastIndex
|
||||
else -> paneAnchorIndex
|
||||
}
|
||||
|
||||
paneExpansionState.animateTo(anchor)
|
||||
if (index in anchors.indices) {
|
||||
val anchor = anchors[index]
|
||||
paneExpansionState.animateTo(anchor)
|
||||
}
|
||||
}
|
||||
|
||||
val chatNavGraphState = ChatNavGraphState.remember(windowSizeClass)
|
||||
|
||||
Reference in New Issue
Block a user