Skip to content

Commit

Permalink
Rename isPassword to isObscured (flutter#4815)
Browse files Browse the repository at this point in the history
  • Loading branch information
goderbauer authored Mar 19, 2018
1 parent bb2d177 commit c3ab0c9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions lib/ui/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class SemanticsFlag {
static const int _kIsEnabledIndex = 1 << 7;
static const int _kIsInMutuallyExclusiveGroupIndex = 1 << 8;
static const int _kIsHeaderIndex = 1 << 9;
static const int _kIsPasswordIndex = 1 << 10;
static const int _kIsObscuredIndex = 1 << 10;

const SemanticsFlag._(this.index);

Expand Down Expand Up @@ -301,11 +301,11 @@ class SemanticsFlag {
/// address book applications.
static const SemanticsFlag isHeader = const SemanticsFlag._(_kIsHeaderIndex);

/// Whether the semantics node represents a password.
/// Whether the value of the semantics node is obscured.
///
/// This is usually used for text fields to indicate that the content should
/// be obscured.
static const SemanticsFlag isPassword = const SemanticsFlag._(_kIsPasswordIndex);
/// This is usually used for text fields to indicate that its content
/// is a password or contains other sensitive information.
static const SemanticsFlag isObscured = const SemanticsFlag._(_kIsObscuredIndex);

/// The possible semantics flags.
///
Expand All @@ -321,7 +321,7 @@ class SemanticsFlag {
_kIsEnabledIndex: isEnabled,
_kIsInMutuallyExclusiveGroupIndex: isInMutuallyExclusiveGroup,
_kIsHeaderIndex: isHeader,
_kIsPasswordIndex: isPassword,
_kIsObscuredIndex: isObscured,
};

@override
Expand All @@ -347,8 +347,8 @@ class SemanticsFlag {
return 'SemanticsFlag.isInMutuallyExclusiveGroup';
case _kIsHeaderIndex:
return 'SemanticsFlag.isHeader';
case _kIsPasswordIndex:
return 'SemanticsFlag.isPassword';
case _kIsObscuredIndex:
return 'SemanticsFlag.isObscured';
}
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ enum Flag {
IS_ENABLED(1 << 7),
IS_IN_MUTUALLY_EXCLUSIVE_GROUP(1 << 8),
IS_HEADER(1 << 9),
IS_PASSWORD(1 << 10);
IS_OBSCURED(1 << 10);

Flag(int value) {
this.value = value;
Expand Down Expand Up @@ -138,7 +138,7 @@ public AccessibilityNodeInfo createAccessibilityNodeInfo(int virtualViewId) {
result.setAccessibilityFocused(mA11yFocusedObject.id == virtualViewId);

if (object.hasFlag(Flag.IS_TEXT_FIELD)) {
result.setPassword(object.hasFlag(Flag.IS_PASSWORD));
result.setPassword(object.hasFlag(Flag.IS_OBSCURED));
result.setClassName("android.widget.EditText");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
result.setEditable(true);
Expand Down

0 comments on commit c3ab0c9

Please sign in to comment.