Merge "Make system dialogs' a11y events like Activity's" into pi-dev
This commit is contained in:
@@ -1380,6 +1380,15 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
|
|||||||
mHardwareLayout = HardwareUiLayout.get(mListView);
|
mHardwareLayout = HardwareUiLayout.get(mListView);
|
||||||
mHardwareLayout.setOutsideTouchListener(view -> dismiss());
|
mHardwareLayout.setOutsideTouchListener(view -> dismiss());
|
||||||
setTitle(R.string.global_actions);
|
setTitle(R.string.global_actions);
|
||||||
|
mListView.setAccessibilityDelegate(new View.AccessibilityDelegate() {
|
||||||
|
@Override
|
||||||
|
public boolean dispatchPopulateAccessibilityEvent(
|
||||||
|
View host, AccessibilityEvent event) {
|
||||||
|
// Populate the title here, just as Activity does
|
||||||
|
event.getText().add(mContext.getString(R.string.global_actions));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateList() {
|
private void updateList() {
|
||||||
|
|||||||
@@ -742,8 +742,11 @@ public class VolumeDialogImpl implements VolumeDialog {
|
|||||||
updateVolumeRowH(row);
|
updateVolumeRowH(row);
|
||||||
}
|
}
|
||||||
updateRingerH();
|
updateRingerH();
|
||||||
mWindow.setTitle(mContext.getString(R.string.volume_dialog_title,
|
mWindow.setTitle(composeWindowTitle());
|
||||||
getStreamLabelH(getActiveRow().ss)));
|
}
|
||||||
|
|
||||||
|
CharSequence composeWindowTitle() {
|
||||||
|
return mContext.getString(R.string.volume_dialog_title, getStreamLabelH(getActiveRow().ss));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateVolumeRowH(VolumeRow row) {
|
private void updateVolumeRowH(VolumeRow row) {
|
||||||
@@ -1213,6 +1216,13 @@ public class VolumeDialogImpl implements VolumeDialog {
|
|||||||
mAccessibilityMgr.removeCallback(mListener);
|
mAccessibilityMgr.removeCallback(mListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean dispatchPopulateAccessibilityEvent(View host, AccessibilityEvent event) {
|
||||||
|
// Activities populate their title here. Follow that example.
|
||||||
|
event.getText().add(composeWindowTitle());
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child,
|
public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child,
|
||||||
AccessibilityEvent event) {
|
AccessibilityEvent event) {
|
||||||
|
|||||||
Reference in New Issue
Block a user