Status Update
Comments
yo...@gmail.com <yo...@gmail.com> #2
You can provide your own regex to By.text()
.
For example, By.text(Pattern.compile("All albums.*", Pattern.DOTALL))
should be equivalent to a multi-line startsWith.
as...@google.com <as...@google.com>
as...@google.com <as...@google.com> #3
I'm probably dumb but why would it be the default and wanted behavior if not documented properly?
Every known startWith / contains function in Java/Kotlin are multiline, the javadoc says: A UI element will be considered a match if its text value starts with the substring parameter
Many people will fall into this non standard default behavior and loose tons of time trying to figure out why.
If you still consider this default is the correct one, then please document it.
as...@google.com <as...@google.com> #4
Branch: androidx-main
commit 1625e615b9aed44323029da2726a57390956e4ab
Author: Daniel Peykov <peykov@google.com>
Date: Wed Nov 02 21:46:28 2022
Support multiline text and description matching
* Fixes inconsistency between UiSelector (partial support) and
BySelector, and clarifies the case sensitivity of related methods.
* Also, reorganizes byselector_test_activity to decrease its height
which was right up to the limit on some device types.
Bug: 255787130
Test: ./gradlew :test:uiautomator:integration-tests:t:cAT
Change-Id: Ied9eff43ce4ce6f2ace2889a55b0382e71604b61
M test/uiautomator/integration-tests/testapp/src/androidTest/java/androidx/test/uiautomator/testapp/BySelectorTest.java
M test/uiautomator/integration-tests/testapp/src/main/res/layout/byselector_test_activity.xml
M test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/BySelector.java
M test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/UiSelector.java
M test/uiautomator/uiautomator/src/main/java/androidx/test/uiautomator/Until.java
ap...@google.com <ap...@google.com> #5
Will be fixed in version 2.3.0-alpha02.
To clarify
However, looking at this again, it was inconsistent between UiSelector and BySelector, and users are unlikely to be relying on single line matching.
na...@google.com <na...@google.com> #6
Thanks a lot for the change.
I understand legacy and everything, it was just the close without discussion about proper solution (including doc that would have worked too) that was strange.
Seeing the $ in the regexp took me time, and it's good to avoid this to other users when improvement is possible.
Description
Jetpack Compose version: bom
2023.10.01
Jetpack Compose component(s) used:
remember
Kotlin version:
1.9.22
compose compiler:
1.5.8
The way
remember
treats Java method refs as keys differs with Intrinsic remember.The
Slider
in the code below DOES work if intrinsicremember
is disabled. but you can NOT slide theSlider
if intrinsicremember
is enabled (which is the default in 1.5.8)The
Slider
also works with kotlin 1.9.20 and 1.5.5 (before intrinsicremember
was enabled by default) .Also, note that if you use a Kotlin class instead of a Java class here then the Slider works fine with intrinsic
remember
enabled.The problem seems to be that
remember
thinks the methodRef key is changing on every recomposition when intrinsicremember
is enabled .This is a minimal reproducer.
Note: here is the config to disable
intrinsicRemember