summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Burkhardt <caseyburkhardt@google.com>2013-05-01 19:33:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-05-01 19:33:08 +0000
commite85691176261baca50aff1284c01880dc2188a81 (patch)
treef58d865213765d49a89b061eceb13c541e4c5ff6
parent033168b1b0e6fc24a01bef6ec65948663f0ad3b7 (diff)
parent23b0a4e90554cc47f5ec1cef6b15ce0e32bb1ff2 (diff)
downloadframeworks_base-e85691176261baca50aff1284c01880dc2188a81.zip
frameworks_base-e85691176261baca50aff1284c01880dc2188a81.tar.gz
frameworks_base-e85691176261baca50aff1284c01880dc2188a81.tar.bz2
Merge "Properly populates AccessibilityEvents for notification and quick settings shades" into jb-mr2-dev
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java14
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java16
2 files changed, 25 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
index ff36485..f33dc20 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java
@@ -25,6 +25,7 @@ import android.util.EventLog;
import android.util.Slog;
import android.view.MotionEvent;
import android.view.View;
+import android.view.accessibility.AccessibilityEvent;
import com.android.systemui.EventLogTags;
import com.android.systemui.R;
@@ -56,8 +57,6 @@ public class NotificationPanelView extends PanelView {
mHandleBar = resources.getDrawable(R.drawable.status_bar_close);
mHandleBarHeight = resources.getDimensionPixelSize(R.dimen.close_handle_height);
mHandleView = findViewById(R.id.handle);
-
- setContentDescription(resources.getString(R.string.accessibility_desc_notification_shade));
}
@Override
@@ -71,6 +70,17 @@ public class NotificationPanelView extends PanelView {
super.fling(vel, always);
}
+ @Override
+ public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
+ if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
+ event.getText()
+ .add(getContext().getString(R.string.accessibility_desc_notification_shade));
+ return true;
+ }
+
+ return super.dispatchPopulateAccessibilityEvent(event);
+ }
+
// We draw the handle ourselves so that it's always glued to the bottom of the window.
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java
index 2314d93..3333563 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java
@@ -28,6 +28,7 @@ import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
+import android.view.accessibility.AccessibilityEvent;
import com.android.systemui.EventLogTags;
import com.android.systemui.R;
@@ -62,10 +63,8 @@ public class SettingsPanelView extends PanelView {
mHandleBar = resources.getDrawable(R.drawable.status_bar_close);
mHandleBarHeight = resources.getDimensionPixelSize(R.dimen.close_handle_height);
mHandleView = findViewById(R.id.handle);
-
- setContentDescription(resources.getString(R.string.accessibility_desc_quick_settings));
}
-
+
public void setQuickSettings(QuickSettings qs) {
mQS = qs;
}
@@ -120,6 +119,17 @@ public class SettingsPanelView extends PanelView {
}
}
+ @Override
+ public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
+ if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
+ event.getText()
+ .add(getContext().getString(R.string.accessibility_desc_quick_settings));
+ return true;
+ }
+
+ return super.dispatchPopulateAccessibilityEvent(event);
+ }
+
// We draw the handle ourselves so that it's always glued to the bottom of the window.
@Override
protected void onLayout(boolean changed, int left, int top, int right, int bottom) {