mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Add multi-line flag to semantics (flutter/engine#9850)
This commit is contained in:
parent
0416e89591
commit
046005bf1f
@ -288,6 +288,7 @@ class SemanticsFlag {
|
||||
static const int _kHasToggledStateIndex = 1 << 16;
|
||||
static const int _kIsToggledIndex = 1 << 17;
|
||||
static const int _kHasImplicitScrollingIndex = 1 << 18;
|
||||
static const int _kIsMultilineIndex = 1 << 19;
|
||||
static const int _kIsReadOnlyIndex = 1 << 20;
|
||||
|
||||
const SemanticsFlag._(this.index);
|
||||
@ -386,6 +387,13 @@ class SemanticsFlag {
|
||||
/// is a password or contains other sensitive information.
|
||||
static const SemanticsFlag isObscured = SemanticsFlag._(_kIsObscuredIndex);
|
||||
|
||||
/// Whether the value of the semantics node is coming from a multi-line text
|
||||
/// field.
|
||||
///
|
||||
/// This is used for text fields to distinguish single-line text fields from
|
||||
/// multi-line ones.
|
||||
static const SemanticsFlag isMultiline = SemanticsFlag._(_kIsMultilineIndex);
|
||||
|
||||
/// Whether the semantics node is the root of a subtree for which a route name
|
||||
/// should be announced.
|
||||
///
|
||||
@ -512,6 +520,10 @@ class SemanticsFlag {
|
||||
_kHasToggledStateIndex: hasToggledState,
|
||||
_kIsToggledIndex: isToggled,
|
||||
_kHasImplicitScrollingIndex: hasImplicitScrolling,
|
||||
// TODO(mdebbar): Uncomment after both these PRs are landed:
|
||||
// - https://github.com/flutter/engine/pull/9850
|
||||
// - https://github.com/flutter/flutter/pull/36297
|
||||
// _kIsMultilineIndex: isMultiline,
|
||||
_kIsReadOnlyIndex: isReadOnly,
|
||||
};
|
||||
|
||||
@ -556,6 +568,8 @@ class SemanticsFlag {
|
||||
return 'SemanticsFlag.isToggled';
|
||||
case _kHasImplicitScrollingIndex:
|
||||
return 'SemanticsFlag.hasImplicitScrolling';
|
||||
case _kIsMultilineIndex:
|
||||
return 'SemanticsFlag.isMultiline';
|
||||
case _kIsReadOnlyIndex:
|
||||
return 'SemanticsFlag.isReadOnly';
|
||||
}
|
||||
|
||||
@ -69,6 +69,8 @@ enum class SemanticsFlags : int32_t {
|
||||
kHasToggledState = 1 << 16,
|
||||
kIsToggled = 1 << 17,
|
||||
kHasImplicitScrolling = 1 << 18,
|
||||
// The Dart API defines the following flag but it isn't used in iOS.
|
||||
// kIsMultiline = 1 << 19,
|
||||
kIsReadOnly = 1 << 20,
|
||||
};
|
||||
|
||||
|
||||
@ -1614,6 +1614,8 @@ public class AccessibilityBridge extends AccessibilityNodeProvider {
|
||||
HAS_TOGGLED_STATE(1 << 16),
|
||||
IS_TOGGLED(1 << 17),
|
||||
HAS_IMPLICIT_SCROLLING(1 << 18),
|
||||
// The Dart API defines the following flag but it isn't used in Android.
|
||||
// IS_MULTILINE(1 << 19);
|
||||
IS_READ_ONLY(1 << 20);
|
||||
|
||||
final int value;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user