public class SegmentedButtonGroup
extends android.widget.LinearLayout
| Modifier and Type | Class and Description |
|---|---|
static interface |
SegmentedButtonGroup.AnimationInterpolator |
static interface |
SegmentedButtonGroup.OnPositionChangedListener
Interface definition for a callback that will be invoked when the position of the selection button changes
This callback will be called AFTER the animation is complete since the position does not change until the
completion of the animation.
|
android.widget.LinearLayout.LayoutParamsandroid.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListenerandroid.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, android.view.View.OnUnhandledKeyEventListener| Modifier and Type | Field and Description |
|---|---|
static int |
ANIM_INTERPOLATOR_ACCELERATE |
static int |
ANIM_INTERPOLATOR_ACCELERATE_DECELERATE |
static int |
ANIM_INTERPOLATOR_ANTICIPATE |
static int |
ANIM_INTERPOLATOR_ANTICIPATE_OVERSHOOT |
static int |
ANIM_INTERPOLATOR_BOUNCE |
static int |
ANIM_INTERPOLATOR_CYCLE |
static int |
ANIM_INTERPOLATOR_DECELERATE |
static int |
ANIM_INTERPOLATOR_FAST_OUT_LINEAR_IN |
static int |
ANIM_INTERPOLATOR_FAST_OUT_SLOW_IN |
static int |
ANIM_INTERPOLATOR_LINEAR |
static int |
ANIM_INTERPOLATOR_LINEAR_OUT_SLOW_IN |
static int |
ANIM_INTERPOLATOR_NONE |
static int |
ANIM_INTERPOLATOR_OVERSHOOT |
HORIZONTAL, SHOW_DIVIDER_BEGINNING, SHOW_DIVIDER_END, SHOW_DIVIDER_MIDDLE, SHOW_DIVIDER_NONE, VERTICALCLIP_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_CACHEACCESSIBILITY_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 |
|---|
SegmentedButtonGroup(android.content.Context context) |
SegmentedButtonGroup(android.content.Context context,
android.util.AttributeSet attrs) |
SegmentedButtonGroup(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
SegmentedButtonGroup(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
| Modifier and Type | Method and Description |
|---|---|
void |
addView(android.view.View child,
int index,
android.view.ViewGroup.LayoutParams params) |
boolean |
dispatchTouchEvent(android.view.MotionEvent ev)
Handles touch events by the user in order to handle tapping a new button or dragging the selected button
Note: dispatchTouchEvent is used here rather than onTouchEvent to allow for touch events to be handled by the
SegmentedButtonGroup AND SegmentedButton.
|
android.graphics.drawable.Drawable |
getBackground()
Returns the background drawable that is the 'global' value for each of the buttons.
|
int |
getBorderColor()
Return color of the border
|
int |
getBorderDashGap()
Return the border gap width, in pixels
Only relevant if border dash width is greater than 0px
|
int |
getBorderDashWidth()
Return the border dash width, in pixels
0px value indicates the border is solid
|
int |
getBorderWidth()
Return the width of the border, in pixels
0px value indicates no border is present
|
SegmentedButton |
getButton(int index)
Get segmented button at specified index
Segmented buttons are indexed according to their order of being added to this group
|
java.util.ArrayList<SegmentedButton> |
getButtons()
List of segmented buttons that are attached to this button group
|
android.graphics.drawable.Drawable |
getDivider()
Returns divider drawable that is placed between each button in the group, value of null indicates no drawable
|
SegmentedButtonGroup.OnPositionChangedListener |
getOnPositionChangedListener()
Returns the listener used for notifying position changes
|
int |
getPosition()
Return the currently selected button index
If the button is currently being animated, then the position will be the old button position until the
animation is complete
|
int |
getRadius()
Returns the current corner radius for this button group, in pixels
A value of 0px indicates the view is rectangular and has no rounded corners
|
int |
getRippleColor()
Returns the ripple color used for displaying the ripple effect on button press
The ripple color is a tint color applied on top of the button when it is pressed
|
android.graphics.drawable.Drawable |
getSelectedBackground()
Returns the background drawable that is the 'global' value for each of the buttons.
|
int |
getSelectedBorderColor()
Return color of the border for the selected button
|
int |
getSelectedBorderDashGap()
Return the border gap width for the selected button, in pixels
Only relevant if border dash width is greater than 0px
|
int |
getSelectedBorderDashWidth()
Return the border dash width for the selected button, in pixels
0px value indicates the border is solid
|
int |
getSelectedBorderWidth()
Return the width of the border for the selected button, in pixels
0px value indicates no border is present
|
int |
getSelectedButtonRadius()
Returns the current corner radius for the selected button, in pixels
A value of 0px indicates the selected button will be rectangular and has no rounded corners
|
int |
getSelectionAnimationDuration()
Return the duration, in milliseconds, it takes to complete the animation to change selected button
|
android.view.animation.Interpolator |
getSelectionAnimationInterpolator()
Return the current animation interpolator used when animating button movement
This will return null if no animation is being used
|
boolean |
hasRipple()
Whether or not the ripple effect is enabled on button tap
If false, then no animation will be shown if the user taps a button.
|
boolean |
isDraggable()
Returns whether or not the currently selected button can be moved via dragging
|
protected void |
onRestoreInstanceState(android.os.Parcelable state) |
protected android.os.Parcelable |
onSaveInstanceState() |
void |
setBackground(android.graphics.drawable.Drawable drawable)
Set the background displayed when a button is not selected to a given drawable for each button
Note: This is a convenience function that sets the background for each individual button.
|
void |
setBackground(int color)
Set the background to be a solid color when a button is not selected for each button
This will create a ColorDrawable or modify the current background if it is a ColorDrawable.
|
void |
setBackgroundColor(int color)
Convenience function for setting the background color
This function already exists in the base View class so it is overridden to prevent confusion as to why
setBackground works but not setBackgroundColor.
|
void |
setBorder(int width,
int color,
int dashWidth,
int dashGap)
Set the border for the perimeter of the button group.
|
void |
setDivider(android.graphics.drawable.Drawable drawable,
int width,
int radius,
int padding)
Set drawable as divider between buttons with a specified width, corner radius and padding
If the drawable is null, then the divider will be removed and hidden
|
void |
setDivider(int color,
int width,
int radius,
int padding)
Set divider between buttons with a specified solid color, width, radius and padding
|
void |
setDraggable(boolean draggable)
Sets whether or not the currently selected button can be moved via dragging
If true, the user can drag their finger starting from the selected button to a different button and the
selected button will follow the users finger.
|
void |
setOnPositionChangedListener(SegmentedButtonGroup.OnPositionChangedListener onPositionChangedListener)
Sets the listeners used for notifying position changes
|
void |
setPosition(int position,
boolean animate)
Selects the button at the given position and animates the movement if desired
If the given position is out of bounds, i.e.
|
void |
setRadius(int radius)
Set the radius of this button group
|
void |
setRipple(boolean enabled)
Set ripple effect to be either enabled or disabled on button press
If enabled, then the ripple color used will be the last ripple color set for the buttons or the default value
of gray
|
void |
setRipple(int color)
Set ripple color used for ripple effect on button press
This will automatically enable the ripple effect for all buttons if it is already disabled.
|
void |
setSelectedBackground(android.graphics.drawable.Drawable drawable)
Set the background displayed when a button is selected to a given drawable for each button
Note: This is a convenience function that sets the background for each individual button.
|
void |
setSelectedBackground(int color)
Set the background to be a solid color when a button is selected for each button
This will create a ColorDrawable or modify the current background if it is a ColorDrawable.
|
void |
setSelectedBackgroundColor(int color)
Convenience function for setting the background color
|
void |
setSelectedBorder(int width,
int color,
int dashWidth,
int dashGap)
Set the border for the selected button.
|
void |
setSelectedButtonRadius(int selectedButtonRadius)
Sets the corner radius for the selected button
|
void |
setSelectionAnimationDuration(int selectionAnimationDuration)
Set the duration for animating changing the selected button
|
void |
setSelectionAnimationInterpolator(int interpolator)
Set the current animation interpolator used when animating button movement
The interpolator given must be one of the predefined Android interpolators
|
void |
setSelectionAnimationInterpolator(android.view.animation.Interpolator interpolator)
Set the current animation interpolator used when animating button movement
If interpolator is null, no animation will be used
|
checkLayoutParams, generateDefaultLayoutParams, generateLayoutParams, generateLayoutParams, getAccessibilityClassName, getBaseline, getBaselineAlignedChildIndex, getDividerDrawable, getDividerPadding, getGravity, getOrientation, getShowDividers, getWeightSum, isBaselineAligned, isMeasureWithLargestChildEnabled, onDraw, onLayout, onMeasure, onRtlPropertiesChanged, setBaselineAligned, setBaselineAlignedChildIndex, setDividerDrawable, setDividerPadding, setGravity, setHorizontalGravity, setMeasureWithLargestChildEnabled, setOrientation, setShowDividers, setVerticalGravity, setWeightSum, shouldDelayChildPressedStateaddChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, 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, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, 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, updateViewLayoutaddExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, 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, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, draw, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackgroundTintList, getBackgroundTintMode, 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, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, 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, isAccessibilityHeading, 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, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onOverScrolled, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onScreenStateChanged, onScrollChanged, onSetAlpha, onSizeChanged, onStartTemporaryDetach, onTouchEvent, 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, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setAutofillHints, setAutofillId, 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, setForegroundGravity, 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, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, 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, willNotDrawclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcanResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows, requestLayoutpublic static final int ANIM_INTERPOLATOR_NONE
public static final int ANIM_INTERPOLATOR_FAST_OUT_SLOW_IN
public static final int ANIM_INTERPOLATOR_BOUNCE
public static final int ANIM_INTERPOLATOR_LINEAR
public static final int ANIM_INTERPOLATOR_DECELERATE
public static final int ANIM_INTERPOLATOR_CYCLE
public static final int ANIM_INTERPOLATOR_ANTICIPATE
public static final int ANIM_INTERPOLATOR_ACCELERATE_DECELERATE
public static final int ANIM_INTERPOLATOR_ACCELERATE
public static final int ANIM_INTERPOLATOR_ANTICIPATE_OVERSHOOT
public static final int ANIM_INTERPOLATOR_FAST_OUT_LINEAR_IN
public static final int ANIM_INTERPOLATOR_LINEAR_OUT_SLOW_IN
public static final int ANIM_INTERPOLATOR_OVERSHOOT
public SegmentedButtonGroup(android.content.Context context)
public SegmentedButtonGroup(android.content.Context context,
android.util.AttributeSet attrs)
public SegmentedButtonGroup(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public SegmentedButtonGroup(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
public void addView(android.view.View child,
int index,
android.view.ViewGroup.LayoutParams params)
addView in class android.view.ViewGrouppublic boolean dispatchTouchEvent(android.view.MotionEvent ev)
dispatchTouchEvent in class android.view.ViewGroupprotected android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class android.view.Viewprotected void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class android.view.Viewpublic java.util.ArrayList<SegmentedButton> getButtons()
public SegmentedButton getButton(int index)
public android.graphics.drawable.Drawable getBackground()
getBackground in class android.view.Viewpublic void setBackground(android.graphics.drawable.Drawable drawable)
setBackground in class android.view.Viewdrawable - drawable to set the background topublic void setBackground(int color)
color - color to set the background topublic void setBackgroundColor(int color)
setBackgroundColor in class android.view.Viewcolor - color to set the background tosetBackground(int)public android.graphics.drawable.Drawable getSelectedBackground()
public void setSelectedBackground(android.graphics.drawable.Drawable drawable)
drawable - drawable to set the background topublic void setSelectedBackground(int color)
color - color to set the background topublic void setSelectedBackgroundColor(int color)
color - color to set the background tosetSelectedBackground(int)public int getBorderWidth()
public int getBorderColor()
public int getBorderDashWidth()
public int getBorderDashGap()
public void setBorder(int width,
int color,
int dashWidth,
int dashGap)
width - Width of the border in pixels (default value is 0px or no border)color - Color of the border (default color is black)dashWidth - Width of the dash for border, in pixels. Value of 0px means solid line (default is 0px)dashGap - Width of the gap for border, in pixels.public int getSelectedBorderWidth()
public int getSelectedBorderColor()
public int getSelectedBorderDashWidth()
public int getSelectedBorderDashGap()
public void setSelectedBorder(int width,
int color,
int dashWidth,
int dashGap)
width - Width of the border in pixels (default value is 0px or no border)color - Color of the border (default color is black)dashWidth - Width of the dash for border, in pixels. Value of 0px means solid line (default is 0px)dashGap - Width of the gap for border, in pixels.public int getRadius()
public void setRadius(int radius)
radius - value of new corner radius, in pixelspublic int getSelectedButtonRadius()
public void setSelectedButtonRadius(int selectedButtonRadius)
selectedButtonRadius - value of the new selected button corner radius, in pixelspublic int getPosition()
public void setPosition(int position,
boolean animate)
position - index of new button to selectanimate - whether or not to animate moving to the buttonpublic boolean isDraggable()
public void setDraggable(boolean draggable)
public boolean hasRipple()
public int getRippleColor()
public void setRipple(boolean enabled)
enabled - whether or not to enable the ripple effect for all buttons in the grouppublic void setRipple(int color)
color - color to set for the ripple effect for all buttons in the grouppublic android.graphics.drawable.Drawable getDivider()
public void setDivider(@Nullable
android.graphics.drawable.Drawable drawable,
int width,
int radius,
int padding)
drawable - divider drawable that will be displayed between buttonswidth - width of the divider drawable, in pixelsradius - corner radius of the divider drawable to round the corners, in pixelspadding - space above and below the divider drawable within the button group, in pixelspublic void setDivider(int color,
int width,
int radius,
int padding)
color - color of the dividerwidth - width of the divider drawable, in pixelsradius - corner radius of the divider drawable to round the corners, in pixelspadding - space above and below the divider drawable within the button group, in pixelspublic android.view.animation.Interpolator getSelectionAnimationInterpolator()
public void setSelectionAnimationInterpolator(@Nullable
android.view.animation.Interpolator interpolator)
public void setSelectionAnimationInterpolator(int interpolator)
interpolator - int value indicating which predefined Android interpolator to usepublic int getSelectionAnimationDuration()
public void setSelectionAnimationDuration(int selectionAnimationDuration)
selectionAnimationDuration - duration in milliseconds for animation to completepublic SegmentedButtonGroup.OnPositionChangedListener getOnPositionChangedListener()
public void setOnPositionChangedListener(SegmentedButtonGroup.OnPositionChangedListener onPositionChangedListener)