Status Update
Comments
lp...@google.com <lp...@google.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
je...@google.com <je...@google.com> #3
an...@telekom.de <an...@telekom.de> #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
an...@telekom.de <an...@telekom.de> #5
Additional info
compose version: '1.1.0-beta02' gradle: gradle-7.2-all Emulator: API 26 x86
je...@google.com <je...@google.com> #6
Hmm, this is odd. I can reproduce the bug when using the latest snapshot build of Compose from androidx.dev (
je...@google.com <je...@google.com> #7
Here is what happened:
The Live Literals feature in Android Studio switches out literals with state values. This will influence static inference by the compiler.
Without Live Literals on, the compiler will infer that Modifier.testTag("tag")
is only using static input and will not even call equals on it to verify if the value has changed (and consequently if parts of the code can be skipped); it knows that it will never change. With Live Literals on however, Modifier.testTag("tag")
is no longer considered static and during composition Modifier.testTag("tag") == Modifier.testTag("tag")
will be false, resulting in not skipping that part of the code.
This is a consequence of the underlying Modifier.composed(..)
, which is not equal to another Modifier.composed(..)
with exactly the same lambda.
For now, you can turn off Live Literals by adding @file:NoLiveLiterals
to the impacted files when benchmarking compositions. Also, in release builds Live Literals will always be turned off.
I filed
an...@telekom.de <an...@telekom.de> #8
In release builds or with @file:NoLiveLiterals it works.
Thanks for the details.
ap...@google.com <ap...@google.com> #9
Branch: androidx-main
commit 23ca74cafdbfa98898d8dfd5836ce81f02f48a59
Author: Alexandre Elias <aelias@google.com>
Date: Wed Jul 13 15:52:22 2022
Make Modifier.semantics stateless
This consolidates two other changes (
composed {} from the semantics modifier.
The semantics id is now generated lazily in the corresponding
LayoutNode. This allows us to create the semantics modifier without the
need for a composition context. In turn that means that semantics
modifiers are now comparable with each other, such that for example
Modifier.testTag("foo") == Modifier.testTag("foo").
When lambdas are part of the semantics, for example as an onClick
action, the semantics modifiers will still compare unequal though, even
when the lambdas do the exact same thing:
Modifier.semantics{onClick={true}} != Modifier.semantics{onClick={true}}
Bug: 203559524
Test: ./gradlew compose:ui:ui:test && \
./gradlew compose:ui:ui:cC
Relnote: "Deprecated `SemanticsModifier.id` and moved the semantics id
to `LayoutInfo.semanticsId` instead."
Change-Id: Iac808fc0e3ff14f1c1a95ee3f1f24cd436245a0e
M compose/ui/ui/api/restricted_current.ignore
M compose/ui/ui-inspection/src/main/java/androidx/compose/ui/inspection/inspector/LayoutInspectorTree.kt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/AndroidComposeViewAccessibilityDelegateCompatTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/node/LayoutNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsModifier.kt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextControllerTest.kt
M compose/ui/ui/api/current.txt
M compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/semantics/SemanticsTests.kt
M compose/ui/ui/src/skikoMain/kotlin/androidx/compose/ui/platform/SkiaBasedOwner.skiko.kt
M compose/ui/ui/src/test/kotlin/androidx/compose/ui/node/LayoutNodeTest.kt
M compose/ui/ui/api/current.ignore
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeView.android.kt
M compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/layout/LayoutInfo.kt
M compose/ui/ui/api/restricted_current.txt
M compose/foundation/foundation/src/test/kotlin/androidx/compose/foundation/text/TextSelectionLongPressDragTest.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsNode.kt
M compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsEntity.kt
M compose/ui/ui/api/public_plus_experimental_current.txt
cl...@google.com <cl...@google.com>
ae...@google.com <ae...@google.com> #10
I didn't specifically test the testTag/skipping combination, but I think the above change probably fixed it in Compose 1.3. Feel free to reopen if it didn't.
Description
I have created a code sample which shows the wrong behavior of the
testTag
modifier.Steps to Reproduce:
Compile this code and run the composable.
Look at the debug console. If the
testTag
is set to the modifier chain the composable is recomposed every time the state changes.