Fixed
Status Update
Comments
za...@gmail.com <za...@gmail.com> #2
Project: platform/frameworks/support
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
https://android-review.googlesource.com/1123258
https://goto.google.com/android-sha1/b90079595f33f58fece04026a97faa0d243acdb1
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
an...@google.com <an...@google.com>
si...@google.com <si...@google.com> #3
se...@gmail.com <se...@gmail.com> #4
Project: platform/frameworks/support
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 ( b/140759491 ).
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
https://android-review.googlesource.com/1288456
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
ha...@google.com <ha...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-main
commit f8827dce0c2aff66def97f032e8fc7b381801a51
Author: Halil Ozercan <halilibo@google.com>
Date: Thu Jun 23 18:27:06 2022
Add DrawScope.drawText method to enable drawing text on Compose Canvas using TextMeasurer.
This function has 4 overloads categorized into two; implicit and explicit use of TextMeasurer.
First two overloads take required parameters to draw a text in its entirety and a text measurer that actually computes the final layout. Difference between overloads is that one accepts AnnotatedString and the other one accepts String. Essentially AnnotatedString overload provides multi-styling while String overload provides an easy-to-use API.
The other two overloads draw a `TextLayoutResult` which can be generated by `TextMeasurer.measure` call. These functions can be useful for advanced use cases that optimize text measurement on top of the internal cache of a `TextMeasurer`. These functions also expose the ability to change non-layout-affecting attributes like color, brush, shadow during draw phase.
Fix: b/190787898
Relnote: "Added `drawText` extension function on `DrawScope` to provide a way to draw multi-styled text on composables and modifiers that operate on a DrawScope like `Canvas` and `drawBehind`."
Test: TextPainterTest.kt
Change-Id: I16a6226ae83d879f2c493fb811f1ecef77a1fc15
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/TextPainterTest.kt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextPainter.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextDemos.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/DrawTextDemo.kt
M compose/ui/ui-text/api/current.txt
A compose/ui/ui-text/samples/src/main/java/androidx/compose/ui/text/samples/DrawTextSamples.kt
https://android-review.googlesource.com/2135315
Branch: androidx-main
commit f8827dce0c2aff66def97f032e8fc7b381801a51
Author: Halil Ozercan <halilibo@google.com>
Date: Thu Jun 23 18:27:06 2022
Add DrawScope.drawText method to enable drawing text on Compose Canvas using TextMeasurer.
This function has 4 overloads categorized into two; implicit and explicit use of TextMeasurer.
First two overloads take required parameters to draw a text in its entirety and a text measurer that actually computes the final layout. Difference between overloads is that one accepts AnnotatedString and the other one accepts String. Essentially AnnotatedString overload provides multi-styling while String overload provides an easy-to-use API.
The other two overloads draw a `TextLayoutResult` which can be generated by `TextMeasurer.measure` call. These functions can be useful for advanced use cases that optimize text measurement on top of the internal cache of a `TextMeasurer`. These functions also expose the ability to change non-layout-affecting attributes like color, brush, shadow during draw phase.
Fix:
Relnote: "Added `drawText` extension function on `DrawScope` to provide a way to draw multi-styled text on composables and modifiers that operate on a DrawScope like `Canvas` and `drawBehind`."
Test: TextPainterTest.kt
Change-Id: I16a6226ae83d879f2c493fb811f1ecef77a1fc15
A compose/ui/ui-text/src/androidAndroidTest/kotlin/androidx/compose/ui/text/TextPainterTest.kt
M compose/ui/ui-text/api/restricted_current.txt
M compose/ui/ui-text/src/commonMain/kotlin/androidx/compose/ui/text/TextPainter.kt
M compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/TextDemos.kt
M compose/ui/ui-text/api/public_plus_experimental_current.txt
A compose/foundation/foundation/integration-tests/foundation-demos/src/main/java/androidx/compose/foundation/demos/text/DrawTextDemo.kt
M compose/ui/ui-text/api/current.txt
A compose/ui/ui-text/samples/src/main/java/androidx/compose/ui/text/samples/DrawTextSamples.kt
Description
Currently, the
drawText
function is not available for @Composable Canvas. To draw a text, we need to usecanvas.nativeCanvas.drawText
, which is the function from android.graphics.Canvas.java. The drawText function could have similar parameters like drawLine or other functions from @Composable Canvas. for example: fun drawText(text: String, color: Color, position: Offset, alpha: Float = 1.0f) This probably should also have style, size, and other parameters from @Composable Text.