Class ContextualToolbarSubMenu
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
public class ContextualToolbarSubMenu extends ViewGroup
This view is a component of contextual toolbar. It represents a submenu. The contextual toolbar will display items in this submenu below the main menu bar.
Note: This view wraps ContextualToolbarMenuBar in a horizontal or vertical scroll view (depending on its position). This allows to display more ContextualToolbarMenuItems than fits the toolbar width.
-
-
Field Summary
Fields Modifier and Type Field Description public final ContextualToolbarMenuBar
menuBar
-
Constructor Summary
Constructors Constructor Description ContextualToolbarSubMenu(Context context)
ContextualToolbarSubMenu(Context context, AttributeSet attrs)
ContextualToolbarSubMenu(Context context, AttributeSet attrs, int defStyleAttr)
-
Method Summary
Modifier and Type Method Description ContextualToolbarMenuBar
getMenuBar()
Returns menu bar with ContextualToolbarMenuItems show in this submenu. void
setMenuItems(@NonNull() List<ContextualToolbarMenuItem> newItems)
Sets menu items to the toolbar. void
setBorderAndBackroundColor(int borderColor, int backgroundColor)
Completable
showMenuItems(boolean animate)
Completable
hideMenuItems(boolean animate)
void
removeAllViews()
void
setBackgroundColor(int color)
void
setBorderColor(int color)
-
-
Constructor Detail
-
ContextualToolbarSubMenu
ContextualToolbarSubMenu(Context context)
-
ContextualToolbarSubMenu
ContextualToolbarSubMenu(Context context, AttributeSet attrs)
-
ContextualToolbarSubMenu
ContextualToolbarSubMenu(Context context, AttributeSet attrs, int defStyleAttr)
-
-
Method Detail
-
getMenuBar
@NonNull() ContextualToolbarMenuBar getMenuBar()
Returns menu bar with ContextualToolbarMenuItems show in this submenu.
- Returns:
ContextualToolbarMenuBar with this menu items.
-
setMenuItems
void setMenuItems(@NonNull() List<ContextualToolbarMenuItem> newItems)
Sets menu items to the toolbar. If the specified position is START, the items will be added to the far left or bottom if vertical, otherwise to the far right or top if vertical. This only prepares the items (they're scaled to 0f). Once you need to display them, call showMenuItems.
- Parameters:
newItems
- Items to be added to this toolbar menu bar.
-
setBorderAndBackroundColor
void setBorderAndBackroundColor(int borderColor, int backgroundColor)
-
showMenuItems
Completable showMenuItems(boolean animate)
-
hideMenuItems
Completable hideMenuItems(boolean animate)
-
removeAllViews
void removeAllViews()
-
setBackgroundColor
void setBackgroundColor(int color)
-
setBorderColor
void setBorderColor(int color)
-
-
-
-