Status Update
Comments
pa...@cardinalblue.com <pa...@cardinalblue.com> #2
Branch: androidx-master-dev
commit b90079595f33f58fece04026a97faa0d243acdb1
Author: Yuichi Araki <yaraki@google.com>
Date: Wed Sep 18 16:55:49 2019
Change the way to detect mismatch between POJO and query
This fixes cursor mismatch warnings with expandProjection.
Bug: 140759491
Test: QueryMethodProcessorTest
Change-Id: I7659002e5e0d1ef60fc1af2a625c0c36da0664d8
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
M room/compiler/src/test/kotlin/androidx/room/processor/QueryMethodProcessorTest.kt
M room/compiler/src/test/kotlin/androidx/room/testing/TestProcessor.kt
pa...@cardinalblue.com <pa...@cardinalblue.com> #3
jb...@google.com <jb...@google.com> #4
Branch: androidx-master-dev
commit bdde5a1a970ddc9007b28de4aa29d60ffa588f08
Author: Yigit Boyar <yboyar@google.com>
Date: Thu Apr 16 16:47:05 2020
Re-factor how errors are dismissed when query is re-written
This CL changes how we handle errors/warnings if query is
re-written.
There was a bug in expandProjection where we would report warnings
for things that Room already fixes automatically (
The solution to that problem (I7659002e5e0d1ef60fc1af2a625c0c36da0664d8)
solved it by deferring validating of columns until after re-write
decision is made. Unfortunately, this required changing PojoRowAdapter
to have a dummy mapping until it is validating, make it hard to use
as it does have a non-null mapping which is not useful.
This CL partially reverts that change and instead rely on the log
deferring logic we have in Context. This way, we don't need to break
the stability of PojoRowAdapter while still having the ability to
drop warnings that room fixes. This will also play nicer when we
have different query re-writing options that can use more information
about the query results.
Bug: 153387066
Bug: 140759491
Test: existing tests pass
Change-Id: I2ec967c763d33d7a3ff02c1a13c6953b460d1e5f
M room/compiler/src/main/kotlin/androidx/room/log/RLog.kt
M room/compiler/src/main/kotlin/androidx/room/processor/QueryMethodProcessor.kt
M room/compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
M room/compiler/src/main/kotlin/androidx/room/solver/query/result/PojoRowAdapter.kt
pa...@cardinalblue.com <pa...@cardinalblue.com> #5
2.7.0-beta02 - works as expected
2.7.0-rc01 - works as expected
2.7.0 - works as expected
2.7.1 - bug appears
So the bug has been introduced wit the 2.7.1 release, which only contain this relevant change:
mi...@gmail.com <mi...@gmail.com> #6
Hi, Is there any workaround for this issue without having to downgrade? We have upgraded accompanist and if we would downgrade to 2.6.0 it would affect much of our code base.
pa...@cardinalblue.com <pa...@cardinalblue.com> #7
2.7.0 works well, so you don't have to downgrade al the way to 2.6.0
il...@google.com <il...@google.com>
ti...@google.com <ti...@google.com> #8
I don't see any size/scale change using the snippet in
ti...@google.com <ti...@google.com> #9
I was able to repro the issue with the project linked in
It seems to me like a layout issue that was recently fixed, as the issue is fixed if I use a later version of the ui lib: implementation("androidx.compose.ui:ui:1.6.0-alpha03")
or newer.
pa...@cardinalblue.com <pa...@cardinalblue.com> #10
Please consider adding navigation to the compose BOM. Or at least when there's a stable release of the navigation library make sure it works well with the latest compose BOM. Updating the stable minor version of the navigation library should not break anything.
pa...@cardinalblue.com <pa...@cardinalblue.com> #11
Thanks for the info btw, I've decided to stay at 2.7.0-beta02
for now, since I know that works in my project and I am not comfortable with updating my compose ui to some alpha version
ti...@google.com <ti...@google.com> #12
Over to Jeremy for plans regarding releasing future versions of navigation.
hi...@gmail.com <hi...@gmail.com> #13
mi...@fresha.com <mi...@fresha.com> #14
ma...@gmail.com <ma...@gmail.com> #15
Another way to reproduce the issue between 2.7.0 (works) and 2.7.1 (broken) is a simple slideIntoContainer and slideOutOfContainer navigation. Hit the button in the example below fast and you'll see animations flying in from the corner instead of sliding!! (btw tested 2.7.5 and its still broken)
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialTheme {
val navController = rememberNavController()
NavHost(navController = navController, startDestination = "first_screen") {
composable(
route = "first_screen",
enterTransition = {
slideIntoContainer(
towards = AnimatedContentTransitionScope.SlideDirection.Left,
)
},
exitTransition = {
slideOutOfContainer(
towards = AnimatedContentTransitionScope.SlideDirection.Left,
)
},
) {
FirstScreen {
navController.navigate("first_screen")
}
}
}
}
}
}
}
@Composable
fun FirstScreen(navigate: () -> Unit) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Button(onClick = {
navigate()
}) {
Text(text = "Navigate!")
}
}
}
jb...@google.com <jb...@google.com> #16
In 2.7.1
we provided a fix for androidx.compose.ui:ui:1.6.0-alpha03
, but since it added new APIs it cannot be backported into a point release of Compose 1.5.x
.
Once compose 1.6.0 is stable, we can bump the dependency and release a new version of Navigation with the fix, but until then you can resolve it by either bumping your own compose dependency to use 1.6.x
or continuing to use Navigation 2.7.0
if you don't need any of the fixes from the other Navigation point releases.
jb...@google.com <jb...@google.com> #17
Navigation 2.8.0-alpha01
has upgraded the Compose dependency to 1.7.0-alpha01
so this will be addressed in the next release.
j....@gmail.com <j....@gmail.com> #18
Since compose 1.6.0 is live can we have a fix for that?
ma...@gmail.com <ma...@gmail.com> #19
al...@gmail.com <al...@gmail.com> #20
ir...@gmail.com <ir...@gmail.com> #21
We have the same issue (Compose 1.6.2 and Navigation-Compose 2.7.6).
After explicitly setting the enter and exit transitions, I noticed that on some screens it was working correctly, on others it wasn't. The nav destination screens working correctly were calling the .fillMaxSize() modifier on the outermost/topmost Composable in the view composition hierarchy.
So the accidental/unwanted scale animation seems to have something to do with the sizing of the view children during layouting.
Instead of now having to add sizing modifiers to all destination Composables/screens, adding the .fillMaxSize() modifier to the NavHost itself does the trick. As a result, the specified enter and exit transitions are never overriden by whatever causes the bug.
NavHost(
modifier = Modifier.fillMaxSize(),
navController = navController,
startDestination = navController.currentBackStackEntry?.destination?.route ?: ProfileDestination.Overview.route(),
enterTransition = { fadeIn(animationSpec = tween(200)) },
exitTransition = { fadeOut(animationSpec = tween(200)) }
)
al...@gmail.com <al...@gmail.com> #22
We observe the same behaviour as described in the previous comment – if size of the NavHost was not zero and changing as a result of navigation, we can see weird left slide-in animation. So I doubt this issue is fixed
il...@google.com <il...@google.com> #23
Please make sure you've updated to the recently released
Description
Version used: 2.7.1
Devices/Android versions reproduced on: Pixel 7
Using the navigation compose in the previous version I was able to immediately navigate away from the landing screen, if the user is logged in, with a nice crossfade animation playing between my landing screen and main screen. See: it-was-working-in-2.7.0-beta02.mp4
Upon updating the experience has gotten worse: when navigating away from the landing screen (while it's enter animation hasn't finished yet), a weird inflating animation is playing. See: expanding-bug.mp4
Since these are only cross fade animations the size of the container should never change. Why does the size of the container animating for a simple crossfade animation?
Expected behavior:
Since the size of the initial screen doesn't change during it's enter transition, I would expect the second screen to only play a fade in animation without the weird clipping/size changing that's happening at the moment.
Code to reproduce: (see also NavHostBugReport.zip)
```
NavHostBugReportTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
val navController = rememberNavController()
NavHost(navController = navController, "@landing") {
navigation("landing", "@landing") {
composable("landing") {
Box(modifier = Modifier
.fillMaxSize()
.background(Color.Red))
LaunchedEffect(key1 = Unit) {
navController.navigate("main")
}
}
}
navigation("main", "@main") {
composable("main") {
Box(modifier = Modifier
.fillMaxSize()
.background(Color.Blue))
}
}
}
}
}
```
If this is a bug in the library, we would appreciate if you could attach:
- Sample project to trigger the issue. (attached: NavHostBugReport.zip)
- A screenrecord or screenshots showing the issue (if UI related).
working correctly in 2.7.0-beta02: it-was-working-in-2.7.0-beta02.mp4
working unexpectedly in 2.7.1: expanding-bug.mp4