public class

ContextualToolbarMenuBar

extends ViewGroup
java.lang.Object
   ↳ android.view.View
     ↳ android.view.ViewGroup
       ↳ com.pspdfkit.ui.toolbar.ContextualToolbarMenuBar

Class Overview

This view is a component of contextual toolbar. It is a bar holding ContextualToolbarMenuItems. If the item has a submenu, the contextual toolbar will display those items in a separate ContextualToolbarMenuBar below the main one.

Summary

Nested Classes
enum ContextualToolbarMenuBar.MenuItemPosition Possible positions for toolbar menu items. 
Constants
int MENU_BAR_SIDE_PADDING_DP Padding on the sides of the menu bar.
int TOOLBAR_BACK_ITEM_SIZE_DP Width/height of the contextual toolbar back button item in dps.
int TOOLBAR_ITEM_SIZE_DP Height/width of the contextual toolbar items in dps.
[Expand]
Inherited Constants
From class android.view.ViewGroup
From class android.view.View
[Expand]
Inherited Fields
From class android.view.View
Public Constructors
ContextualToolbarMenuBar(Context context)
ContextualToolbarMenuBar(Context context, AttributeSet attrs)
ContextualToolbarMenuBar(Context context, AttributeSet attrs, int defStyleAttr)
Public Methods
List<ContextualToolbarMenuItem> getMenuItems()
Returns a copy of currently set menu items.
Completable hideMenuItems(boolean animate)
boolean onTouchEvent(MotionEvent event)
void setBackgroundColor(int color)
void setIsSubmenu(boolean isSubmenu)
Sets whether this toolbar menu bar is used for displaying submenu or not.
void setMenuItems(List<ContextualToolbarMenuItem> newItems)
Sets menu items to the toolbar.
Completable showMenuItems(boolean animate)
Protected Methods
void onLayout(boolean changed, int l, int t, int r, int b)
void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
[Expand]
Inherited Methods
From class android.view.ViewGroup
From class android.view.View
From class java.lang.Object
From interface android.graphics.drawable.Drawable.Callback
From interface android.view.KeyEvent.Callback
From interface android.view.ViewManager
From interface android.view.ViewParent
From interface android.view.accessibility.AccessibilityEventSource

Constants

public static final int MENU_BAR_SIDE_PADDING_DP

Padding on the sides of the menu bar.

Constant Value: 8 (0x00000008)

public static final int TOOLBAR_BACK_ITEM_SIZE_DP

Width/height of the contextual toolbar back button item in dps.

Constant Value: 56 (0x00000038)

public static final int TOOLBAR_ITEM_SIZE_DP

Height/width of the contextual toolbar items in dps.

Constant Value: 48 (0x00000030)

Public Constructors

public ContextualToolbarMenuBar (Context context)

public ContextualToolbarMenuBar (Context context, AttributeSet attrs)

public ContextualToolbarMenuBar (Context context, AttributeSet attrs, int defStyleAttr)

Public Methods

public List<ContextualToolbarMenuItem> getMenuItems ()

Returns a copy of currently set menu items.

public Completable hideMenuItems (boolean animate)

public boolean onTouchEvent (MotionEvent event)

public void setBackgroundColor (int color)

public 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.

public void setMenuItems (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(boolean).

Parameters
newItems Items to be added to this toolbar menu bar.

public Completable showMenuItems (boolean animate)

Protected Methods

protected void onLayout (boolean changed, int l, int t, int r, int b)

protected void onMeasure (int widthMeasureSpec, int heightMeasureSpec)