Merge "show SELECT ALL icon with text in landscape mode"
This commit is contained in:
@@ -2659,23 +2659,14 @@ public class Editor {
|
|||||||
TypedArray styledAttributes = mTextView.getContext().obtainStyledAttributes(
|
TypedArray styledAttributes = mTextView.getContext().obtainStyledAttributes(
|
||||||
com.android.internal.R.styleable.SelectionModeDrawables);
|
com.android.internal.R.styleable.SelectionModeDrawables);
|
||||||
|
|
||||||
boolean allowText = mTextView.getContext().getResources().getBoolean(
|
|
||||||
com.android.internal.R.bool.config_allowActionMenuItemTextWithIcon);
|
|
||||||
|
|
||||||
mode.setTitle(mTextView.getContext().getString(
|
mode.setTitle(mTextView.getContext().getString(
|
||||||
com.android.internal.R.string.textSelectionCABTitle));
|
com.android.internal.R.string.textSelectionCABTitle));
|
||||||
mode.setSubtitle(null);
|
mode.setSubtitle(null);
|
||||||
mode.setTitleOptionalHint(true);
|
mode.setTitleOptionalHint(true);
|
||||||
|
|
||||||
int selectAllIconId = 0; // No icon by default
|
|
||||||
if (!allowText) {
|
|
||||||
// Provide an icon, text will not be displayed on smaller screens.
|
|
||||||
selectAllIconId = styledAttributes.getResourceId(
|
|
||||||
R.styleable.SelectionModeDrawables_actionModeSelectAllDrawable, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
menu.add(0, TextView.ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll).
|
menu.add(0, TextView.ID_SELECT_ALL, 0, com.android.internal.R.string.selectAll).
|
||||||
setIcon(selectAllIconId).
|
setIcon(styledAttributes.getResourceId(
|
||||||
|
R.styleable.SelectionModeDrawables_actionModeSelectAllDrawable, 0)).
|
||||||
setAlphabeticShortcut('a').
|
setAlphabeticShortcut('a').
|
||||||
setShowAsAction(
|
setShowAsAction(
|
||||||
MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
MenuItem.SHOW_AS_ACTION_ALWAYS | MenuItem.SHOW_AS_ACTION_WITH_TEXT);
|
||||||
|
|||||||
Reference in New Issue
Block a user