public class TabSwitcher extends android.widget.FrameLayout implements TabSwitcherLayout, Model
TabSwitcherDecorator
, must be implemented and set to the tab switcher via the
setDecorator
-method.
The currently selected tab is shown fullscreen by default. When displaying the switcher via the
showSwitcher-method
, an overview of all tabs is shown, allowing to select an other
tab by clicking it. By swiping a tab or by clicking its close button, it can be removed,
resulting in the selected tab to be altered automatically. The switcher can programmatically be
hidden by calling the hideSwitcher
-method. By calling the
setSelectedTab
-method programmatically, a tab is selected and shown fullscreen.
Individual tabs are represented by instances of the class Tab
. Such tabs can dynamically
be added to the tab switcher by using the addTab
-methods. In order to remove them
afterwards, the removeTab
can be used. If the switcher is currently shown, calling
these methods results in the tabs being added or removed in an animated manner.android.widget.FrameLayout.LayoutParams
android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
android.view.View.AccessibilityDelegate, android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnScrollChangeListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener
Model.Listener
Modifier and Type | Field and Description |
---|---|
static int |
PRIMARY_TOOLBAR_INDEX
The index of the primary toolbar as returned by the method
getToolbars() . |
static int |
SECONDARY_TOOLBAR_INDEX
The index of the secondary toolbar as returned by the method
getToolbars() . |
CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
Constructor and Description |
---|
TabSwitcher(android.content.Context context)
Creates a new tab switcher, which allows to switch between multiple tabs.
|
TabSwitcher(android.content.Context context,
android.util.AttributeSet attributeSet)
Creates a new tab switcher, which allows to switch between multiple tabs.
|
TabSwitcher(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle)
Creates a new tab switcher, which allows to switch between multiple tabs.
|
TabSwitcher(android.content.Context context,
android.util.AttributeSet attributeSet,
int defaultStyle,
int defaultStyleResource)
Creates a new tab switcher, which allows to switch between multiple tabs.
|
Modifier and Type | Method and Description |
---|---|
void |
addAllTabs(java.util.Collection<? extends Tab> tabs)
Adds all tabs, which are contained by a collection, to the tab switcher.
|
void |
addAllTabs(java.util.Collection<? extends Tab> tabs,
int index)
Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
specific index.
|
void |
addAllTabs(java.util.Collection<? extends Tab> tabs,
int index,
Animation animation)
Adds all tabs, which are contained by a collection, to the tab switcher, starting at a
specific index.
|
void |
addAllTabs(Tab[] tabs)
Adds all tabs, which are contained by an array, to the tab switcher.
|
void |
addAllTabs(Tab[] tabs,
int index)
Adds all tabs, which are contained by an array, to the tab switcher, starting at a specific
index.
|
void |
addAllTabs(Tab[] tabs,
int index,
Animation animation)
Adds all tabs, which are contained by an array, to the tab switcher, starting at a
specific index.
|
void |
addCloseTabListener(TabCloseListener listener)
Adds a new listener, which should be notified, when a tab is about to be closed by clicking
its close button.
|
void |
addDragGesture(DragGesture dragGesture)
Adds a specific drag gesture to the tab switcher.
|
void |
addListener(TabSwitcherListener listener)
Adds a listener, which should be notified about the tab switcher's events.
|
void |
addTab(Tab tab)
Adds a new tab to the tab switcher.
|
void |
addTab(Tab tab,
int index)
Adds a new tab to the tab switcher at a specific index.
|
void |
addTab(Tab tab,
int index,
Animation animation)
Adds a new tab to the tab switcher at a specific index.
|
void |
addTabPreviewListener(TabPreviewListener listener)
Adds a new listener, which should be notified, when the preview of a tab is about to be
loaded.
|
void |
applyPaddingToTabs(boolean applyPaddingToTabs)
Sets, whether the padding of the tab switcher should be applied to the content of its tabs,
or not.
|
boolean |
areToolbarsShown()
Returns, whether the toolbars are shown, when the tab switcher is shown, or not.
|
void |
clear()
Removes all tabs from the tab switcher.
|
void |
clear(Animation animationType)
Removes all tabs from the tab switcher.
|
android.content.res.ColorStateList |
getAddTabButtonColor()
Returns the color of the button, which allows to add a new tab.
|
int |
getCount()
Returns the number of tabs, which are contained by the tab switcher.
|
TabSwitcherDecorator |
getDecorator()
Returns the decorator, which allows to inflate the views, which correspond to the tabs of the
tab switcher.
|
android.view.View |
getEmptyView()
Returns the view, which is shown, when the tab switcher is empty.
|
Layout |
getLayout()
Returns the layout of the tab switcher.
|
LayoutPolicy |
getLayoutPolicy()
Returns the layout policy, which is used by the tab switcher.
|
de.mrapp.android.util.logging.LogLevel |
getLogLevel()
Returns the log level, which is used for logging.
|
int |
getPaddingBottom()
Returns the bottom padding of the tab switcher.
|
int |
getPaddingEnd()
Returns the end padding of the tab switcher.
|
int |
getPaddingLeft()
Returns the left padding of the tab switcher.
|
int |
getPaddingRight()
Returns the right padding of the tab switcher.
|
int |
getPaddingStart()
Returns the start padding of the tab switcher.
|
int |
getPaddingTop()
Returns the top padding of the tab switcher.
|
Tab |
getSelectedTab()
Returns the currently selected tab.
|
int |
getSelectedTabIndex()
Returns the index of the currently selected tab.
|
Tab |
getTab(int index)
Returns the tab at a specific index.
|
android.content.res.ColorStateList |
getTabBackgroundColor()
Returns the default background color of a tab.
|
android.graphics.drawable.Drawable |
getTabCloseButtonIcon()
Returns the default icon of a tab's close button.
|
android.view.ViewGroup |
getTabContainer()
Returns the view group, which contains the tab switcher's tabs.
|
int |
getTabContentBackgroundColor()
Returns the default background color of a tab's content.
|
android.graphics.drawable.Drawable |
getTabIcon()
Returns the default icon of a tab.
|
int |
getTabProgressBarColor()
Returns the color of a tab's progress bar.
|
android.content.res.ColorStateList |
getTabTitleTextColor()
Returns the default text color of a tab's title.
|
android.view.Menu |
getToolbarMenu()
Returns the menu of the toolbar, which is shown, when the tab switcher is shown.
|
android.graphics.drawable.Drawable |
getToolbarNavigationIcon()
Returns the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
|
android.support.v7.widget.Toolbar[] |
getToolbars()
Returns the toolbars, which are shown, when the tab switcher is shown.
|
java.lang.CharSequence |
getToolbarTitle()
Returns the title of the toolbar, which is shown, when the tab switcher is shown.
|
void |
hideSwitcher()
Hides the tab switcher by using an animation, if it is currently shown.
|
int |
indexOf(Tab tab)
Returns the index of a specific tab.
|
void |
inflateToolbarMenu(int resourceId,
android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
Inflates the menu of the toolbar, which is shown, when the tab switcher is shown.
|
boolean |
isAddTabButtonShown()
Returns, whether a button, which allows to add a new tab, is shown.
|
boolean |
isAnimationRunning()
Returns, whether an animation is currently running, or not.
|
boolean |
isEmpty()
Returns, whether the tab switcher is empty, or not.
|
boolean |
isPaddingAppliedToTabs()
Returns, whether the padding of the tab switcher is applied to the content of its tabs, or
not.
|
boolean |
isSwitcherShown()
Returns, whether the tab switcher is currently shown.
|
java.util.Iterator<Tab> |
iterator() |
void |
onRestoreInstanceState(android.os.Parcelable state) |
android.os.Parcelable |
onSaveInstanceState() |
boolean |
onTouchEvent(android.view.MotionEvent event) |
void |
removeCloseTabListener(TabCloseListener listener)
Removes a specific listener, which should not be notified, when a tab is about to be closed
by clicking its close button, anymore.
|
void |
removeDragGesture(DragGesture dragGesture)
Removes a specific drag gesture from the tab switcher.
|
void |
removeListener(TabSwitcherListener listener)
Removes a specific listener, which should not be notified about the tab switcher's events,
anymore.
|
void |
removeTab(Tab tab)
Removes a specific tab from the tab switcher.
|
void |
removeTab(Tab tab,
Animation animation)
Removes a specific tab from the tab switcher.
|
void |
removeTabPreviewListener(TabPreviewListener listener)
Removes a specific listener, which should not be notified, when the preview of a tab is about
to be loaded.
|
void |
selectTab(int index)
Selects the tab as a specific index.
|
void |
selectTab(Tab tab)
Selects a specific tab.
|
void |
setAddTabButtonColor(android.content.res.ColorStateList colorStateList)
Sets the color of the button, which allows to add a new tab.
|
void |
setAddTabButtonColor(int color)
Sets the color of the button, which allows to add a new tab.
|
void |
setDecorator(TabSwitcherDecorator decorator)
Sets the decorator, which allows to inflate the views, which correspond to the tabs of the
tab switcher.
|
void |
setEmptyView(int resourceId)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setEmptyView(int resourceId,
long animationDuration)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setEmptyView(android.view.View view)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setEmptyView(android.view.View view,
long animationDuration)
Sets the view, which should be shown, when the tab switcher is empty.
|
void |
setLayoutPolicy(LayoutPolicy layoutPolicy)
Sets the layout policy, which should be used by the tab switcher.
|
void |
setLogLevel(de.mrapp.android.util.logging.LogLevel logLevel)
Sets the log level, which should be used for logging.
|
void |
setPadding(int left,
int top,
int right,
int bottom)
Sets the padding of the tab switcher.
|
void |
setTabBackgroundColor(android.content.res.ColorStateList colorStateList)
Sets the default background color of a tab.
|
void |
setTabBackgroundColor(int color)
Sets the default background color of a tab.
|
void |
setTabCloseButtonIcon(android.graphics.Bitmap icon)
Sets the default icon of a tab's close button.
|
void |
setTabCloseButtonIcon(int resourceId)
Sets the default icon of a tab's close button.
|
void |
setTabContentBackgroundColor(int color)
Sets the default background color of a tab's content.
|
void |
setTabIcon(android.graphics.Bitmap icon)
Sets the default icon of a tab.
|
void |
setTabIcon(int resourceId)
Sets the default icon of a tab.
|
void |
setTabProgressBarColor(int color)
Sets the color of a tab's progress bar.
|
void |
setTabTitleTextColor(android.content.res.ColorStateList colorStateList)
Sets the default text color of a tab's title.
|
void |
setTabTitleTextColor(int color)
Sets the default text color of a tab's title.
|
void |
setToolbarNavigationIcon(android.graphics.drawable.Drawable icon,
android.view.View.OnClickListener listener)
Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
|
void |
setToolbarNavigationIcon(int resourceId,
android.view.View.OnClickListener listener)
Sets the navigation icon of the toolbar, which is shown, when the tab switcher is shown.
|
void |
setToolbarTitle(java.lang.CharSequence title)
Sets the title of the toolbar, which is shown, when the tab switcher is shown.
|
void |
setToolbarTitle(int resourceId)
Sets the title of the toolbar, which is shown, when the tab switcher is shown.
|
static void |
setupWithMenu(TabSwitcher tabSwitcher,
android.view.Menu menu,
android.view.View.OnClickListener listener)
Setups the tab switcher to be associated with those menu items of a specific menu, which use
a
TabSwitcherButton as their action view. |
static void |
setupWithMenu(TabSwitcher tabSwitcher,
android.view.View.OnClickListener listener)
Setups the tab switcher to be associated with those menu items of its own toolbar menu, which
use a
TabSwitcherButton as their action view. |
void |
showAddTabButton(AddTabButtonListener listener)
Sets, whether a button, which allows to add a new tab, should be shown.
|
void |
showSwitcher()
Shows the tab switcher by using an animation, if it is not already shown.
|
void |
showToolbars(boolean show)
Sets, whether the toolbars should be shown, when the tab switcher is shown, or not.
|
void |
toggleSwitcherVisibility()
Toggles the visibility of the tab switcher by using an animation, i.e.
|
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, onLayout, onMeasure, setForegroundGravity, setMeasureAllChildren, shouldDelayChildPressedState
addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addView, addView, addView, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChild, measureChildren, measureChildWithMargins, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onAttachedToWindow, onCreateDrawableState, onDescendantInvalidated, onDetachedFromWindow, onInterceptHoverEvent, onInterceptTouchEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestFocusInDescendants, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, updateViewLayout
addExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, dispatchStartTemporaryDetach, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverScrollMode, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRtlPropertiesChanged, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForeground, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getContext
canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayout
public static final int PRIMARY_TOOLBAR_INDEX
getToolbars()
.public static final int SECONDARY_TOOLBAR_INDEX
getToolbars()
.public TabSwitcher(@NonNull android.content.Context context)
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullpublic TabSwitcher(@NonNull android.content.Context context, @Nullable android.util.AttributeSet attributeSet)
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
the type AttributeSet
or null, if no attributes should be obtainedpublic TabSwitcher(@NonNull android.content.Context context, @Nullable android.util.AttributeSet attributeSet, @AttrRes int defaultStyle)
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
the type AttributeSet
or null, if no attributes should be obtaineddefaultStyle
- The default style to apply to this view. If 0, no style will be applied (beyond what
is included in the theme). This may either be an attribute resource, whose value will
be retrieved from the current theme, or an explicit style resourcepublic TabSwitcher(@NonNull android.content.Context context, @Nullable android.util.AttributeSet attributeSet, @AttrRes int defaultStyle, @StyleRes int defaultStyleResource)
context
- The context, which should be used by the view, as an instance of the class Context
. The context may not be nullattributeSet
- The attribute set, the view's attributes should be obtained from, as an instance of
the type AttributeSet
or null, if no attributes should be obtaineddefaultStyle
- The default style to apply to this view. If 0, no style will be applied (beyond what
is included in the theme). This may either be an attribute resource, whose value will
be retrieved from the current theme, or an explicit style resourcedefaultStyleResource
- A resource identifier of a style resource that supplies default values for the view,
used only if the default style is 0 or can not be found in the theme. Can be 0 to not
look for defaultspublic static void setupWithMenu(@NonNull TabSwitcher tabSwitcher, @Nullable android.view.View.OnClickListener listener)
TabSwitcherButton
as their action view. The icon of such menu items will
automatically be updated, when the number of tabs, which are contained by the tab switcher,
changes.
Calling this method is basically the same as calling setupWithMenu(tabSwitcher,
tabSwitcher.getToolbarMenu(), listener)
. However, if the Menu
, which is
returned by tabSwitcher.getToolbarMenu()
is null, a ViewTreeObserver.OnGlobalLayoutListener
is registered at the given tab switcher to setup the tab switcher as
soon as the menu is initialized.tabSwitcher
- The tab switcher, which should become associated with the menu items, as an instance
of the class TabSwitcher
. The tab switcher may not be nulllistener
- The listener, which should be set to the menu items, which use a TabSwitcherButton
as their action view, as an instance of the type OnClickListener
or null, if no listener should be setpublic static void setupWithMenu(@NonNull TabSwitcher tabSwitcher, @NonNull android.view.Menu menu, @Nullable android.view.View.OnClickListener listener)
TabSwitcherButton
as their action view. The icon of such menu items will
automatically be updated, when the number of tabs, which are contained by the tab switcher,
changes.tabSwitcher
- The tab switcher, which should become associated with the menu items, as an instance
of the class TabSwitcher
. The tab switcher may not be nullmenu
- The menu, whose menu items should become associated with the given tab switcher, as
an instance of the type Menu
. The menu may not be nulllistener
- The listener, which should be set to the menu items, which use a TabSwitcherButton
as their action view, as an instance of the type OnClickListener
or null, if no listener should be setpublic final void addListener(@NonNull TabSwitcherListener listener)
listener
- The listener, which should be added, as an instance of the type TabSwitcherListener
. The listener may not be nullpublic final void removeListener(@NonNull TabSwitcherListener listener)
listener
- The listener, which should be removed, as an instance of the type TabSwitcherListener
. The listener may not be null@NonNull public final LayoutPolicy getLayoutPolicy()
LayoutPolicy
. The layout policy may either be LayoutPolicy.AUTO
, LayoutPolicy.PHONE
or LayoutPolicy.TABLET
public final void setLayoutPolicy(@NonNull LayoutPolicy layoutPolicy)
layoutPolicy
- The layout policy, which should be set, as a value of the enum LayoutPolicy
.
The layout policy may either be LayoutPolicy.AUTO
, LayoutPolicy.PHONE
or LayoutPolicy.TABLET
@NonNull public final Layout getLayout()
Layout
. The layout may
either be Layout.PHONE_PORTRAIT
, Layout.PHONE_LANDSCAPE
or Layout.TABLET
public final void addDragGesture(@NonNull DragGesture dragGesture)
dragGesture
- The drag gesture, which should be added, as an instance of the class DragGesture
. The drag gesture may not be nullpublic final void removeDragGesture(@NonNull DragGesture dragGesture)
dragGesture
- The drag gesture, which should be removed, as an instance of the class DragGesture
. The drag gesture may not be nullpublic final void addTab(@NonNull Tab tab)
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If
an animation is currently running, the tab will be added once all previously started
animations have been finished.public final void addTab(@NonNull Tab tab, int index)
Model
SwipeAnimation
with
direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently
running, the tab will be added once all previously started animations have been finished.addTab
in interface Model
tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addTab(@NonNull Tab tab, int index, @NonNull Animation animation)
Model
addTab
in interface Model
tab
- The tab, which should be added, as an instance of the class Tab
. The tab may
not be nullindex
- The index, the tab should be added at, as an Integer
value. The index must be
at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tab, as an instance of the class
Animation
. The animation may not be nullpublic final void addAllTabs(@NonNull java.util.Collection<? extends Tab> tabs)
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
type Collection
or an empty collection, if no tabs should be addedpublic final void addAllTabs(@NonNull java.util.Collection<? extends Tab> tabs, int index)
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addAllTabs(@NonNull java.util.Collection<? extends Tab> tabs, int index, @NonNull Animation animation)
Model
addAllTabs
in interface Model
tabs
- A collection, which contains the tabs, which should be added, as an instance of the
type Collection
or an empty collection, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
Animation
. The animation may not be nullpublic final void addAllTabs(@NonNull Tab[] tabs)
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
Tab
or an empty array, if no tabs should be addedpublic final void addAllTabs(@NonNull Tab[] tabs, int index)
Model
SwipeAnimation
with direction SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tabs will
be added once all previously started animations have been finished.addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownpublic final void addAllTabs(@NonNull Tab[] tabs, int index, @NonNull Animation animation)
Model
addAllTabs
in interface Model
tabs
- An array, which contains the tabs, which should be added, as an array of the type
Tab
or an empty array, if no tabs should be addedindex
- The index, the first tab should be started at, as an Integer
value. The index
must be at least 0 and at maximum getCount()
, otherwise an IndexOutOfBoundsException
will be thrownanimation
- The animation, which should be used to add the tabs, as an instance of the class
Animation
. The animation may not be nullpublic final void removeTab(@NonNull Tab tab)
Model
SwipeAnimation
with direction
SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the tab
will be removed once all previously started animations have been finished.public final void removeTab(@NonNull Tab tab, @NonNull Animation animation)
Model
public final void clear()
Model
SwipeAnimation
with direction
SwipeAnimation.SwipeDirection.RIGHT_OR_BOTTOM
is used. If an animation is currently running, the
tabs will be removed once all previously started animations have been finished.public final void clear(@NonNull Animation animationType)
Model
public final void selectTab(@NonNull Tab tab)
Model
public final void selectTab(int index)
Model
@Nullable public final Tab getSelectedTab()
Model
getSelectedTab
in interface Model
Tab
or null, if no tab
is currently selectedpublic final int getSelectedTabIndex()
Model
getSelectedTabIndex
in interface Model
Integer
value or -1, if no tab
is currently selectedpublic final java.util.Iterator<Tab> iterator()
iterator
in interface java.lang.Iterable<Tab>
public final boolean isEmpty()
Model
public final int getCount()
Model
@NonNull public final Tab getTab(int index)
Model
getTab
in interface Model
index
- The index of the tab, which should be returned, as an Integer
value. The
index must be at least 0 and at maximum getCount() - 1
, otherwise a
IndexOutOfBoundsException
will be thrownTab
. The tab may not be nullpublic final int indexOf(@NonNull Tab tab)
Model
public final boolean isSwitcherShown()
Model
isSwitcherShown
in interface Model
public final void showSwitcher()
Model
showSwitcher
in interface Model
public final void hideSwitcher()
Model
hideSwitcher
in interface Model
public final void toggleSwitcherVisibility()
Model
toggleSwitcherVisibility
in interface Model
public final void setDecorator(@NonNull TabSwitcherDecorator decorator)
Model
setDecorator
in interface Model
decorator
- The decorator, which should be set, as an instance of the class TabSwitcherDecorator
. The decorator may not be nullpublic final TabSwitcherDecorator getDecorator()
Model
getDecorator
in interface Model
TabSwitcherDecorator
or null, if no
decorator has been set@NonNull public final de.mrapp.android.util.logging.LogLevel getLogLevel()
Model
getLogLevel
in interface Model
public final void setLogLevel(@NonNull de.mrapp.android.util.logging.LogLevel logLevel)
Model
setLogLevel
in interface Model
logLevel
- The log level, which should be set, as a value of the enum LogLevel. The log level
may not be nullpublic final void setPadding(int left, int top, int right, int bottom)
Model
setPadding
in interface Model
setPadding
in class android.view.View
left
- The left padding, which should be set, in pixels as an Integer
valuetop
- The top padding, which should be set, in pixels as an Integer
valueright
- The right padding, which should be set, in pixels as an Integer
valuebottom
- The bottom padding, which should be set, in pixels as an Integer
valuepublic final int getPaddingLeft()
Model
getPaddingLeft
in interface Model
getPaddingLeft
in class android.view.View
Integer
valuepublic final int getPaddingTop()
Model
getPaddingTop
in interface Model
getPaddingTop
in class android.view.View
Integer
valuepublic final int getPaddingRight()
Model
getPaddingRight
in interface Model
getPaddingRight
in class android.view.View
Integer
valuepublic final int getPaddingBottom()
Model
getPaddingBottom
in interface Model
getPaddingBottom
in class android.view.View
Integer
valuepublic final int getPaddingStart()
Model
getPaddingStart
in interface Model
getPaddingStart
in class android.view.View
Integer
valuepublic final int getPaddingEnd()
Model
getPaddingEnd
in interface Model
getPaddingEnd
in class android.view.View
Integer
valuepublic final void applyPaddingToTabs(boolean applyPaddingToTabs)
Model
false
the padding is still taken into account for
positioning tabs and the tab switcher's toolbars.applyPaddingToTabs
in interface Model
applyPaddingToTabs
- True, if the padding of the tab switcher should be applied to the content of its
tabs, false otherwisepublic final boolean isPaddingAppliedToTabs()
Model
isPaddingAppliedToTabs
in interface Model
@Nullable public final android.graphics.drawable.Drawable getTabIcon()
Model
getTabIcon
in interface Model
Drawable
or null, if no
icon is setpublic final void setTabIcon(@DrawableRes int resourceId)
Model
setTabIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
resource id must correspond to a valid drawable resourcepublic final void setTabIcon(@Nullable android.graphics.Bitmap icon)
Model
setTabIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
no icon should be set@Nullable public final android.content.res.ColorStateList getTabBackgroundColor()
Model
getTabBackgroundColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setTabBackgroundColor(int color)
Model
setTabBackgroundColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
color should be usedpublic final void setTabBackgroundColor(@Nullable android.content.res.ColorStateList colorStateList)
Model
setTabBackgroundColor
in interface Model
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
null, if the default color should be usedpublic final int getTabContentBackgroundColor()
Model
getTabContentBackgroundColor
in interface Model
Integer
valuepublic final void setTabContentBackgroundColor(int color)
Model
setTabContentBackgroundColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
color should be used@Nullable public final android.content.res.ColorStateList getTabTitleTextColor()
Model
getTabTitleTextColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setTabTitleTextColor(int color)
Model
setTabTitleTextColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
color should be usedpublic final void setTabTitleTextColor(@Nullable android.content.res.ColorStateList colorStateList)
Model
setTabTitleTextColor
in interface Model
colorStateList
- The color state list, which should be set, as an instance of the class ColorStateList
or null, if the default color should be used@Nullable public final android.graphics.drawable.Drawable getTabCloseButtonIcon()
Model
getTabCloseButtonIcon
in interface Model
Drawable
or null, if the default icon is usedpublic final int getTabProgressBarColor()
Model
getTabProgressBarColor
in interface Model
Integer
value or -1, if the default
color is usedpublic final void setTabProgressBarColor(int color)
Model
setTabProgressBarColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
color should be usedpublic final void setTabCloseButtonIcon(@DrawableRes int resourceId)
Model
setTabCloseButtonIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
resource id must correspond to a valid drawable resourcepublic final void setTabCloseButtonIcon(@Nullable android.graphics.Bitmap icon)
Model
setTabCloseButtonIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Bitmap
or null, if
the default icon should be usedpublic final boolean isAddTabButtonShown()
Model
isAddTabButtonShown
in interface Model
public final void showAddTabButton(@Nullable AddTabButtonListener listener)
Model
showAddTabButton
in interface Model
listener
- The listener, which should be notified, when the button has been clicked, as an
instance of the type AddTabButtonListener
or null, if the button should not
be shown@Nullable public final android.content.res.ColorStateList getAddTabButtonColor()
Model
getAddTabButtonColor
in interface Model
ColorStateList
or null, if the default color is usedpublic final void setAddTabButtonColor(int color)
Model
setAddTabButtonColor
in interface Model
color
- The color, which should be set, as an Integer
value or -1, if the default
color should be usedpublic final void setAddTabButtonColor(@Nullable android.content.res.ColorStateList colorStateList)
Model
setAddTabButtonColor
in interface Model
colorStateList
- The color, which should be set, as an instance of the class ColorStateList
or
null, if the default color should be usedpublic final boolean areToolbarsShown()
Model
areToolbarsShown
in interface Model
public final void showToolbars(boolean show)
Model
showToolbars
in interface Model
show
- True, if the toolbars should be shown, false otherwise@Nullable public final java.lang.CharSequence getToolbarTitle()
Model
getToolbarTitle
in interface Model
CharSequence
or null, if no title is setpublic final void setToolbarTitle(@StringRes int resourceId)
Model
setToolbarTitle
in interface Model
resourceId
- The resource id of the title, which should be set, as an Integer
value. The
resource id must correspond to a valid string resourcepublic final void setToolbarTitle(@Nullable java.lang.CharSequence title)
Model
setToolbarTitle
in interface Model
title
- The title, which should be set, as an instance of the type CharSequence
or
null, if no title should be set@Nullable public final android.graphics.drawable.Drawable getToolbarNavigationIcon()
Model
getToolbarNavigationIcon
in interface Model
Drawable
or null, if no icon is setpublic final void setToolbarNavigationIcon(@Nullable android.graphics.drawable.Drawable icon, @Nullable android.view.View.OnClickListener listener)
Model
setToolbarNavigationIcon
in interface Model
icon
- The icon, which should be set, as an instance of the class Drawable
or null,
if no icon should be setlistener
- The listener, which should be notified, when the navigation item has been clicked, as
an instance of the type View.OnClickListener
or null, if no listener should be
notifiedpublic final void setToolbarNavigationIcon(@DrawableRes int resourceId, @Nullable android.view.View.OnClickListener listener)
Model
setToolbarNavigationIcon
in interface Model
resourceId
- The resource id of the icon, which should be set, as an Integer
value. The
resource id must correspond to a valid drawable resourcelistener
- The listener, which should be notified, when the navigation item has been clicked, as
an instance of the type View.OnClickListener
or null, if no listener should be
notifiedpublic final void inflateToolbarMenu(@MenuRes int resourceId, @Nullable android.support.v7.widget.Toolbar.OnMenuItemClickListener listener)
Model
inflateToolbarMenu
in interface Model
resourceId
- The resource id of the menu, which should be inflated, as an Integer
value.
The resource id must correspond to a valid menu resourcelistener
- The listener, which should be notified, when an menu item has been clicked, as an
instance of the type OnMenuItemClickListener or null, if no listener should be
notified@Nullable public final android.view.View getEmptyView()
Model
getEmptyView
in interface Model
View
or null, if no view is shownpublic void setEmptyView(@Nullable android.view.View view)
Model
setEmptyView
in interface Model
view
- The view, which should be set, as an instance of the class View
or null, if
no view should be shown, when the tab switcher is emptypublic final void setEmptyView(@Nullable android.view.View view, long animationDuration)
Model
setEmptyView
in interface Model
view
- The view, which should be set, as an instance of the class View
or null, if
no view should be shown, when the tab switcher is emptyanimationDuration
- The duration of the fade animation, which is used to show or hide the view, in
milliseconds as a Long
value. The duration must be at least 0 or -1, if the
default duration should be usedpublic final void setEmptyView(@LayoutRes int resourceId)
Model
setEmptyView
in interface Model
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
resource id must correspond to a valid layout resourcepublic final void setEmptyView(@LayoutRes int resourceId, long animationDuration)
Model
setEmptyView
in interface Model
resourceId
- The resource id of the view, which should be set, as an Integer
value. The
resource id must correspond to a valid layout resourceanimationDuration
- The duration of the fade animation, which is used to show or hide the view, in
milliseconds as a Long
value. The duration must be at least 0 or -1, if the
default duration should be usedpublic final void addCloseTabListener(@NonNull TabCloseListener listener)
Model
addCloseTabListener
in interface Model
listener
- The listener, which should be added, as an instance of the type TabCloseListener
. The listener may not be nullpublic final void removeCloseTabListener(@NonNull TabCloseListener listener)
Model
removeCloseTabListener
in interface Model
listener
- The listener, which should be removed, as an instance of the type TabCloseListener
. The listener may not be nullpublic final void addTabPreviewListener(@NonNull TabPreviewListener listener)
Model
addTabPreviewListener
in interface Model
listener
- The listener, which should be added, as an instance of the type TabPreviewListener
. The listener may not be nullpublic final void removeTabPreviewListener(@NonNull TabPreviewListener listener)
Model
removeTabPreviewListener
in interface Model
listener
- The listener, which should be removed, as an instance of the type TabPreviewListener
. The listener may not be nullpublic final boolean isAnimationRunning()
TabSwitcherLayout
isAnimationRunning
in interface TabSwitcherLayout
@Nullable public final android.view.ViewGroup getTabContainer()
TabSwitcherLayout
getTabContainer
in interface TabSwitcherLayout
ViewGroup
or null, if the view has not been laid out yetpublic final android.support.v7.widget.Toolbar[] getToolbars()
TabSwitcherLayout
PRIMARY_TOOLBAR_INDEX
of the returned array corresponds to the primary toolbar and the index SECONDARY_TOOLBAR_INDEX
corresponds to the secondary toolbar.getToolbars
in interface TabSwitcherLayout
@Nullable public final android.view.Menu getToolbarMenu()
TabSwitcherLayout
getToolbarMenu
in interface TabSwitcherLayout
Menu
or null, if the view
has not been laid out yetpublic final boolean onTouchEvent(android.view.MotionEvent event)
onTouchEvent
in class android.view.View
public final android.os.Parcelable onSaveInstanceState()
onSaveInstanceState
in class android.view.View
public final void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState
in class android.view.View