Fixed
Status Update
Comments
ja...@google.com <ja...@google.com>
ra...@google.com <ra...@google.com>
ap...@google.com <ap...@google.com> #2
This is currently also affecting a TextField as it has a blinking cursor. This means any text field that is on the screen will block our synchronization.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-master-dev
commit ba279a0fd4cb3df553cc80cfec23353fba8c0411
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Jun 10 15:07:39 2020
Disable blinking cursor in tests by default
The blinking cursor is a poster child example of an infinite animation.
As long as we don't have a solution in place to properly deal with
infinite animations, we disable the blinking cursor in tests to avoid
tests from timing out just because there is a TextField that has focus
in the test.
I moved the TextField tests for the cursor to a separate test class, so
we can explicitly enable (and manually control) the blinking cursor for
thoses tests.
Bug: 151940543
Test: ./gradlew ui:ui-foundation:cC ui:ui-material:cC ui:ui-test:cC
Change-Id: I12984b8f43f6b587aa5cd9aabeaea96309e9086b
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
A ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
M ui/ui-test/api/0.1.0-dev14.txt
M ui/ui-test/api/api_lint.ignore
M ui/ui-test/api/current.txt
M ui/ui-test/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-test/api/public_plus_experimental_current.txt
M ui/ui-test/api/restricted_0.1.0-dev14.txt
M ui/ui-test/api/restricted_current.txt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/ComposeTestRule.kt
M ui/ui-test/src/main/java/androidx/ui/test/android/AndroidComposeTestRule.kt
https://android-review.googlesource.com/1329004
https://goto.google.com/android-sha1/ba279a0fd4cb3df553cc80cfec23353fba8c0411
Branch: androidx-master-dev
commit ba279a0fd4cb3df553cc80cfec23353fba8c0411
Author: Jelle Fresen <jellefresen@google.com>
Date: Wed Jun 10 15:07:39 2020
Disable blinking cursor in tests by default
The blinking cursor is a poster child example of an infinite animation.
As long as we don't have a solution in place to properly deal with
infinite animations, we disable the blinking cursor in tests to avoid
tests from timing out just because there is a TextField that has focus
in the test.
I moved the TextField tests for the cursor to a separate test class, so
we can explicitly enable (and manually control) the blinking cursor for
thoses tests.
Bug: 151940543
Test: ./gradlew ui:ui-foundation:cC ui:ui-material:cC ui:ui-test:cC
Change-Id: I12984b8f43f6b587aa5cd9aabeaea96309e9086b
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/SoftwareKeyboardTest.kt
A ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldCursorTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldOnValueChangeTextFieldValueTest.kt
M ui/ui-foundation/src/androidTest/java/androidx/ui/foundation/TextFieldTest.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/TextField.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/FilledTextFieldTest.kt
M ui/ui-test/api/0.1.0-dev14.txt
M ui/ui-test/api/api_lint.ignore
M ui/ui-test/api/current.txt
M ui/ui-test/api/public_plus_experimental_0.1.0-dev14.txt
M ui/ui-test/api/public_plus_experimental_current.txt
M ui/ui-test/api/restricted_0.1.0-dev14.txt
M ui/ui-test/api/restricted_current.txt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/ComposeTestRule.kt
M ui/ui-test/src/main/java/androidx/ui/test/android/AndroidComposeTestRule.kt
ap...@google.com <ap...@google.com> #4
This bug was referenced by a recent CL that changed the Android API surface area.
The Android API Council <http://go/android-api-council > regularly reviews API changes for
consistency and sustainability, and we've just added this bug to our hotlist of pending reviews.
We'll wait until you mark this bug as 'Fixed' before starting our review, but please reach out
if you'd like us to review it sooner.
CHANGES TO ui/ui-test/api/current.txt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.ComposeTestRuleKt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test.android
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestCaseSetup
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestRuleKt
CHANGES TO ui/ui-test/api/public_plus_experimental_current.txt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.ComposeTestRuleKt
http://goto.google.com/android-api-diff/support/cur/pkg/androidx.ui.test.android
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestCaseSetup
http://goto.google.com/android-api-diff/support/cur/clz/androidx.ui.test.android.AndroidComposeTestRuleKt
The links above may take several days to start working. Generated fromhttp://go/support-current.txt/ba279a0fd4cb3df553cc80cfec23353fba8c0411
[Gerrit:http://android-review.googlesource.com/1329004 ]
[API-Approvers:pavlis@google.com]
[LIBRARY_API_REVIEW_TAG:ui/ui-test/api/0.1.0-dev14.txt]
The Android API Council <
consistency and sustainability, and we've just added this bug to our hotlist of pending reviews.
We'll wait until you mark this bug as 'Fixed' before starting our review, but please reach out
if you'd like us to review it sooner.
CHANGES TO ui/ui-test/api/current.txt
CHANGES TO ui/ui-test/api/public_plus_experimental_current.txt
The links above may take several days to start working. Generated from
[Gerrit:
[API-Approvers:pavlis@google.com]
[LIBRARY_API_REVIEW_TAG:ui/ui-test/api/0.1.0-dev14.txt]
ap...@google.com <ap...@google.com> #5
Hi Jelle. Is this fixed or is there still more work to do? Thanks!
ap...@google.com <ap...@google.com> #6
Hi Jelle. Can you please update this by eod Tues so that we can close the iteration. Thanks.
Description
val constraints = Constraints.Builder()
.setRequiresCharging(true)
.setRequiredNetworkType(NetworkType.CONNECTED)
.build()
The default parameters approach is trivial using a data class and named parameters could be used when being constructed.
data class Constraints(
val requiredNetworkType: NetworkType = NetworkType.NOT_REQUIRED,
val requiresCharging: Boolean = false
)
val constraints = Constraints(requiredNetworkType = NetworkType.METERED)
For converting the builder from java to a more idiomatic Kotlin, we could also write a function that uses a method with a receiver on the builder.
inline fun constraints(builder: Constraints.Builder.() -> Unit): Constraints {
return Constraints.Builder().apply { builder() }.build()
}
val constraints = constraints {
setRequiredNetworkType(NetworkType.CONNECTED)
setRequiresCharging(true)
}
The naming of these could probably be renamed, just a nicer way to write builder like classes in kotlin.