Status Update
Comments
gr...@google.com <gr...@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
gr...@google.com <gr...@google.com> #3
se...@google.com <se...@google.com>
se...@google.com <se...@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
se...@google.com <se...@google.com> #5
private val fontWeights = listOf(100, 200, 300, 400)
private val fonts = listOf(
"Azeret" to R.font.azeret_mono,
"Roboto Mono" to R.font.roboto_mono,
)
@OptIn(ExperimentalTextApi::class)
private val fontFamilies = fonts.map { (_, resId) ->
FontFamily(
fontWeights.map { weight ->
Font(
resId = resId,
weight = FontWeight(weight),
variationSettings = FontVariation.Settings(FontVariation.weight(weight))
)
}
)
}
@Composable
fun Demo() {
Column {
FullListRepro()
// FullListOK()
}
}
@Composable
fun FullListRepro() {
Column {
fontWeights.forEach { weight ->
fonts.forEachIndexed { i, (familyName, _) ->
val fontFamily = fontFamilies[i]
val style = TextStyle(
fontFamily = fontFamily,
fontWeight = FontWeight(weight),
fontSize = 40.sp
)
BasicText("$weight $familyName", style=style)
}
}
}
}
@Composable
fun FullListOK() {
Column {
fonts.forEachIndexed { i, (familyName, _) ->
fontWeights.forEach { weight ->
val fontFamily = fontFamilies[i]
val style = TextStyle(
fontFamily = fontFamily,
fontWeight = FontWeight(weight),
fontSize = 40.sp
)
BasicText("$weight $familyName", style=style)
}
}
}
}
OK composable is fine, but if you switch the order you see the incorrect behavior coming from resource font loading.
se...@google.com <se...@google.com>
mo...@gmail.com <mo...@gmail.com> #6
When setting the fontWeight, either in the TextStyle, or in the TextField, ... 100-300 shows same weight, 400-600 shows same weight etc ...
When setting it as FontVariation.Setting it is working correctly ...
Is this need to explicitly mention for variable fonts ?
se...@google.com <se...@google.com> #7
That issue is a little bit different
We don't do any draw time istantiation of font axes.
You can get the behavior you expect by defining multiple instances of the font. One for each font weight that you want to support. You can put them in a FontFamily, and then matching is done by (FontWeight, Style)
se...@google.com <se...@google.com>
ap...@google.com <ap...@google.com> #8
Project: platform/frameworks/support
Branch: androidx-main
Author: Sean McQuillan <
Link:
Don't allow Paint to cache variation settings of resource fonts
Expand for full commit details
Don't allow Paint to cache variation settings of resource fonts
Prev: Loading two resource fonts with the same variation settings would cause the variation settings to not be applied to the second font.
New: Paint cache is invalidated during font load path.
Fixes: b/372044241
Test: manual of variable font demo
Relnote: "Resource fonts with the same variation settings will now avoid over-caching causing the incorrect variation settings to be applied."
Change-Id: If3dff4ea44e33b1ed80bc7fb5057923a088f1678
Files:
- M
compose/ui/ui-text/src/androidMain/kotlin/androidx/compose/ui/text/font/PlatformTypefaces.android.kt
Hash: 8ad5f10469c5a044be4fd8a90fc19c5614f61734
Date: Tue Oct 15 16:25:26 2024
pr...@google.com <pr...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.ui:ui-text:1.8.0-alpha08
androidx.compose.ui:ui-text-android:1.8.0-alpha08
androidx.compose.ui:ui-text-jvmstubs:1.8.0-alpha08
androidx.compose.ui:ui-text-linuxx64stubs:1.8.0-alpha08
Description
- Jetpack Compose component used: FontVariation
- Android Studio Build: Build #AI-241.18034.62.2412.12266719, built on August 23, 2024
- Kotlin version: 1.9.0, 2.0.20
- Devices/Android versions reproduced on: Pixel 8 Pro API 35 emulator
- Keyboard (i.e. Gboard, Samsung, etc): Gboard
- Sample project to trigger the issue:
A screen recording was attached.
Description of the minimal example:
I'm using two variable fonts: Azeret Mono and Roboto Mono.
For each font I created a map containing 4 different font weights(100, 200, 300, 400). I'm persisting this weight info along with the font index in a DataStore.
Using a slider and a menu I'm changing the style of a Text.
Observed behavior:
- negative case:
When I open the app and change the font from Azeret(200) to Roboto(200) the displayed style is Roboto(400) instead. Similar behavior can be observed with other configurations too.
- positive case:
When I open the app and play around with the slider first and then change the font, everything looks fine.