Package com.pspdfkit.ui.toolbar
Class ContextualToolbarMenuBar
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback
,android.view.KeyEvent.Callback
,android.view.ViewManager
,android.view.ViewParent
,android.view.accessibility.AccessibilityEventSource
public class ContextualToolbarMenuBar extends ViewGroup
This view is a component of contextual toolbar. It is a bar holding s. If the item has a submenu, the contextual toolbar will display those items in a separate ContextualToolbarMenuBar below the main one.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
ContextualToolbarMenuBar.MenuItemPosition
Possible positions for toolbar menu items.
-
Field Summary
Fields Modifier and Type Field Description public final static int
TOOLBAR_ITEM_SIZE_DP
public final static int
MENU_BAR_SIDE_PADDING_DP
public final static int
MENU_BAR_TEXT_ITEM_END_PADDING_DP
public final static int
MENU_BAR_ROW_SIZE_DP
public final static int
MENU_BAR_ITEM_MARGIN_DP
public int
cornerRadiusPx
public int
toolbarRowSize
-
Constructor Summary
Constructors Constructor Description ContextualToolbarMenuBar(Context context)
ContextualToolbarMenuBar(Context context, AttributeSet attrs)
ContextualToolbarMenuBar(Context context, AttributeSet attrs, int defStyleAttr)
-
Method Summary
Modifier and Type Method Description int
getCornerRadiusPx()
int
getToolbarRowSize()
boolean
onTouchEvent(MotionEvent event)
void
setBorderAndBackgroundColor(int borderColor, int backgroundColor)
Completable
showMenuItems(boolean animate)
Completable
hideMenuItems(boolean animate)
List<ContextualToolbarMenuItem>
getMenuItems()
Returns a copy of currently set menu items. void
setMenuItems(@NonNull() List<ContextualToolbarMenuItem> newItems)
Sets menu items to the toolbar. static int
estimateItemCapacity(Context context, int availableSpaceInPx)
void
setBackgroundColor(int color)
void
setAlternateBackgroundColor(int color)
void
setBorderColor(int color)
void
setIsSubmenu(boolean isSubmenu)
Sets whether this toolbar menu bar is used for displaying submenu or not. -
-
Constructor Detail
-
ContextualToolbarMenuBar
ContextualToolbarMenuBar(Context context)
-
ContextualToolbarMenuBar
ContextualToolbarMenuBar(Context context, AttributeSet attrs)
-
ContextualToolbarMenuBar
ContextualToolbarMenuBar(Context context, AttributeSet attrs, int defStyleAttr)
-
-
Method Detail
-
getCornerRadiusPx
int getCornerRadiusPx()
-
getToolbarRowSize
int getToolbarRowSize()
-
onTouchEvent
boolean onTouchEvent(MotionEvent event)
-
setBorderAndBackgroundColor
void setBorderAndBackgroundColor(int borderColor, int backgroundColor)
-
showMenuItems
Completable showMenuItems(boolean animate)
-
hideMenuItems
Completable hideMenuItems(boolean animate)
-
getMenuItems
List<ContextualToolbarMenuItem> getMenuItems()
Returns a copy of currently set 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.
-
estimateItemCapacity
static int estimateItemCapacity(Context context, int availableSpaceInPx)
-
setBackgroundColor
void setBackgroundColor(int color)
-
setAlternateBackgroundColor
void setAlternateBackgroundColor(int color)
-
setBorderColor
void setBorderColor(int color)
-
setIsSubmenu
void setIsSubmenu(boolean isSubmenu)
Sets whether this toolbar menu bar is used for displaying submenu or not.
- Parameters:
isSubmenu
-true
if displaying submenu,false
if displaying the main menu.
-
-
-
-