Fix accessibility issues with dialpad
Each dialpad key needs to manually have the "focusable" flag set so that
hovering and lift-to-type works properly.
The edittext containing digits needs to receive focus at least once in
order for it to report sendAccessibilityEventTypeViewTextChanged type events.
In JB-MR2, the ViewPager would automatically give focus to the dialpad
fragment when it was swiped into view, but now we have to manually give it
focus ourselves when the dialpad fragment is swiped into view.
Bug: 11067558
Change-Id: I56a1891b12d5ec7771a37e1f7c361242ebfe028d
diff --git a/res/layout/dialpad.xml b/res/layout/dialpad.xml
index ec850c9..bc910db 100644
--- a/res/layout/dialpad.xml
+++ b/res/layout/dialpad.xml
@@ -36,7 +36,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/one"
style="@style/DialtactsDialpadButtonStyle"
- android:clickable="true" >
+ android:clickable="true"
+ android:focusable="true" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
@@ -85,7 +86,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/star"
style="@style/DialtactsDialpadButtonStyle"
- android:clickable="true" >
+ android:clickable="true"
+ android:focusable="true" >
<TextView
android:id="@id/dialpad_key_number"
android:layout_width="wrap_content"
@@ -101,7 +103,8 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/pound"
style="@style/DialtactsDialpadButtonStyle"
- android:clickable="true" >
+ android:clickable="true"
+ android:focusable="true" >
<TextView
android:id="@id/dialpad_key_number"
android:layout_width="wrap_content"
diff --git a/res/layout/dialpad_key.xml b/res/layout/dialpad_key.xml
index 074e023..e87fde0 100644
--- a/res/layout/dialpad_key.xml
+++ b/res/layout/dialpad_key.xml
@@ -18,7 +18,8 @@
<com.android.dialer.dialpad.DialpadKeyButton
xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/DialtactsDialpadButtonStyle"
- android:clickable="true" >
+ android:clickable="true"
+ android:focusable="true" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="match_parent"
diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java
index bcf058b..9ebf112 100644
--- a/src/com/android/dialer/dialpad/DialpadFragment.java
+++ b/src/com/android/dialer/dialpad/DialpadFragment.java
@@ -1704,6 +1704,7 @@
activity.showSearchBar();
} else {
activity.hideSearchBar();
+ mDigits.requestFocus();
}
}