Merge "Fix volume talkback issues." into sc-dev
This commit is contained in:
@@ -59,7 +59,7 @@
|
|||||||
android:id="@+id/volume_drawer_vibrate"
|
android:id="@+id/volume_drawer_vibrate"
|
||||||
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:description="@string/volume_ringer_hint_vibrate"
|
android:contentDescription="@string/volume_ringer_hint_vibrate"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -76,7 +76,7 @@
|
|||||||
android:id="@+id/volume_drawer_mute"
|
android:id="@+id/volume_drawer_mute"
|
||||||
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:description="@string/volume_ringer_hint_mute"
|
android:contentDescription="@string/volume_ringer_hint_mute"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -93,7 +93,7 @@
|
|||||||
android:id="@+id/volume_drawer_normal"
|
android:id="@+id/volume_drawer_normal"
|
||||||
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:description="@string/volume_ringer_hint_unmute"
|
android:contentDescription="@string/volume_ringer_hint_unmute"
|
||||||
android:gravity="center">
|
android:gravity="center">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
@@ -117,7 +117,7 @@
|
|||||||
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
android:layout_width="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
android:layout_height="@dimen/volume_ringer_drawer_item_size"
|
||||||
android:layout_gravity="bottom|right"
|
android:layout_gravity="bottom|right"
|
||||||
android:description="@string/volume_ringer_change"
|
android:contentDescription="@string/volume_ringer_change"
|
||||||
android:background="@drawable/volume_drawer_selection_bg">
|
android:background="@drawable/volume_drawer_selection_bg">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|||||||
@@ -932,6 +932,13 @@ public class VolumeDialogImpl implements VolumeDialog,
|
|||||||
.start();
|
.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When the ringer drawer is open, tapping the currently selected ringer will set the ringer
|
||||||
|
// to the current ringer mode. Change the content description to that, instead of the 'tap
|
||||||
|
// to change ringer mode' default.
|
||||||
|
mSelectedRingerContainer.setContentDescription(
|
||||||
|
mContext.getString(getStringDescriptionResourceForRingerMode(
|
||||||
|
mState.ringerModeInternal)));
|
||||||
|
|
||||||
mIsRingerDrawerOpen = true;
|
mIsRingerDrawerOpen = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -976,6 +983,11 @@ public class VolumeDialogImpl implements VolumeDialog,
|
|||||||
.translationY(0f)
|
.translationY(0f)
|
||||||
.start();
|
.start();
|
||||||
|
|
||||||
|
// When the drawer is closed, tapping the selected ringer drawer will open it, allowing the
|
||||||
|
// user to change the ringer.
|
||||||
|
mSelectedRingerContainer.setContentDescription(
|
||||||
|
mContext.getString(R.string.volume_ringer_change));
|
||||||
|
|
||||||
mIsRingerDrawerOpen = false;
|
mIsRingerDrawerOpen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1464,20 +1476,8 @@ public class VolumeDialogImpl implements VolumeDialog,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addAccessibilityDescription(View view, int currState, String hintLabel) {
|
private void addAccessibilityDescription(View view, int currState, String hintLabel) {
|
||||||
int currStateResId;
|
view.setContentDescription(
|
||||||
switch (currState) {
|
mContext.getString(getStringDescriptionResourceForRingerMode(currState)));
|
||||||
case RINGER_MODE_SILENT:
|
|
||||||
currStateResId = R.string.volume_ringer_status_silent;
|
|
||||||
break;
|
|
||||||
case RINGER_MODE_VIBRATE:
|
|
||||||
currStateResId = R.string.volume_ringer_status_vibrate;
|
|
||||||
break;
|
|
||||||
case RINGER_MODE_NORMAL:
|
|
||||||
default:
|
|
||||||
currStateResId = R.string.volume_ringer_status_normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
view.setContentDescription(mContext.getString(currStateResId));
|
|
||||||
view.setAccessibilityDelegate(new AccessibilityDelegate() {
|
view.setAccessibilityDelegate(new AccessibilityDelegate() {
|
||||||
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
|
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
|
||||||
super.onInitializeAccessibilityNodeInfo(host, info);
|
super.onInitializeAccessibilityNodeInfo(host, info);
|
||||||
@@ -1487,6 +1487,18 @@ public class VolumeDialogImpl implements VolumeDialog,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int getStringDescriptionResourceForRingerMode(int mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case RINGER_MODE_SILENT:
|
||||||
|
return R.string.volume_ringer_status_silent;
|
||||||
|
case RINGER_MODE_VIBRATE:
|
||||||
|
return R.string.volume_ringer_status_vibrate;
|
||||||
|
case RINGER_MODE_NORMAL:
|
||||||
|
default:
|
||||||
|
return R.string.volume_ringer_status_normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Toggles enable state of views in a VolumeRow (not including seekbar or icon)
|
* Toggles enable state of views in a VolumeRow (not including seekbar or icon)
|
||||||
* Hides/shows zen icon
|
* Hides/shows zen icon
|
||||||
|
|||||||
Reference in New Issue
Block a user