Fixed
Status Update
Comments
nj...@google.com <nj...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 9082f62682f853ad5251a1c79dde9eccba7abdd9
Author: Max Alfonso-Ying <maxying@google.com>
Date: Thu Apr 18 00:34:40 2024
[M2 text field] Apply background to decoration box
...instead of to the BasicTextField, so changing the
backgroundColor will properly change the decoration
box's background color.
Fixes: b/307694651
Test: added unit tests
Relnote: "Fix backgroundColor not applying to
TextFieldDecorationBox and OutlinedTextFieldDecorationBox.
Decoration boxes now accept a `shape` parameter."
Change-Id: I371c26718597cb36ac537e9412ce476532afb40d
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/TextFieldDecorationBoxDemos.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/textfield/TextFieldDecorationBoxTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldDefaults.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt
https://android-review.googlesource.com/3046833
Branch: androidx-main
commit 9082f62682f853ad5251a1c79dde9eccba7abdd9
Author: Max Alfonso-Ying <maxying@google.com>
Date: Thu Apr 18 00:34:40 2024
[M2 text field] Apply background to decoration box
...instead of to the BasicTextField, so changing the
backgroundColor will properly change the decoration
box's background color.
Fixes:
Test: added unit tests
Relnote: "Fix backgroundColor not applying to
TextFieldDecorationBox and OutlinedTextFieldDecorationBox.
Decoration boxes now accept a `shape` parameter."
Change-Id: I371c26718597cb36ac537e9412ce476532afb40d
M compose/material/material/api/current.txt
M compose/material/material/api/restricted_current.txt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/TextFieldDecorationBoxDemos.kt
M compose/material/material/src/androidInstrumentedTest/kotlin/androidx/compose/material/textfield/TextFieldDecorationBoxTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/OutlinedTextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextField.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldDefaults.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt
tr...@gmail.com <tr...@gmail.com> #3
Thank you for the very prompt response. I tested it and it solves my problem nicely!
lp...@google.com <lp...@google.com> #4
Thanks for the request! Using Modifier.size
with Icon
should also work for simpler cases when you do not need to provide a custom ColorFilter
or similar, so we should definitely support this functionality in Icon
too. Re-opening this bug to track.
lp...@google.com <lp...@google.com> #5
This has now been fixed, so in the next release of Compose writing just:
Icon(vectorResource(R.drawable.ic_icon), modifier = Modifier.size(100.dp))
should make the icon 100x100dp, and draw to fit the space.
Description
Android Studio Build: Arctic Fix 2020.3.1 Canary 5
Alpha 11 lost the ability for us to change the default size of an icon loaded with vectorResource. In Alpha 10 I could do this by using:
Icon(vectorResource(R.drawable.ic_icon).copy(defaultWidth = 100.dp, defaultHeight = 100.dp))
This no longer works in Alpha 11. I did sort of find a way around this using the following:
Icon(vectorResource(R.drawable.ic_icon), modifier = Modifier.size(100.dp).scale(4f))
But this causes the vector to become pixelated. I thought the whole point of using vector resources is to be able to easily scale to any size and avoid pixelation?