diff options
author | Jon Miranda <jonmiranda@google.com> | 2017-06-13 12:29:21 -0700 |
---|---|---|
committer | Jonathan Miranda <jonmiranda@google.com> | 2017-06-19 18:08:52 +0000 |
commit | 7d18dd8f07151262cb7dcbb3f70f4d98d88f2fa0 (patch) | |
tree | 1f52d905975eaaebc7dacd4afd6816f7d11c4d05 /src/com/android/launcher3 | |
parent | 5098e36f010648faf7368718578431630e6585b3 (diff) | |
download | android_packages_apps_Trebuchet-7d18dd8f07151262cb7dcbb3f70f4d98d88f2fa0.tar.gz android_packages_apps_Trebuchet-7d18dd8f07151262cb7dcbb3f70f4d98d88f2fa0.tar.bz2 android_packages_apps_Trebuchet-7d18dd8f07151262cb7dcbb3f70f4d98d88f2fa0.zip |
Fix bug where TalkBack reads both folder name and hint.
In O, TalkBack reads both content description and the hint.
We clear the hint when the Folder is named so that TalkBack
only reads the Folder name.
Bug: 62557038
Change-Id: I222fef2e1ce4a0bc222f0ca7bfb2f24281907188
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r-- | src/com/android/launcher3/folder/Folder.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 93c9ea8e3..0e9d08d96 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -351,13 +351,14 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC @Override public boolean onBackKey() { - mFolderName.setHint(sHintText); // Convert to a string here to ensure that no other state associated with the text field // gets saved. String newTitle = mFolderName.getText().toString(); mInfo.setTitle(newTitle); mLauncher.getModelWriter().updateItemInDatabase(mInfo); + mFolderName.setHint(sDefaultFolderName.contentEquals(newTitle) ? sHintText : null); + Utilities.sendCustomAccessibilityEvent( this, AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED, getContext().getString(R.string.folder_renamed, newTitle)); @@ -454,8 +455,10 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC if (!sDefaultFolderName.contentEquals(mInfo.title)) { mFolderName.setText(mInfo.title); + mFolderName.setHint(null); } else { mFolderName.setText(""); + mFolderName.setHint(sHintText); } // In case any children didn't come across during loading, clean up the folder accordingly |