Merge "Properly populates AccessibilityEvents for notification and quick settings shades" into jb-mr2-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
e856911762
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user