From 2a422f719b70f6c292b954fb24f324b7f4ac1858 Mon Sep 17 00:00:00 2001 From: yueg Date: Wed, 24 Jan 2018 15:20:10 -0800 Subject: Bubble v2 a11y. - Set checkable for bubble buttons so the check status of non checkable button (back to call, end call) is not read. - Add support for bottom action buttons. Test: manual PiperOrigin-RevId: 183150371 Change-Id: Ifae9c912ec923e8d2cda3146413138bd2eb94b47 --- java/com/android/newbubble/BottomActionViewController.java | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'java/com/android/newbubble/BottomActionViewController.java') diff --git a/java/com/android/newbubble/BottomActionViewController.java b/java/com/android/newbubble/BottomActionViewController.java index 04e0e5fe7..b480ac986 100644 --- a/java/com/android/newbubble/BottomActionViewController.java +++ b/java/com/android/newbubble/BottomActionViewController.java @@ -23,6 +23,7 @@ import android.view.LayoutInflater; import android.view.View; import android.view.WindowManager; import android.view.WindowManager.LayoutParams; +import android.view.accessibility.AccessibilityEvent; import android.view.animation.LinearInterpolator; /** Controller for showing and hiding bubble bottom action view. */ @@ -157,10 +158,14 @@ final class BottomActionViewController { // Scale unhighlight target back to 1x if (!shouldHighlightDismiss && dismissHighlighted) { + // A11y + dismissView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_HOVER_EXIT); // Unhighlight dismiss dismissView.animate().scaleX(1f).scaleY(1f).setDuration(HIGHLIGHT_TARGET_DURATION).start(); dismissHighlighted = false; } else if (!shouldHighlightEndCall && endCallHighlighted) { + // A11y + endCallView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_HOVER_EXIT); // Unhighlight end call endCallView.animate().scaleX(1f).scaleY(1f).setDuration(HIGHLIGHT_TARGET_DURATION).start(); endCallHighlighted = false; @@ -168,6 +173,8 @@ final class BottomActionViewController { // Scale highlight target larger if (shouldHighlightDismiss && !dismissHighlighted) { + // A11y + dismissView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_HOVER_ENTER); // Highlight dismiss dismissView.setPivotY(dismissView.getHeight() / 2 + textOffsetSize); dismissView @@ -184,6 +191,8 @@ final class BottomActionViewController { .start(); dismissHighlighted = true; } else if (shouldHighlightEndCall && !endCallHighlighted) { + // A11y + endCallView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_HOVER_ENTER); // Highlight end call endCallView.setPivotY(dismissView.getHeight() / 2 + textOffsetSize); endCallView -- cgit v1.2.3