Fixed
Status Update
Comments
ja...@google.com <ja...@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
cl...@google.com <cl...@google.com>
ja...@google.com <ja...@google.com> #3
Friendly ping as it looks like a common case
lp...@google.com <lp...@google.com> #4
This happens because Emphasis currently does not get applied to non-opaque colors - but the use case is valid and is one of the problems with the current `Emphasis` implementation. This needs to change and I have some ideas, but it also requires a lot of changes to the layers below, such as content color, so I need to do a lot more thinking first unfortunately
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 3772ac5c0a5bcc10bbc7ba56893cf0540808a095
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Nov 02 19:23:39 2020
Deprecates Emphasis and adds AmbientContentAlpha to represent alpha provided by components
Migrates existing usages of Emphasis to use AmbientContentAlpha.
Text and Icon now consume AmbientContentAlpha by default.
Bug: b/150286239
Bug: b/158060530
Bug: b/159017896
Test: ContentAlphaTest
Relnote: "Emphasis has been deprecated and replaced with AmbientContentAlpha. AmbientContentAlpha is a simpler abstraction that represents the preferred content alpha for part of the hierarchy, similar to how AmbientContentColor represents the preferred content color. Text and Icon now consume the current value from AmbientContentAlpha by default, and you can manually do: color.copy(alpha = AmbientContentAlpha.current) to have the same effect in your components. Instead of using ProvideEmphasis, you can just directly provide a value through AmbientContentAlpha, and use the new default levels in ContentAlpha to replace the old EmphasisLevels."
Change-Id: Idf03e63a3082842e183535b5fdbf04947e3a671c
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_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/MaterialDemos.kt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/MaterialTextField.kt
A compose/material/material/samples/src/main/java/androidx/compose/material/samples/ContentAlphaSamples.kt
D compose/material/material/samples/src/main/java/androidx/compose/material/samples/EmphasisSamples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/TextFieldSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
A compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ContentAlphaTest.kt
D compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/EmphasisTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/TabScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/AlertDialog.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/AppBar.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomNavigation.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Button.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt
A compose/material/material/src/commonMain/kotlin/androidx/compose/material/ContentAlpha.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Emphasis.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Icon.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ListItem.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Menu.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Tab.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Text.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt
https://android-review.googlesource.com/1484478
Branch: androidx-master-dev
commit 3772ac5c0a5bcc10bbc7ba56893cf0540808a095
Author: Louis Pullen-Freilich <lpf@google.com>
Date: Mon Nov 02 19:23:39 2020
Deprecates Emphasis and adds AmbientContentAlpha to represent alpha provided by components
Migrates existing usages of Emphasis to use AmbientContentAlpha.
Text and Icon now consume AmbientContentAlpha by default.
Bug:
Bug:
Bug:
Test: ContentAlphaTest
Relnote: "Emphasis has been deprecated and replaced with AmbientContentAlpha. AmbientContentAlpha is a simpler abstraction that represents the preferred content alpha for part of the hierarchy, similar to how AmbientContentColor represents the preferred content color. Text and Icon now consume the current value from AmbientContentAlpha by default, and you can manually do: color.copy(alpha = AmbientContentAlpha.current) to have the same effect in your components. Instead of using ProvideEmphasis, you can just directly provide a value through AmbientContentAlpha, and use the new default levels in ContentAlpha to replace the old EmphasisLevels."
Change-Id: Idf03e63a3082842e183535b5fdbf04947e3a671c
M compose/material/material/api/current.txt
M compose/material/material/api/public_plus_experimental_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/MaterialDemos.kt
M compose/material/material/integration-tests/material-demos/src/main/java/androidx/compose/material/demos/MaterialTextField.kt
A compose/material/material/samples/src/main/java/androidx/compose/material/samples/ContentAlphaSamples.kt
D compose/material/material/samples/src/main/java/androidx/compose/material/samples/EmphasisSamples.kt
M compose/material/material/samples/src/main/java/androidx/compose/material/samples/TextFieldSamples.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/BottomNavigationScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ButtonTest.kt
A compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/ContentAlphaTest.kt
D compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/EmphasisTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/MenuTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/TabScreenshotTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/OutlinedTextFieldTest.kt
M compose/material/material/src/androidAndroidTest/kotlin/androidx/compose/material/textfield/TextFieldTest.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/AlertDialog.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/AppBar.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/BottomNavigation.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Button.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Checkbox.kt
A compose/material/material/src/commonMain/kotlin/androidx/compose/material/ContentAlpha.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Emphasis.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/FloatingActionButton.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Icon.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/ListItem.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/MaterialTheme.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Menu.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/RadioButton.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Snackbar.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Switch.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Tab.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/Text.kt
M compose/material/material/src/commonMain/kotlin/androidx/compose/material/TextFieldImpl.kt
Description
Column {
ProvideEmphasis(emphasis = EmphasisAmbient.current.medium) {
Log.d("jalc", ContentColorAmbient.current.alpha.toString())
Text("This should be medium")
ProvideEmphasis(emphasis = EmphasisAmbient.current.high) {
Log.d("jalc", ContentColorAmbient.current.alpha.toString())
Text("This should be high")
ProvideEmphasis(emphasis = EmphasisAmbient.current.disabled) {
Log.d("jalc", "Disabled " + ContentColorAmbient.current.alpha.toString())
Text("This should be disabled")
}
}
}
}
They all print the same value, 0.6
Expected: receive the parent's value each time.