public class FloatingActionButton
extends android.widget.ImageButton
android.widget.ImageView.ScaleTypeandroid.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.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| Modifier and Type | Field and Description |
|---|---|
static int |
SIZE_MINI |
static int |
SIZE_NORMAL |
ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, 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, 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, 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, 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_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 |
|---|
FloatingActionButton(android.content.Context context) |
FloatingActionButton(android.content.Context context,
android.util.AttributeSet attrs) |
FloatingActionButton(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr) |
FloatingActionButton(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes) |
| Modifier and Type | Method and Description |
|---|---|
int |
getButtonSize() |
int |
getColorDisabled() |
int |
getColorNormal() |
int |
getColorPressed() |
int |
getColorRipple() |
protected android.graphics.drawable.Drawable |
getIconDrawable() |
java.lang.String |
getLabelText() |
int |
getLabelVisibility() |
int |
getMax() |
int |
getProgress() |
int |
getShadowColor() |
int |
getShadowRadius() |
int |
getShadowXOffset() |
int |
getShadowYOffset() |
boolean |
hasShadow() |
void |
hide(boolean animate)
Makes the FloatingActionButton to disappear and sets its visibility to
View.INVISIBLE |
void |
hideButtonInMenu(boolean animate)
This will clear all AnimationListeners.
|
void |
hideProgress() |
boolean |
isHidden()
Checks whether FloatingActionButton is hidden
|
boolean |
isProgressBackgroundShown() |
protected void |
onDraw(android.graphics.Canvas canvas) |
protected void |
onMeasure(int widthMeasureSpec,
int heightMeasureSpec) |
void |
onRestoreInstanceState(android.os.Parcelable state) |
android.os.Parcelable |
onSaveInstanceState() |
protected void |
onSizeChanged(int w,
int h,
int oldw,
int oldh) |
boolean |
onTouchEvent(android.view.MotionEvent event) |
void |
setButtonSize(int size)
Sets the size of the FloatingActionButton and invalidates its layout.
|
void |
setColorDisabled(int color) |
void |
setColorDisabledResId(int colorResId) |
void |
setColorNormal(int color) |
void |
setColorNormalResId(int colorResId) |
void |
setColorPressed(int color) |
void |
setColorPressedResId(int colorResId) |
void |
setColorRipple(int color) |
void |
setColorRippleResId(int colorResId) |
void |
setElevation(float elevation) |
void |
setElevationCompat(float elevation)
Sets the shadow color and radius to mimic the native elevation.
|
void |
setEnabled(boolean enabled) |
void |
setHideAnimation(android.view.animation.Animation hideAnimation) |
void |
setImageDrawable(android.graphics.drawable.Drawable drawable) |
void |
setImageResource(int resId) |
void |
setIndeterminate(boolean indeterminate)
Change the indeterminate mode for the progress bar.
|
void |
setLabelColors(int colorNormal,
int colorPressed,
int colorRipple)
Set the label's background colors
|
void |
setLabelText(java.lang.String text) |
void |
setLabelTextColor(android.content.res.ColorStateList colors) |
void |
setLabelTextColor(int color) |
void |
setLabelVisibility(int visibility) |
void |
setLayoutParams(android.view.ViewGroup.LayoutParams params) |
void |
setMax(int max) |
void |
setOnClickListener(android.view.View.OnClickListener l) |
void |
setProgress(int progress,
boolean animate) |
void |
setShadowColor(int color) |
void |
setShadowColorResource(int colorResId) |
void |
setShadowRadius(float shadowRadiusDp)
Sets the shadow radius of the FloatingActionButton and invalidates its layout.
|
void |
setShadowRadius(int dimenResId)
Sets the shadow radius of the FloatingActionButton and invalidates its layout.
|
void |
setShadowXOffset(float shadowXOffsetDp)
Sets the shadow x offset of the FloatingActionButton and invalidates its layout.
|
void |
setShadowXOffset(int dimenResId)
Sets the shadow x offset of the FloatingActionButton and invalidates its layout.
|
void |
setShadowYOffset(float shadowYOffsetDp)
Sets the shadow y offset of the FloatingActionButton and invalidates its layout.
|
void |
setShadowYOffset(int dimenResId)
Sets the shadow y offset of the FloatingActionButton and invalidates its layout.
|
void |
setShowAnimation(android.view.animation.Animation showAnimation) |
void |
setShowProgressBackground(boolean show) |
void |
setShowShadow(boolean show) |
void |
setVisibility(int visibility) |
void |
show(boolean animate)
Makes the FloatingActionButton to appear and sets its visibility to
View.VISIBLE |
void |
showButtonInMenu(boolean animate) |
void |
toggle(boolean animate) |
clearColorFilter, drawableHotspotChanged, drawableStateChanged, getAdjustViewBounds, getBaseline, getBaselineAlignBottom, getColorFilter, getCropToPadding, getDrawable, getImageAlpha, getImageMatrix, getImageTintList, getImageTintMode, getMaxHeight, getMaxWidth, getScaleType, hasOverlappingRendering, invalidateDrawable, isOpaque, jumpDrawablesToCurrentState, onAttachedToWindow, onCreateDrawableState, onDetachedFromWindow, onRtlPropertiesChanged, setAdjustViewBounds, setAlpha, setBaseline, setBaselineAlignBottom, setColorFilter, setColorFilter, setColorFilter, setCropToPadding, setFrame, setImageAlpha, setImageBitmap, setImageIcon, setImageLevel, setImageMatrix, setImageState, setImageTintList, setImageTintMode, setImageURI, setMaxHeight, setMaxWidth, setScaleType, setSelected, verifyDrawableaddChildrenForAccessibility, addFocusables, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addTouchables, animate, announceForAccessibility, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, clearFocus, combineMeasuredStates, computeHorizontalScrollExtent, computeHorizontalScrollOffset, computeHorizontalScrollRange, computeScroll, computeSystemWindowInsets, computeVerticalScrollExtent, computeVerticalScrollOffset, computeVerticalScrollRange, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchGenericFocusedEvent, dispatchGenericMotionEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findViewById, findViewsWithText, findViewWithTag, fitSystemWindows, focusSearch, forceLayout, generateViewId, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getApplicationWindowToken, getBackground, getBackgroundTintList, getBackgroundTintMode, getBottom, getBottomFadingEdgeStrength, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentDescription, getContext, getContextMenuInfo, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getId, getImportantForAccessibility, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineProvider, getOverlay, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getResources, 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, getTop, getTopFadingEdgeStrength, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasTransientState, hasWindowFocus, inflate, invalidate, invalidate, invalidate, invalidateOutline, isAccessibilityFocused, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isInEditMode, isInLayout, isInTouchMode, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isPaddingOffsetRequired, isPaddingRelative, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, layout, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onGenericMotionEvent, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onLayout, onOverScrolled, onPopulateAccessibilityEvent, onProvideStructure, onProvideVirtualStructure, onScreenStateChanged, onScrollChanged, onStartTemporaryDetach, onTrackballEvent, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, resolveSize, resolveSizeAndState, restoreHierarchyState, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityLiveRegion, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAlpha, setAnimation, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentDescription, setContextClickable, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setForeground, setForegroundGravity, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHovered, setId, setImportantForAccessibility, setKeepScreenOn, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLeft, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineProvider, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPressed, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSoundEffectsEnabled, setStateListAnimator, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTop, setTouchDelegate, setTransitionName, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startNestedScroll, stopNestedScroll, toString, unscheduleDrawable, unscheduleDrawable, willNotCacheDrawing, willNotDrawpublic static final int SIZE_NORMAL
public static final int SIZE_MINI
public FloatingActionButton(android.content.Context context)
public FloatingActionButton(android.content.Context context,
android.util.AttributeSet attrs)
public FloatingActionButton(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr)
public FloatingActionButton(android.content.Context context,
android.util.AttributeSet attrs,
int defStyleAttr,
int defStyleRes)
protected void onMeasure(int widthMeasureSpec,
int heightMeasureSpec)
onMeasure in class android.widget.ImageViewprotected void onDraw(android.graphics.Canvas canvas)
onDraw in class android.widget.ImageViewprotected void onSizeChanged(int w,
int h,
int oldw,
int oldh)
onSizeChanged in class android.view.Viewpublic void setLayoutParams(android.view.ViewGroup.LayoutParams params)
setLayoutParams in class android.view.Viewprotected android.graphics.drawable.Drawable getIconDrawable()
public boolean onTouchEvent(android.view.MotionEvent event)
onTouchEvent in class android.view.Viewpublic android.os.Parcelable onSaveInstanceState()
onSaveInstanceState in class android.view.Viewpublic void onRestoreInstanceState(android.os.Parcelable state)
onRestoreInstanceState in class android.view.Viewpublic void setImageDrawable(android.graphics.drawable.Drawable drawable)
setImageDrawable in class android.widget.ImageViewpublic void setImageResource(int resId)
setImageResource in class android.widget.ImageViewpublic void setOnClickListener(android.view.View.OnClickListener l)
setOnClickListener in class android.view.Viewpublic void setButtonSize(int size)
size - size of the FloatingActionButton. Accepted values: SIZE_NORMAL, SIZE_MINI.public int getButtonSize()
public void setColorNormal(int color)
public void setColorNormalResId(int colorResId)
public int getColorNormal()
public void setColorPressed(int color)
public void setColorPressedResId(int colorResId)
public int getColorPressed()
public void setColorRipple(int color)
public void setColorRippleResId(int colorResId)
public int getColorRipple()
public void setColorDisabled(int color)
public void setColorDisabledResId(int colorResId)
public int getColorDisabled()
public void setShowShadow(boolean show)
public boolean hasShadow()
public void setShadowRadius(int dimenResId)
dimenResId - the resource identifier of the dimensionpublic void setShadowRadius(float shadowRadiusDp)
Must be specified in density-independent (dp) pixels, which are then converted into actual pixels (px).
shadowRadiusDp - shadow radius specified in density-independent (dp) pixelspublic int getShadowRadius()
public void setShadowXOffset(int dimenResId)
dimenResId - the resource identifier of the dimensionpublic void setShadowXOffset(float shadowXOffsetDp)
Must be specified in density-independent (dp) pixels, which are then converted into actual pixels (px).
shadowXOffsetDp - shadow radius specified in density-independent (dp) pixelspublic int getShadowXOffset()
public void setShadowYOffset(int dimenResId)
dimenResId - the resource identifier of the dimensionpublic void setShadowYOffset(float shadowYOffsetDp)
Must be specified in density-independent (dp) pixels, which are then converted into actual pixels (px).
shadowYOffsetDp - shadow radius specified in density-independent (dp) pixelspublic int getShadowYOffset()
public void setShadowColorResource(int colorResId)
public void setShadowColor(int color)
public int getShadowColor()
public boolean isHidden()
public void show(boolean animate)
View.VISIBLEanimate - if true - plays "show animation"public void hide(boolean animate)
View.INVISIBLEanimate - if true - plays "hide animation"public void toggle(boolean animate)
public void setLabelText(java.lang.String text)
public java.lang.String getLabelText()
public void setShowAnimation(android.view.animation.Animation showAnimation)
public void setHideAnimation(android.view.animation.Animation hideAnimation)
public void setLabelVisibility(int visibility)
public int getLabelVisibility()
public void setElevation(float elevation)
setElevation in class android.view.Viewpublic void setElevationCompat(float elevation)
API 21+: Sets the native elevation of this view, in pixels. Updates margins to make the view hold its position in layout across different platform versions.
public void setIndeterminate(boolean indeterminate)
Change the indeterminate mode for the progress bar. In indeterminate mode, the progress is ignored and the progress bar shows an infinite animation instead.
indeterminate - true to enable the indeterminate modepublic void setMax(int max)
public int getMax()
public void setProgress(int progress,
boolean animate)
public int getProgress()
public void hideProgress()
public void setShowProgressBackground(boolean show)
public boolean isProgressBackgroundShown()
public void setEnabled(boolean enabled)
setEnabled in class android.view.Viewpublic void setVisibility(int visibility)
setVisibility in class android.widget.ImageViewpublic void hideButtonInMenu(boolean animate)
public void showButtonInMenu(boolean animate)
public void setLabelColors(int colorNormal,
int colorPressed,
int colorRipple)
public void setLabelTextColor(int color)
public void setLabelTextColor(android.content.res.ColorStateList colors)