Loading core/java/android/widget/Toolbar.java +12 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,8 @@ public class Toolbar extends ViewGroup { * as screen readers or tooltips. * * @return The navigation button's content description * * @attr ref android.R.styleable#Toolbar_navigationContentDescription */ @Nullable public CharSequence getNavigationContentDescription() { Loading @@ -692,6 +694,8 @@ public class Toolbar extends ViewGroup { * * @param resId Resource ID of a content description string to set, or 0 to * clear the description * * @attr ref android.R.styleable#Toolbar_navigationContentDescription */ public void setNavigationContentDescription(int resId) { setNavigationContentDescription(resId != 0 ? getContext().getText(resId) : null); Loading @@ -704,6 +708,8 @@ public class Toolbar extends ViewGroup { * * @param description Content description to set, or <code>null</code> to * clear the content description * * @attr ref android.R.styleable#Toolbar_navigationContentDescription */ public void setNavigationContentDescription(@Nullable CharSequence description) { if (!TextUtils.isEmpty(description)) { Loading @@ -725,6 +731,8 @@ public class Toolbar extends ViewGroup { * tooltips.</p> * * @param resId Resource ID of a drawable to set * * @attr ref android.R.styleable#Toolbar_navigationIcon */ public void setNavigationIcon(int resId) { setNavigationIcon(getContext().getDrawable(resId)); Loading @@ -741,6 +749,8 @@ public class Toolbar extends ViewGroup { * tooltips.</p> * * @param icon Drawable to set, may be null to clear the icon * * @attr ref android.R.styleable#Toolbar_navigationIcon */ public void setNavigationIcon(@Nullable Drawable icon) { if (icon != null) { Loading @@ -761,6 +771,8 @@ public class Toolbar extends ViewGroup { * Return the current drawable used as the navigation icon. * * @return The navigation icon drawable * * @attr ref android.R.styleable#Toolbar_navigationIcon */ @Nullable public Drawable getNavigationIcon() { Loading core/res/res/values/attrs.xml +5 −1 Original line number Diff line number Diff line Loading @@ -7318,8 +7318,12 @@ <!-- Reference to a theme that should be used to inflate popups shown by widgets in the toolbar. --> <attr name="popupTheme" format="reference" /> <!-- Icon drawable to use for the navigation button located at the start of the toolbar. --> <attr name="navigationIcon" format="reference" /> <attr name="navigationContentDescription" format="string|reference" /> <!-- Text to set as the content description for the navigation button located at the start of the toolbar. --> <attr name="navigationContentDescription" format="string" /> </declare-styleable> <declare-styleable name="Toolbar_LayoutParams"> Loading Loading
core/java/android/widget/Toolbar.java +12 −0 Original line number Diff line number Diff line Loading @@ -679,6 +679,8 @@ public class Toolbar extends ViewGroup { * as screen readers or tooltips. * * @return The navigation button's content description * * @attr ref android.R.styleable#Toolbar_navigationContentDescription */ @Nullable public CharSequence getNavigationContentDescription() { Loading @@ -692,6 +694,8 @@ public class Toolbar extends ViewGroup { * * @param resId Resource ID of a content description string to set, or 0 to * clear the description * * @attr ref android.R.styleable#Toolbar_navigationContentDescription */ public void setNavigationContentDescription(int resId) { setNavigationContentDescription(resId != 0 ? getContext().getText(resId) : null); Loading @@ -704,6 +708,8 @@ public class Toolbar extends ViewGroup { * * @param description Content description to set, or <code>null</code> to * clear the content description * * @attr ref android.R.styleable#Toolbar_navigationContentDescription */ public void setNavigationContentDescription(@Nullable CharSequence description) { if (!TextUtils.isEmpty(description)) { Loading @@ -725,6 +731,8 @@ public class Toolbar extends ViewGroup { * tooltips.</p> * * @param resId Resource ID of a drawable to set * * @attr ref android.R.styleable#Toolbar_navigationIcon */ public void setNavigationIcon(int resId) { setNavigationIcon(getContext().getDrawable(resId)); Loading @@ -741,6 +749,8 @@ public class Toolbar extends ViewGroup { * tooltips.</p> * * @param icon Drawable to set, may be null to clear the icon * * @attr ref android.R.styleable#Toolbar_navigationIcon */ public void setNavigationIcon(@Nullable Drawable icon) { if (icon != null) { Loading @@ -761,6 +771,8 @@ public class Toolbar extends ViewGroup { * Return the current drawable used as the navigation icon. * * @return The navigation icon drawable * * @attr ref android.R.styleable#Toolbar_navigationIcon */ @Nullable public Drawable getNavigationIcon() { Loading
core/res/res/values/attrs.xml +5 −1 Original line number Diff line number Diff line Loading @@ -7318,8 +7318,12 @@ <!-- Reference to a theme that should be used to inflate popups shown by widgets in the toolbar. --> <attr name="popupTheme" format="reference" /> <!-- Icon drawable to use for the navigation button located at the start of the toolbar. --> <attr name="navigationIcon" format="reference" /> <attr name="navigationContentDescription" format="string|reference" /> <!-- Text to set as the content description for the navigation button located at the start of the toolbar. --> <attr name="navigationContentDescription" format="string" /> </declare-styleable> <declare-styleable name="Toolbar_LayoutParams"> Loading