summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-09-05 18:25:48 -0700
committerYorke Lee <yorkelee@google.com>2013-09-05 18:30:50 -0700
commitc45baecabd157ee8e9ce75791e1afe4c702c25a8 (patch)
treec75a942ed3c0d020a724470bf8bd65ed62fdace1 /src
parent6276f093cf16a4797f43d53a76e3a8e5a279ea22 (diff)
Fix accessibility issues with dialpad
Bug: 10314426 Change-Id: Ieecb5cc64ce93fb8457ed0cab0d054b5a1b1586c
Diffstat (limited to 'src')
-rw-r--r--src/com/android/dialer/dialpad/DialpadFragment.java29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index 79e830730..361f60d75 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -57,6 +57,7 @@ import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
+import android.view.MotionEvent;
import android.view.View;
import android.view.ViewConfiguration;
import android.view.ViewGroup;
@@ -136,6 +137,30 @@ public class DialpadFragment extends Fragment
}
}
+ /**
+ * LinearLayout that always returns true for onHoverEvent callbacks, to fix
+ * problems with accessibility due to the dialpad overlaying other fragments.
+ */
+ public static class HoverIgnoringLinearLayout extends LinearLayout {
+
+ public HoverIgnoringLinearLayout(Context context) {
+ super(context);
+ }
+
+ public HoverIgnoringLinearLayout(Context context, AttributeSet attrs) {
+ super(context, attrs);
+ }
+
+ public HoverIgnoringLinearLayout(Context context, AttributeSet attrs, int defStyle) {
+ super(context, attrs, defStyle);
+ }
+
+ @Override
+ public boolean onHoverEvent(MotionEvent event) {
+ return true;
+ }
+ }
+
public interface OnDialpadQueryChangedListener {
void onDialpadQueryChanged(String query);
}
@@ -611,7 +636,9 @@ public class DialpadFragment extends Fragment
dialpadKey.setOnPressedListener(this);
numberView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_number);
lettersView = (TextView) dialpadKey.findViewById(R.id.dialpad_key_letters);
- numberView.setText(resources.getString(numberIds[i]));
+ final String numberString = resources.getString(numberIds[i]);
+ numberView.setText(numberString);
+ dialpadKey.setContentDescription(numberString);
if (lettersView != null) {
lettersView.setText(resources.getString(letterIds[i]));
}