diff options
author | Michael Jurka <mikejurka@google.com> | 2012-10-04 17:42:38 +0200 |
---|---|---|
committer | Michael Jurka <mikejurka@google.com> | 2012-10-08 15:41:51 +0200 |
commit | 22143131770f7e90be4181e88ced0cb1d7158306 (patch) | |
tree | 2bc775598be2c7966b04c898432f8401c07fc82b /src/com/android/launcher2/Launcher.java | |
parent | 68255cbabe1cb7fbfc0706a8a2e1b1927eae1b55 (diff) | |
download | packages_apps_trebuchet-22143131770f7e90be4181e88ced0cb1d7158306.zip packages_apps_trebuchet-22143131770f7e90be4181e88ced0cb1d7158306.tar.gz packages_apps_trebuchet-22143131770f7e90be4181e88ced0cb1d7158306.tar.bz2 |
Fix bug 6886990: cling accessibility
Clings should block interaction with elements
below when Talkback is enabled
Change-Id: Ifdcd109351fd3c2d6dc97ad75ea3ab6eea48b582
Diffstat (limited to 'src/com/android/launcher2/Launcher.java')
-rw-r--r-- | src/com/android/launcher2/Launcher.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java index fedf324..64e382a 100644 --- a/src/com/android/launcher2/Launcher.java +++ b/src/com/android/launcher2/Launcher.java @@ -300,6 +300,9 @@ public final class Launcher extends Activity private BubbleTextView mWaitingForResume; + private HideFromAccessibilityHelper mHideFromAccessibilityHelper + = new HideFromAccessibilityHelper(); + private Runnable mBuildLayersRunnable = new Runnable() { public void run() { if (mWorkspace != null) { @@ -3662,8 +3665,9 @@ public final class Launcher extends Activity return true; } + private Cling initCling(int clingId, int[] positionData, boolean animate, int delay) { - Cling cling = (Cling) findViewById(clingId); + final Cling cling = (Cling) findViewById(clingId); if (cling != null) { cling.init(this, positionData); cling.setVisibility(View.VISIBLE); @@ -3680,11 +3684,21 @@ public final class Launcher extends Activity } else { cling.setAlpha(1f); } + cling.setFocusableInTouchMode(true); + cling.post(new Runnable() { + public void run() { + cling.setFocusable(true); + cling.requestFocus(); + } + }); + mHideFromAccessibilityHelper.setImportantForAccessibilityToNo( + mDragLayer, clingId == R.id.all_apps_cling); } return cling; } + private void dismissCling(final Cling cling, final String flag, int duration) { - if (cling != null) { + if (cling != null && cling.getVisibility() == View.VISIBLE) { ObjectAnimator anim = LauncherAnimUtils.ofFloat(cling, "alpha", 0f); anim.setDuration(duration); anim.addListener(new AnimatorListenerAdapter() { @@ -3702,8 +3716,10 @@ public final class Launcher extends Activity }; }); anim.start(); + mHideFromAccessibilityHelper.restoreImportantForAccessibility(mDragLayer); } } + private void removeCling(int id) { final View cling = findViewById(id); if (cling != null) { @@ -3714,6 +3730,7 @@ public final class Launcher extends Activity parent.removeView(cling); } }); + mHideFromAccessibilityHelper.restoreImportantForAccessibility(mDragLayer); } } |