Fixed
Status Update
Comments
il...@google.com <il...@google.com> #2
Did you try upgrading to
go...@gmail.com <go...@gmail.com> #3
That seems to solve the problem of the new composable sliding, but now it jumps from the center of the screen to its intended position, with and without animations enabled.
Video attached shows this.
jb...@google.com <jb...@google.com> #4
Hmm, I see that you have a lot of Alignment.Center
adjustments in your content. What happens if you instead use Alignment.TopStart
, passing that into the NavHost
contentAlignment
parameter as well.
go...@gmail.com <go...@gmail.com> #5
Oh that does seem to work, why is is that using the NavHost
to align the pages works better?
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #6
Project: platform/frameworks/support
Branch: androidx-main
commit 3a7a8942158d2dfbe5b77c25eb7861dcdea9ed95
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Mar 25 19:23:20 2024
Change the default contentAlignment to TopStart
Moving the NavHost default contentAlignment to `Alignment.TopStart` in
order to match the defaults of AnimatedContent. We previously used
`Alignment.Center` to match the previous used `CrossFade` API, but it
would cause unexpected position transitions when using specific
component such as column, row, etc.
RelNote: "`NavHost` now used `Alignment.TopStart` as the default
contentAlignment argument. This puts it in line with the default for
`AnimatedContent` and fixes some instances of an unexpected scale from
center transition."
Test: tested in sample app
Bug: 330111602
Change-Id: I09e7260d31cb571039629acd83b58eaf000a2493
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
https://android-review.googlesource.com/3011915
Branch: androidx-main
commit 3a7a8942158d2dfbe5b77c25eb7861dcdea9ed95
Author: Jeremy Woods <jbwoods@google.com>
Date: Mon Mar 25 19:23:20 2024
Change the default contentAlignment to TopStart
Moving the NavHost default contentAlignment to `Alignment.TopStart` in
order to match the defaults of AnimatedContent. We previously used
`Alignment.Center` to match the previous used `CrossFade` API, but it
would cause unexpected position transitions when using specific
component such as column, row, etc.
RelNote: "`NavHost` now used `Alignment.TopStart` as the default
contentAlignment argument. This puts it in line with the default for
`AnimatedContent` and fixes some instances of an unexpected scale from
center transition."
Test: tested in sample app
Bug: 330111602
Change-Id: I09e7260d31cb571039629acd83b58eaf000a2493
M navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
jb...@google.com <jb...@google.com> #7
This has been fixed internally and will be available in the Navigation 2.8.0-alpha06
release.
Description
Component used: Navigation Version used: 2.7.7 Devices/Android versions reproduced on: Android 14 Pixel 3A Emulator & Android 14 Pixel 6 Pro
When using a
NavHost
to navigate between pages, the new composable is animated in from the top left. This can be seen in my own project compiler in release mode ( shown in the video2024-03-18 20-38-28.mkv
), but also in a sample project I made to test this bug.In the attached sample project, it seems to become much less common after the page is switched a few times, but resetting the emulator makes it come back. The video
2024-03-18 21-11-39.mkv
shows the same problem occurring in the sample project with aNavigationBar
, and2024-03-18 21-21-51.mkv
, where aNavigationBar
is not present.