From 949ddad1a2d23e3e9336891a551a19bd6b5dd0ed Mon Sep 17 00:00:00 2001 From: Alan Viverette Date: Thu, 19 Dec 2013 18:09:10 -0800 Subject: Support long-click during lift-to-type accessibility mode BUG: 8310727 Change-Id: Icf9e103d2d6f5b5e7acb8c7f16244f0cebe9ffaa --- .../android/dialer/dialpad/DialpadFragment.java | 10 ++- .../android/dialer/dialpad/DialpadKeyButton.java | 100 ++++++++++++++++++++- 2 files changed, 104 insertions(+), 6 deletions(-) (limited to 'src/com/android') diff --git a/src/com/android/dialer/dialpad/DialpadFragment.java b/src/com/android/dialer/dialpad/DialpadFragment.java index 9a23812be..0d2337819 100644 --- a/src/com/android/dialer/dialpad/DialpadFragment.java +++ b/src/com/android/dialer/dialpad/DialpadFragment.java @@ -662,10 +662,16 @@ public class DialpadFragment extends Fragment } // Long-pressing one button will initiate Voicemail. - fragmentView.findViewById(R.id.one).setOnLongClickListener(this); + final DialpadKeyButton one = (DialpadKeyButton) fragmentView.findViewById(R.id.one); + one.setOnLongClickListener(this); + one.setLongHoverContentDescription( + resources.getText(R.string.description_voicemail_button)); // Long-pressing zero button will enter '+' instead. - fragmentView.findViewById(R.id.zero).setOnLongClickListener(this); + final DialpadKeyButton zero = (DialpadKeyButton) fragmentView.findViewById(R.id.zero); + zero.setOnLongClickListener(this); + zero.setLongHoverContentDescription( + resources.getText(R.string.description_image_button_plus)); } diff --git a/src/com/android/dialer/dialpad/DialpadKeyButton.java b/src/com/android/dialer/dialpad/DialpadKeyButton.java index 9a20993d6..1d5104c06 100644 --- a/src/com/android/dialer/dialpad/DialpadKeyButton.java +++ b/src/com/android/dialer/dialpad/DialpadKeyButton.java @@ -22,6 +22,7 @@ import android.os.Bundle; import android.util.AttributeSet; import android.view.MotionEvent; import android.view.View; +import android.view.ViewConfiguration; import android.view.accessibility.AccessibilityEvent; import android.view.accessibility.AccessibilityManager; import android.view.accessibility.AccessibilityNodeInfo; @@ -30,16 +31,46 @@ import android.widget.FrameLayout; /** * Custom class for dialpad buttons. *

- * This class implements lift-to-type interaction when touch exploration is - * enabled. + * When touch exploration mode is enabled for accessibility, this class + * implements the lift-to-type interaction model: + *