diff options
author | Justin Klaassen <justinklaassen@google.com> | 2015-06-08 15:27:55 -0700 |
---|---|---|
committer | Justin Klaassen <justinklaassen@google.com> | 2015-06-08 16:44:55 -0700 |
commit | 3d7653e2ab78354de794f893fc8921d9f2a23226 (patch) | |
tree | d952a214ed6d17be55e7873e5a7651c246183dca /src | |
parent | 41c66a9ef9ac72fcb1dd0047c364a04c0f86044c (diff) | |
download | android_packages_apps_ExactCalculator-3d7653e2ab78354de794f893fc8921d9f2a23226.tar.gz android_packages_apps_ExactCalculator-3d7653e2ab78354de794f893fc8921d9f2a23226.tar.bz2 android_packages_apps_ExactCalculator-3d7653e2ab78354de794f893fc8921d9f2a23226.zip |
Prevent clicks through the visible pad
Bug: 21706513
Change-Id: I4646cd1d9a2d67e6e8241ecbb5b960b440c458d2
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/calculator2/CalculatorPadViewPager.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/com/android/calculator2/CalculatorPadViewPager.java b/src/com/android/calculator2/CalculatorPadViewPager.java index c915f25..d4520c5 100644 --- a/src/com/android/calculator2/CalculatorPadViewPager.java +++ b/src/com/android/calculator2/CalculatorPadViewPager.java @@ -58,9 +58,13 @@ public class CalculatorPadViewPager extends ViewPager { @Override public void onPageSelected(int position) { for (int i = getChildCount() - 1; i >= 0; --i) { - getChildAt(i).setImportantForAccessibility(i == position + final View child = getChildAt(i); + // Prevent clicks and accessibility focus from going through to descendants of + // other pages which are covered by the current page. + child.setClickable(i == position); + child.setImportantForAccessibility(i == position ? IMPORTANT_FOR_ACCESSIBILITY_AUTO - : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS) ; + : IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS); } } }; |