am b611eb94
: Merge "Fix incorrect content description on action bar home/up" into klp-dev
* commit 'b611eb94e992390dde302124795e18f537aea017': Fix incorrect content description on action bar home/up
This commit is contained in:
@ -566,7 +566,11 @@ public class ActionBarView extends AbsActionBarView {
|
|||||||
mUpGoerFive.setEnabled(enable);
|
mUpGoerFive.setEnabled(enable);
|
||||||
mUpGoerFive.setFocusable(enable);
|
mUpGoerFive.setFocusable(enable);
|
||||||
// Make sure the home button has an accurate content description for accessibility.
|
// Make sure the home button has an accurate content description for accessibility.
|
||||||
if (!enable) {
|
updateHomeAccessibility(enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updateHomeAccessibility(boolean homeEnabled) {
|
||||||
|
if (!homeEnabled) {
|
||||||
mUpGoerFive.setContentDescription(null);
|
mUpGoerFive.setContentDescription(null);
|
||||||
mUpGoerFive.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
|
mUpGoerFive.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||||
} else {
|
} else {
|
||||||
@ -677,19 +681,7 @@ public class ActionBarView extends AbsActionBarView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure the home button has an accurate content description for accessibility.
|
// Make sure the home button has an accurate content description for accessibility.
|
||||||
if (!mHomeLayout.isEnabled()) {
|
updateHomeAccessibility(!mUpGoerFive.isEnabled());
|
||||||
mHomeLayout.setContentDescription(null);
|
|
||||||
mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
|
|
||||||
} else {
|
|
||||||
mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_AUTO);
|
|
||||||
if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
|
|
||||||
mHomeLayout.setContentDescription(mContext.getResources().getText(
|
|
||||||
R.string.action_bar_up_description));
|
|
||||||
} else {
|
|
||||||
mHomeLayout.setContentDescription(mContext.getResources().getText(
|
|
||||||
R.string.action_bar_home_description));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setIcon(Drawable icon) {
|
public void setIcon(Drawable icon) {
|
||||||
|
Reference in New Issue
Block a user