Fixed
Status Update
Comments
cl...@google.com <cl...@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
po...@google.com <po...@google.com> #3
Are there plans for a more general solution to prevent this? In any case, I will reassign this to me to fix it for dev14.
ma...@google.com <ma...@google.com> #4
The problem is because if the order in DropDownMenuItem
modifier
.clickable(enabled = enabled, onClick = onClick)
.ripple(enabled = enabled)
ripple should be used before clickable (when clickable was a modifier), so it can show indication, while also allowing to click. With clickable.ripple ripple will click and eat all the clicks.
To make this error-safe, ripple will be deprecated and clickable how have build-in ripple indication, so noone will be able to face incorrect order. If you want to allow users to customize ripple indication, you can accept Indication param and pass it to the clickable.
Let me know if you need any help fixing this
modifier
.clickable(enabled = enabled, onClick = onClick)
.ripple(enabled = enabled)
ripple should be used before clickable (when clickable was a modifier), so it can show indication, while also allowing to click. With clickable.ripple ripple will click and eat all the clicks.
To make this error-safe, ripple will be deprecated and clickable how have build-in ripple indication, so noone will be able to face incorrect order. If you want to allow users to customize ripple indication, you can accept Indication param and pass it to the clickable.
Let me know if you need any help fixing this
po...@google.com <po...@google.com>
ap...@google.com <ap...@google.com> #5
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 6df744e9fe739e832be172df0733229908819377
Author: Mihai Popa <popam@google.com>
Date: Fri May 29 16:45:07 2020
Fix onClick not invoked on DropdownMenuItems
Relnote: "Fixed onClick not being invoked for DropdonMenuItems."
Bug: 157673259
Test: MenuTest
Change-Id: I3998b374f4ad047c5a24521b5d3ba928be2e3e69
M ui/ui-material/src/androidTest/java/androidx/ui/material/MenuTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/Menu.kt
https://android-review.googlesource.com/1320518
Branch: androidx-master-dev
commit 6df744e9fe739e832be172df0733229908819377
Author: Mihai Popa <popam@google.com>
Date: Fri May 29 16:45:07 2020
Fix onClick not invoked on DropdownMenuItems
Relnote: "Fixed onClick not being invoked for DropdonMenuItems."
Bug: 157673259
Test: MenuTest
Change-Id: I3998b374f4ad047c5a24521b5d3ba928be2e3e69
M ui/ui-material/src/androidTest/java/androidx/ui/material/MenuTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/Menu.kt
Description
all required information.
Android Studio Build: 4.1 canary 8
Version of Gradle Plugin:4.1.0-alpha08
Version of Gradle: 6.3
Version of Java: 8
OS: Android 10
Steps to Reproduce:
1. Create a simple Composable function with a DropDownMenu and a DropDownItem from ui-material
2. Pass a listener through the 'onClick' parameter of DropDownItem
3. The passed listener will never be invoked
Reading the source code of DropDownItem, I found that the cause of the problem is a ripple modifier, applied after the clickable one.