am d8357cee: Merge "Sets accessibility importance for the home/up button. Bug: 7196985 Change-Id: I4d27470eccb8933f751db892218a8032a80df3da" into jb-mr1-dev
* commit 'd8357ceec04ca8b9d8a5e25cb5484ce8f8e56e00': Sets accessibility importance for the home/up button. Bug: 7196985 Change-Id: I4d27470eccb8933f751db892218a8032a80df3da
This commit is contained in:
@@ -556,12 +556,16 @@ 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 (!enable) {
|
if (!enable) {
|
||||||
mHomeLayout.setContentDescription(null);
|
mHomeLayout.setContentDescription(null);
|
||||||
} else if ((mDisplayOptions & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
|
mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||||
mHomeLayout.setContentDescription(mContext.getResources().getText(
|
|
||||||
R.string.action_bar_up_description));
|
|
||||||
} else {
|
} else {
|
||||||
mHomeLayout.setContentDescription(mContext.getResources().getText(
|
mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_AUTO);
|
||||||
R.string.action_bar_home_description));
|
if ((mDisplayOptions & 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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -624,12 +628,16 @@ 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()) {
|
if (!mHomeLayout.isEnabled()) {
|
||||||
mHomeLayout.setContentDescription(null);
|
mHomeLayout.setContentDescription(null);
|
||||||
} else if ((options & ActionBar.DISPLAY_HOME_AS_UP) != 0) {
|
mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_NO);
|
||||||
mHomeLayout.setContentDescription(mContext.getResources().getText(
|
|
||||||
R.string.action_bar_up_description));
|
|
||||||
} else {
|
} else {
|
||||||
mHomeLayout.setContentDescription(mContext.getResources().getText(
|
mHomeLayout.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_AUTO);
|
||||||
R.string.action_bar_home_description));
|
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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user