Fixed
Status Update
Comments
se...@google.com <se...@google.com>
ma...@google.com <ma...@google.com>
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 23a7d960caf43390a554700d3c56ada189a9d10e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Aug 10 15:11:36 2020
IconButton / IconToggleButton API scrub
Test: ./gradlew updateApi
Bug: b/161809385
Bug: b/161807956
Relnote: "Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton"
Change-Id: I0a9419b1a631cadad451395302ad87b7f9214f96
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
https://android-review.googlesource.com/1394868
Branch: androidx-master-dev
commit 23a7d960caf43390a554700d3c56ada189a9d10e
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Aug 10 15:11:36 2020
IconButton / IconToggleButton API scrub
Test: ./gradlew updateApi
Bug:
Bug:
Relnote: "Adds enabled parameter to IconButton, and reorders parameters in IconToggleButton"
Change-Id: I0a9419b1a631cadad451395302ad87b7f9214f96
M ui/ui-material/api/current.txt
M ui/ui-material/api/public_plus_experimental_current.txt
M ui/ui-material/api/restricted_current.txt
M ui/ui-material/src/commonMain/kotlin/androidx/compose/material/IconButton.kt
Description
Jetpack Compose component used: BasicTextField + TextFieldDecorationBox or OutlinedTextFieldDecorationBox
Android Studio Build: 2022.3.1 Patch 2 | Build #AI-223.8836.35.2231.10811636
Kotlin version: 1.9.10
Steps to Reproduce or Code Sample to Reproduce:
Using this code snippet, Im not able to apply a backgroundColor to the decoration box, whether outlined or filled.
```
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun BasicTextFieldIssue(inputText: String = "") {
var text by remember { mutableStateOf(inputText) }
val interactionSource = remember { MutableInteractionSource() }
BasicTextField(
interactionSource = interactionSource,
value = text,
onValueChange = {},
) {
TextFieldDefaults.TextFieldDecorationBox(
value = inputText,
visualTransformation = VisualTransformation.None,
innerTextField = it,
enabled = true,
interactionSource = interactionSource,
singleLine = true,
colors = TextFieldDefaults.textFieldColors(
backgroundColor = Color.Red, // <--- Not applied as expected.
),
)
}
}
```
OR
```
@OptIn(ExperimentalMaterialApi::class)
@Composable
fun BasicTextFieldIssue(inputText: String = "") {
var text by remember { mutableStateOf(inputText) }
val interactionSource = remember { MutableInteractionSource() }
BasicTextField(
interactionSource = interactionSource,
value = text,
onValueChange = {},
) {
TextFieldDefaults.OutlinedTextFieldDecorationBox(
value = inputText,
visualTransformation = VisualTransformation.None,
innerTextField = it,
enabled = true,
interactionSource = interactionSource,
singleLine = true,
colors = TextFieldDefaults.outlinedTextFieldColors(
backgroundColor = Color.Red,
),
)
}
}
```
Expected:
I expect the background of my TextField to be set to the Color red in those 2 examples.
Stack trace (if applicable):