From 3dd981af8905339d7b8421e3a633853868240d4d Mon Sep 17 00:00:00 2001 From: Qi Wang Date: Fri, 4 Mar 2016 13:50:40 -0800 Subject: Add talkback for long press and remove contact from starred list. The remove button will be announced when user hovers contact onto it or drop it. Bug: 25559343 Change-Id: I31f51f6d074d8b1721439e7a484e1e316cb006fe --- src/com/android/dialer/list/ListsFragment.java | 4 +--- src/com/android/dialer/list/RemoveView.java | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/com/android/dialer/list/ListsFragment.java b/src/com/android/dialer/list/ListsFragment.java index 5b7c950bf..2020934cb 100644 --- a/src/com/android/dialer/list/ListsFragment.java +++ b/src/com/android/dialer/list/ListsFragment.java @@ -80,7 +80,6 @@ public class ListsFragment extends Fragment private ViewPagerTabs mViewPagerTabs; private ViewPagerAdapter mViewPagerAdapter; private RemoveView mRemoveView; - private View mRemoveViewContent; private SpeedDialFragment mSpeedDialFragment; private CallLogFragment mHistoryFragment; @@ -230,7 +229,6 @@ public class ListsFragment extends Fragment addOnPageChangeListener(mViewPagerTabs); mRemoveView = (RemoveView) parentView.findViewById(R.id.remove_view); - mRemoveViewContent = parentView.findViewById(R.id.remove_view_content); Trace.endSection(); Trace.endSection(); @@ -401,7 +399,7 @@ public class ListsFragment extends Fragment public void showRemoveView(boolean show) { - mRemoveViewContent.setVisibility(show ? View.VISIBLE : View.GONE); + mRemoveView.setVisibility(show ? View.VISIBLE : View.GONE); mRemoveView.setAlpha(show ? 0 : 1); mRemoveView.animate().alpha(show ? 1 : 0).start(); } diff --git a/src/com/android/dialer/list/RemoveView.java b/src/com/android/dialer/list/RemoveView.java index fdb08f6f5..41f41752e 100644 --- a/src/com/android/dialer/list/RemoveView.java +++ b/src/com/android/dialer/list/RemoveView.java @@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable; import android.util.AttributeSet; import android.util.Log; import android.view.DragEvent; +import android.view.accessibility.AccessibilityEvent; import android.widget.FrameLayout; import android.widget.ImageView; import android.widget.LinearLayout; @@ -53,6 +54,9 @@ public class RemoveView extends FrameLayout { final int action = event.getAction(); switch (action) { case DragEvent.ACTION_DRAG_ENTERED: + // TODO: This is temporary solution and should be removed once accessibility for + // drag and drop is supported by framework(b/26871588). + sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT); setAppearanceHighlighted(); break; case DragEvent.ACTION_DRAG_EXITED: @@ -65,6 +69,7 @@ public class RemoveView extends FrameLayout { } break; case DragEvent.ACTION_DROP: + sendAccessibilityEvent(AccessibilityEvent.TYPE_ANNOUNCEMENT); if (mDragDropController != null) { mDragDropController.handleDragFinished((int) event.getX(), (int) event.getY(), true); -- cgit v1.2.3