diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2023-06-07 16:11:45 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2023-06-07 16:11:45 +0000 |
commit | c0562bb9337b0cb0e623fb21214d8c6379377a5c (patch) | |
tree | 8d5aab82131715fcb6adcbd1bf914121ee45d323 | |
parent | 3307b6881d139f0a4036827764e28e79ce2a82e2 (diff) | |
parent | 54bcc26f92051be566c6ae4a16dc1eaa501d92a9 (diff) | |
download | support-snap-temp-L87400000961119506.tar.gz |
Merge "Rename performImeAction to onImeAction." into snap-temp-L87400000961119506snap-temp-L87400000961119506
11 files changed, 45 insertions, 34 deletions
diff --git a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt index 3a6036e5d6a..de8d5f1b89b 100644 --- a/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt +++ b/compose/foundation/foundation/src/commonMain/kotlin/androidx/compose/foundation/text/CoreTextField.kt @@ -83,10 +83,10 @@ import androidx.compose.ui.semantics.editableText import androidx.compose.ui.semantics.getTextLayoutResult import androidx.compose.ui.semantics.insertTextAtCursor import androidx.compose.ui.semantics.onClick +import androidx.compose.ui.semantics.onImeAction import androidx.compose.ui.semantics.onLongClick import androidx.compose.ui.semantics.password import androidx.compose.ui.semantics.pasteText -import androidx.compose.ui.semantics.performImeAction import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.setSelection import androidx.compose.ui.semantics.setText @@ -501,7 +501,7 @@ internal fun CoreTextField( false } } - performImeAction(imeOptions.imeAction) { + onImeAction(imeOptions.imeAction) { // This will perform the appropriate default action if no handler has been specified, so // as far as the platform is concerned, we always handle the action and never want to // defer to the default _platform_ implementation. diff --git a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TextActionsTest.kt b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TextActionsTest.kt index f91c06077d5..6be0f402f92 100644 --- a/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TextActionsTest.kt +++ b/compose/ui/ui-test/src/androidAndroidTest/kotlin/androidx/compose/ui/test/TextActionsTest.kt @@ -27,7 +27,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.testTag import androidx.compose.ui.semantics.insertTextAtCursor -import androidx.compose.ui.semantics.performImeAction +import androidx.compose.ui.semantics.onImeAction import androidx.compose.ui.semantics.requestFocus import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.setText @@ -280,7 +280,7 @@ class TextActionsTest { setText { true } requestFocus { true } insertTextAtCursor { true } - performImeAction(ImeAction.Done) { false } + onImeAction(ImeAction.Done) { false } }) } @@ -314,7 +314,7 @@ class TextActionsTest { rule.setContent { BoundaryNode(testTag = "node", Modifier.semantics { setText { true } - performImeAction(ImeAction.Done) { true } + onImeAction(ImeAction.Done) { true } }) } diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Filters.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Filters.kt index d6fdb5a5999..abec39730f2 100644 --- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Filters.kt +++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/Filters.kt @@ -397,9 +397,9 @@ fun hasInsertTextAtCursorAction() = * Returns whether the node defines a semantics action to perform the * [IME action][SemanticsProperties.ImeAction] on it. * - * @see SemanticsActions.PerformImeAction + * @see SemanticsActions.OnImeAction */ -fun hasPerformImeAction() = hasKey(SemanticsActions.PerformImeAction) +fun hasPerformImeAction() = hasKey(SemanticsActions.OnImeAction) /** * Returns whether the node defines a semantics action to request focus. diff --git a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TextActions.kt b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TextActions.kt index 9cdb6fc15ae..53c81a7cc87 100644 --- a/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TextActions.kt +++ b/compose/ui/ui-test/src/commonMain/kotlin/androidx/compose/ui/test/TextActions.kt @@ -17,11 +17,11 @@ package androidx.compose.ui.test import androidx.compose.ui.semantics.SemanticsActions -import androidx.compose.ui.semantics.SemanticsActions.PerformImeAction +import androidx.compose.ui.semantics.SemanticsActions.OnImeAction import androidx.compose.ui.semantics.SemanticsNode import androidx.compose.ui.semantics.SemanticsProperties import androidx.compose.ui.semantics.SemanticsPropertyReceiver -import androidx.compose.ui.semantics.performImeAction +import androidx.compose.ui.semantics.onImeAction import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.TextRange import androidx.compose.ui.text.input.ImeAction @@ -76,12 +76,12 @@ fun SemanticsNodeInteraction.performTextReplacement(text: String) { * Sends to this node the IME action associated with it in a similar way to the IME. * * The node needs to define its IME action in semantics via - * [SemanticsPropertyReceiver.performImeAction]. + * [SemanticsPropertyReceiver.onImeAction]. * * @throws AssertionError if the node does not support input or does not define IME action. * @throws IllegalStateException if the node did is not an editor or would not be able to establish * an input connection (e.g. does not define [ImeAction][SemanticsProperties.ImeAction] or - * [PerformImeAction] or is not focused). + * [OnImeAction] or is not focused). */ fun SemanticsNodeInteraction.performImeAction() { val errorOnFail = "Failed to perform IME action." @@ -90,7 +90,7 @@ fun SemanticsNodeInteraction.performImeAction() { val node = getNodeAndFocus(errorOnFail) wrapAssertionErrorsWithNodeInfo(selector, node) { - performSemanticsAction(PerformImeAction) { + performSemanticsAction(OnImeAction) { assert(it()) { buildGeneralErrorMessage( "Failed to perform IME action, handler returned false.", diff --git a/compose/ui/ui/api/current.ignore b/compose/ui/ui/api/current.ignore index 667ad90a219..08714b502b9 100644 --- a/compose/ui/ui/api/current.ignore +++ b/compose/ui/ui/api/current.ignore @@ -5,3 +5,9 @@ ChangedType: androidx.compose.ui.draw.DrawModifierKt#CacheDrawModifierNode(kotli RemovedInterface: androidx.compose.ui.node.CacheDrawModifierNode: Removed class androidx.compose.ui.node.CacheDrawModifierNode + + +RemovedMethod: androidx.compose.ui.semantics.SemanticsActions#getPerformImeAction(): + Removed method androidx.compose.ui.semantics.SemanticsActions.getPerformImeAction() +RemovedMethod: androidx.compose.ui.semantics.SemanticsPropertiesKt#performImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver, int, String, kotlin.jvm.functions.Function0<java.lang.Boolean>): + Removed method androidx.compose.ui.semantics.SemanticsPropertiesKt.performImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver,int,String,kotlin.jvm.functions.Function0<java.lang.Boolean>) diff --git a/compose/ui/ui/api/current.txt b/compose/ui/ui/api/current.txt index 275893fddbe..201b1036153 100644 --- a/compose/ui/ui/api/current.txt +++ b/compose/ui/ui/api/current.txt @@ -2854,13 +2854,13 @@ package androidx.compose.ui.semantics { method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.util.List<androidx.compose.ui.text.TextLayoutResult>,java.lang.Boolean>>> getGetTextLayoutResult(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<androidx.compose.ui.text.AnnotatedString,java.lang.Boolean>>> getInsertTextAtCursor(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick(); + method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnImeAction(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnLongClick(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageDown(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageLeft(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageRight(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageUp(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPasteText(); - method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPerformImeAction(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getRequestFocus(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Integer,java.lang.Boolean>>> getScrollToIndex(); @@ -2876,13 +2876,13 @@ package androidx.compose.ui.semantics { property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.util.List<androidx.compose.ui.text.TextLayoutResult>,java.lang.Boolean>>> GetTextLayoutResult; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<androidx.compose.ui.text.AnnotatedString,java.lang.Boolean>>> InsertTextAtCursor; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick; + property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnImeAction; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnLongClick; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageDown; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageLeft; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageRight; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageUp; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PasteText; - property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PerformImeAction; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> RequestFocus; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Integer,java.lang.Boolean>>> ScrollToIndex; @@ -3068,6 +3068,7 @@ package androidx.compose.ui.semantics { method @Deprecated public static boolean isContainer(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static boolean isTraversalGroup(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static void onClick(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); + method public static void onImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver, int imeActionType, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void onLongClick(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void pageDown(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void pageLeft(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); @@ -3075,7 +3076,6 @@ package androidx.compose.ui.semantics { method public static void pageUp(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void password(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static void pasteText(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); - method public static void performImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver, int imeActionType, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void popup(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static void requestFocus(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void scrollBy(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean>? action); diff --git a/compose/ui/ui/api/restricted_current.ignore b/compose/ui/ui/api/restricted_current.ignore index 667ad90a219..08714b502b9 100644 --- a/compose/ui/ui/api/restricted_current.ignore +++ b/compose/ui/ui/api/restricted_current.ignore @@ -5,3 +5,9 @@ ChangedType: androidx.compose.ui.draw.DrawModifierKt#CacheDrawModifierNode(kotli RemovedInterface: androidx.compose.ui.node.CacheDrawModifierNode: Removed class androidx.compose.ui.node.CacheDrawModifierNode + + +RemovedMethod: androidx.compose.ui.semantics.SemanticsActions#getPerformImeAction(): + Removed method androidx.compose.ui.semantics.SemanticsActions.getPerformImeAction() +RemovedMethod: androidx.compose.ui.semantics.SemanticsPropertiesKt#performImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver, int, String, kotlin.jvm.functions.Function0<java.lang.Boolean>): + Removed method androidx.compose.ui.semantics.SemanticsPropertiesKt.performImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver,int,String,kotlin.jvm.functions.Function0<java.lang.Boolean>) diff --git a/compose/ui/ui/api/restricted_current.txt b/compose/ui/ui/api/restricted_current.txt index 56a91ab54fa..d1df63f1bd0 100644 --- a/compose/ui/ui/api/restricted_current.txt +++ b/compose/ui/ui/api/restricted_current.txt @@ -2903,13 +2903,13 @@ package androidx.compose.ui.semantics { method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.util.List<androidx.compose.ui.text.TextLayoutResult>,java.lang.Boolean>>> getGetTextLayoutResult(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<androidx.compose.ui.text.AnnotatedString,java.lang.Boolean>>> getInsertTextAtCursor(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnClick(); + method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnImeAction(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getOnLongClick(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageDown(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageLeft(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageRight(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPageUp(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPasteText(); - method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getPerformImeAction(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> getRequestFocus(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> getScrollBy(); method public androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Integer,java.lang.Boolean>>> getScrollToIndex(); @@ -2925,13 +2925,13 @@ package androidx.compose.ui.semantics { property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.util.List<androidx.compose.ui.text.TextLayoutResult>,java.lang.Boolean>>> GetTextLayoutResult; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<androidx.compose.ui.text.AnnotatedString,java.lang.Boolean>>> InsertTextAtCursor; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnClick; + property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnImeAction; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> OnLongClick; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageDown; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageLeft; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageRight; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PageUp; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PasteText; - property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> PerformImeAction; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function0<java.lang.Boolean>>> RequestFocus; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function2<java.lang.Float,java.lang.Float,java.lang.Boolean>>> ScrollBy; property public final androidx.compose.ui.semantics.SemanticsPropertyKey<androidx.compose.ui.semantics.AccessibilityAction<kotlin.jvm.functions.Function1<java.lang.Integer,java.lang.Boolean>>> ScrollToIndex; @@ -3117,6 +3117,7 @@ package androidx.compose.ui.semantics { method @Deprecated public static boolean isContainer(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static boolean isTraversalGroup(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static void onClick(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); + method public static void onImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver, int imeActionType, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void onLongClick(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void pageDown(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void pageLeft(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); @@ -3124,7 +3125,6 @@ package androidx.compose.ui.semantics { method public static void pageUp(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void password(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static void pasteText(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); - method public static void performImeAction(androidx.compose.ui.semantics.SemanticsPropertyReceiver, int imeActionType, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void popup(androidx.compose.ui.semantics.SemanticsPropertyReceiver); method public static void requestFocus(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function0<java.lang.Boolean>? action); method public static void scrollBy(androidx.compose.ui.semantics.SemanticsPropertyReceiver, optional String? label, kotlin.jvm.functions.Function2<? super java.lang.Float,? super java.lang.Float,java.lang.Boolean>? action); diff --git a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/text/input/PlatformTextInputEditTextIntegrationTest.kt b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/text/input/PlatformTextInputEditTextIntegrationTest.kt index 706dc6d3dd5..871c398f21f 100644 --- a/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/text/input/PlatformTextInputEditTextIntegrationTest.kt +++ b/compose/ui/ui/src/androidAndroidTest/kotlin/androidx/compose/ui/text/input/PlatformTextInputEditTextIntegrationTest.kt @@ -28,7 +28,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalPlatformTextInputPluginRegistry import androidx.compose.ui.platform.testTag import androidx.compose.ui.semantics.insertTextAtCursor -import androidx.compose.ui.semantics.performImeAction +import androidx.compose.ui.semantics.onImeAction import androidx.compose.ui.semantics.requestFocus import androidx.compose.ui.semantics.semantics import androidx.compose.ui.semantics.setSelection @@ -195,7 +195,7 @@ class PlatformTextInputEditTextIntegrationTest { } return@setSelection false } - performImeAction(ImeAction.Go) { + onImeAction(ImeAction.Go) { editText.onEditorAction(ExpectedActionCode) true } diff --git a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt index 9b7055892da..4c0127e1c87 100644 --- a/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt +++ b/compose/ui/ui/src/androidMain/kotlin/androidx/compose/ui/platform/AndroidComposeViewAccessibilityDelegateCompat.android.kt @@ -96,7 +96,6 @@ import androidx.core.view.accessibility.AccessibilityEventCompat import androidx.core.view.accessibility.AccessibilityNodeInfoCompat import androidx.core.view.accessibility.AccessibilityNodeInfoCompat.AccessibilityActionCompat import androidx.core.view.accessibility.AccessibilityNodeProviderCompat -import androidx.core.view.children import androidx.core.view.contentcapture.ContentCaptureSessionCompat import androidx.lifecycle.Lifecycle import kotlin.math.abs @@ -949,7 +948,7 @@ internal class AndroidComposeViewAccessibilityDelegateCompat(val view: AndroidCo ) } - semanticsNode.unmergedConfig.getOrNull(SemanticsActions.PerformImeAction)?.let { + semanticsNode.unmergedConfig.getOrNull(SemanticsActions.OnImeAction)?.let { info.addAction( AccessibilityActionCompat( android.R.id.accessibilityActionImeEnter, @@ -1809,7 +1808,7 @@ internal class AndroidComposeViewAccessibilityDelegateCompat(val view: AndroidCo } android.R.id.accessibilityActionImeEnter -> { - return node.unmergedConfig.getOrNull(SemanticsActions.PerformImeAction) + return node.unmergedConfig.getOrNull(SemanticsActions.OnImeAction) ?.action?.invoke() ?: false } diff --git a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt index b967ae84bae..f9b259ac50b 100644 --- a/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt +++ b/compose/ui/ui/src/commonMain/kotlin/androidx/compose/ui/semantics/SemanticsProperties.kt @@ -212,7 +212,7 @@ object SemanticsProperties { val TextSelectionRange = SemanticsPropertyKey<TextRange>("TextSelectionRange") /** - * @see SemanticsPropertyReceiver.performImeAction + * @see SemanticsPropertyReceiver.onImeAction */ val ImeAction = SemanticsPropertyKey<ImeAction>("ImeAction") @@ -298,9 +298,9 @@ object SemanticsActions { val InsertTextAtCursor = ActionPropertyKey<(AnnotatedString) -> Boolean>("InsertTextAtCursor") /** - * @see SemanticsPropertyReceiver.performImeAction + * @see SemanticsPropertyReceiver.onImeAction */ - val PerformImeAction = ActionPropertyKey<() -> Boolean>("PerformImeAction") + val OnImeAction = ActionPropertyKey<() -> Boolean>("PerformImeAction") /** * @see SemanticsPropertyReceiver.copyText @@ -928,11 +928,11 @@ var SemanticsPropertyReceiver.textSelectionRange by SemanticsProperties.TextSele * For example, "go to next form field" or "submit". * * A node that specifies an action should also specify a callback to perform the action via - * [performImeAction]. + * [onImeAction]. */ -@Deprecated("Pass the ImeAction to performImeAction instead.") -@get:Deprecated("Pass the ImeAction to performImeAction instead.") -@set:Deprecated("Pass the ImeAction to performImeAction instead.") +@Deprecated("Pass the ImeAction to onImeAction instead.") +@get:Deprecated("Pass the ImeAction to onImeAction instead.") +@set:Deprecated("Pass the ImeAction to onImeAction instead.") var SemanticsPropertyReceiver.imeAction by SemanticsProperties.ImeAction /** @@ -1119,18 +1119,18 @@ fun SemanticsPropertyReceiver.insertTextAtCursor( * * @param imeActionType The IME type, such as [ImeAction.Next] or [ImeAction.Search] * @param label Optional label for this action. - * @param action Action to be performed when [SemanticsActions.PerformImeAction] is called. + * @param action Action to be performed when [SemanticsActions.OnImeAction] is called. * * @see SemanticsProperties.ImeAction - * @see SemanticsActions.PerformImeAction + * @see SemanticsActions.OnImeAction */ -fun SemanticsPropertyReceiver.performImeAction( +fun SemanticsPropertyReceiver.onImeAction( imeActionType: ImeAction, label: String? = null, action: (() -> Boolean)? ) { this[SemanticsProperties.ImeAction] = imeActionType - this[SemanticsActions.PerformImeAction] = AccessibilityAction(label, action) + this[SemanticsActions.OnImeAction] = AccessibilityAction(label, action) } /** |