diff --git a/lib/ui/semantics.dart b/lib/ui/semantics.dart index f5104ed3c1e62..39605af70dbc0 100644 --- a/lib/ui/semantics.dart +++ b/lib/ui/semantics.dart @@ -399,7 +399,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { String increasedValue, String decreasedValue, TextDirection textDirection, - int nextNodeId, + int previousNodeId, Float64List transform, Int32List children, }) { @@ -423,7 +423,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { increasedValue, decreasedValue, textDirection != null ? textDirection.index + 1 : 0, - nextNodeId ?? -1, + previousNodeId ?? -1, transform, children,); } @@ -446,7 +446,7 @@ class SemanticsUpdateBuilder extends NativeFieldWrapperClass2 { String increasedValue, String decreasedValue, int textDirection, - int nextNodeId, + int previousNodeId, Float64List transform, Int32List children, ) native 'SemanticsUpdateBuilder_updateNode'; diff --git a/lib/ui/semantics/semantics_node.h b/lib/ui/semantics/semantics_node.h index c69fb20268070..56156e7a18cf3 100644 --- a/lib/ui/semantics/semantics_node.h +++ b/lib/ui/semantics/semantics_node.h @@ -76,7 +76,7 @@ struct SemanticsNode { std::string increasedValue; std::string decreasedValue; int32_t textDirection = 0; // 0=unknown, 1=rtl, 2=ltr - int32_t nextNodeId = -1; + int32_t previousNodeId = -1; SkRect rect = SkRect::MakeEmpty(); SkMatrix44 transform = SkMatrix44(SkMatrix44::kIdentity_Constructor); diff --git a/lib/ui/semantics/semantics_update_builder.cc b/lib/ui/semantics/semantics_update_builder.cc index 0fc0cc42afff3..be9aae1bda4f9 100644 --- a/lib/ui/semantics/semantics_update_builder.cc +++ b/lib/ui/semantics/semantics_update_builder.cc @@ -52,7 +52,7 @@ void SemanticsUpdateBuilder::updateNode(int id, std::string increasedValue, std::string decreasedValue, int textDirection, - int nextNodeId, + int previousNodeId, const tonic::Float64List& transform, const tonic::Int32List& children) { SemanticsNode node; @@ -71,7 +71,7 @@ void SemanticsUpdateBuilder::updateNode(int id, node.increasedValue = increasedValue; node.decreasedValue = decreasedValue; node.textDirection = textDirection; - node.nextNodeId = nextNodeId; + node.previousNodeId = previousNodeId; node.transform.setColMajord(transform.data()); node.children = std::vector( children.data(), children.data() + children.num_elements()); diff --git a/lib/ui/semantics/semantics_update_builder.h b/lib/ui/semantics/semantics_update_builder.h index 6ba1e601032bf..0f716f752802d 100644 --- a/lib/ui/semantics/semantics_update_builder.h +++ b/lib/ui/semantics/semantics_update_builder.h @@ -43,7 +43,7 @@ class SemanticsUpdateBuilder std::string increasedValue, std::string decreasedValue, int textDirection, - int nextNodeId, + int previousNodeId, const tonic::Float64List& transform, const tonic::Int32List& children); diff --git a/shell/platform/android/io/flutter/view/AccessibilityBridge.java b/shell/platform/android/io/flutter/view/AccessibilityBridge.java index 079135a34b49a..d644cb84934db 100644 --- a/shell/platform/android/io/flutter/view/AccessibilityBridge.java +++ b/shell/platform/android/io/flutter/view/AccessibilityBridge.java @@ -241,8 +241,8 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) { result.setSelected(object.hasFlag(Flag.IS_SELECTED)); result.setText(object.getValueLabelHint()); - result.setTraversalBefore(mOwner, - object.nextNodeId == -1 ? View.NO_ID : object.nextNodeId); + result.setTraversalAfter(mOwner, + object.previousNodeId == -1 ? View.NO_ID : object.previousNodeId); // Accessibility Focus if (mA11yFocusedObject != null && mA11yFocusedObject.id == virtualViewId) { @@ -693,7 +693,7 @@ private class SemanticsObject { String decreasedValue; String hint; TextDirection textDirection; - int nextNodeId; + int previousNodeId; boolean hadPreviousConfig = false; int previousFlags; @@ -746,7 +746,7 @@ boolean didScroll() { void log(String indent, boolean recursive) { Log.i(TAG, indent + "SemanticsObject id=" + id + " label=" + label + " actions=" + actions + " flags=" + flags + "\n" + indent + " +-- textDirection=" + textDirection + "\n"+ - indent + " +-- nextNodeId=" + nextNodeId + "\n"+ + indent + " +-- previousNodeId=" + previousNodeId + "\n"+ indent + " +-- rect.ltrb=(" + left + ", " + top + ", " + right + ", " + bottom + ")\n" + indent + " +-- transform=" + Arrays.toString(transform) + "\n"); if (children != null && recursive) { @@ -793,7 +793,7 @@ void updateWith(ByteBuffer buffer, String[] strings) { textDirection = TextDirection.fromInt(buffer.getInt()); - nextNodeId = buffer.getInt(); + previousNodeId = buffer.getInt(); left = buffer.getFloat(); top = buffer.getFloat(); diff --git a/shell/platform/android/platform_view_android.cc b/shell/platform/android/platform_view_android.cc index 7986737be907c..5fc7fab00bbdb 100644 --- a/shell/platform/android/platform_view_android.cc +++ b/shell/platform/android/platform_view_android.cc @@ -526,7 +526,7 @@ void PlatformViewAndroid::UpdateSemantics( strings.push_back(node.hint); } buffer_int32[position++] = node.textDirection; - buffer_int32[position++] = node.nextNodeId; + buffer_int32[position++] = node.previousNodeId; buffer_float32[position++] = node.rect.left(); buffer_float32[position++] = node.rect.top(); buffer_float32[position++] = node.rect.right();