Prevent clicks through the visible pad
Bug: 21706513
Change-Id: I4646cd1d9a2d67e6e8241ecbb5b960b440c458d2
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 @@
@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);
}
}
};