mHardwareLayout = HardwareUiLayout.get(mListView);
mHardwareLayout.setOutsideTouchListener(view -> dismiss());
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() {
updateVolumeRowH(row);
}
updateRingerH();
- mWindow.setTitle(mContext.getString(R.string.volume_dialog_title,
- getStreamLabelH(getActiveRow().ss)));
+ mWindow.setTitle(composeWindowTitle());
+ }
+
+ CharSequence composeWindowTitle() {
+ return mContext.getString(R.string.volume_dialog_title, getStreamLabelH(getActiveRow().ss));
}
private void updateVolumeRowH(VolumeRow row) {
}
@Override
+ public boolean dispatchPopulateAccessibilityEvent(View host, AccessibilityEvent event) {
+ // Activities populate their title here. Follow that example.
+ event.getText().add(composeWindowTitle());
+ return true;
+ }
+
+ @Override
public boolean onRequestSendAccessibilityEvent(ViewGroup host, View child,
AccessibilityEvent event) {
rescheduleTimeoutH();