Force Autofill in FloatingToolbar overflow menu

Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
bit CtsWidgetTestCases:android.widget.cts.EditTextTest

Bug: 62271937
Change-Id: Ib3447281f3bd1abc811a25fc55ad55e34e155bbb
This commit is contained in:
Siyamed Sinir
2017-06-07 16:26:19 -07:00
parent 58977d1035
commit 484c2e2fbe
4 changed files with 52 additions and 9 deletions

View File

@@ -70,7 +70,12 @@ public interface MenuItem {
* a larger segment of its container.
*/
public static final int SHOW_AS_ACTION_COLLAPSE_ACTION_VIEW = 8;
/**
* @hide
*/
int SHOW_AS_OVERFLOW_ALWAYS = 1 << 31;
/**
* Interface definition for a callback to be invoked when a menu item is
* clicked.
@@ -799,4 +804,14 @@ public interface MenuItem {
default CharSequence getTooltipText() {
return null;
}
/**
* Returns true if {@link #setShowAsAction(int)} was set to {@link #SHOW_AS_OVERFLOW_ALWAYS}.
* Default value if {@code false}.
*
* @hide
*/
default boolean requiresOverflow() {
return false;
}
}

View File

@@ -3846,7 +3846,7 @@ public class Editor {
if (selected == null || selected.isEmpty()) {
menu.add(Menu.NONE, TextView.ID_AUTOFILL, MENU_ITEM_ORDER_AUTOFILL,
com.android.internal.R.string.autofill)
.setShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
.setShowAsAction(MenuItem.SHOW_AS_OVERFLOW_ALWAYS);
}
}