Class PowerSpinnerView
-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.ViewTreeObserver.OnPreDrawListener,android.view.accessibility.AccessibilityEventSource,androidx.appcompat.widget.EmojiCompatConfigurationView,androidx.core.view.TintableBackgroundView,androidx.core.widget.AutoSizeableTextView,androidx.core.widget.TintableCompoundDrawablesView,androidx.lifecycle.DefaultLifecycleObserver,androidx.lifecycle.LifecycleObserver
public final class PowerSpinnerView extends AppCompatTextView implements DefaultLifecycleObserver
A lightweight dropdown spinner, fully customizable with arrow and animations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPowerSpinnerView.BuilderBuilder class for creating PowerSpinnerView.
-
Field Summary
-
Constructor Summary
Constructors Constructor Description PowerSpinnerView(Context context)PowerSpinnerView(Context context, AttributeSet attributeSet)PowerSpinnerView(Context context, AttributeSet attributeSet, Integer defStyle)
-
Method Summary
Modifier and Type Method Description final PopupWindowgetSpinnerWindow()PopupWindow for creating the spinner. final BooleanisShowing()Spinner is showing or not. final IntegergetSelectedIndex()An index of the selected item. final BooleangetArrowAnimate()The arrow will be animated or not when show and dismiss the spinner. final UnitsetArrowAnimate(Boolean arrowAnimate)The arrow will be animated or not when show and dismiss the spinner. final LonggetArrowAnimationDuration()A duration of the arrow animation when show and dismiss. final UnitsetArrowAnimationDuration(Long arrowAnimationDuration)A duration of the arrow animation when show and dismiss. final DrawablegetArrowDrawable()A drawable of the arrow. final UnitsetArrowDrawable(Drawable arrowDrawable)A drawable of the arrow. final LonggetDebounceDuration()A duration of the debounce for showOrDismiss. final IntegergetArrowResource()final UnitsetArrowResource(Integer arrowResource)final BooleangetShowArrow()final UnitsetShowArrow(Boolean showArrow)final SpinnerGravitygetArrowGravity()final UnitsetArrowGravity(SpinnerGravity arrowGravity)final SpinnerSizeSpecgetArrowSize()final UnitsetArrowSize(SpinnerSizeSpec arrowSize)final IntegergetArrowPadding()final UnitsetArrowPadding(Integer arrowPadding)final IntegergetArrowTint()final UnitsetArrowTint(Integer arrowTint)final BooleangetShowDivider()final UnitsetShowDivider(Boolean showDivider)final IntegergetDividerSize()final UnitsetDividerSize(Integer dividerSize)final IntegergetDividerColor()final UnitsetDividerColor(Integer dividerColor)final DrawablegetSpinnerPopupBackground()final UnitsetSpinnerPopupBackground(Drawable spinnerPopupBackground)final IntegergetSpinnerPopupElevation()final UnitsetSpinnerPopupElevation(Integer spinnerPopupElevation)final IntegergetSpinnerPopupAnimationStyle()A style resource for the popup animation when show and dismiss. final UnitsetSpinnerPopupAnimationStyle(@StyleRes() Integer spinnerPopupAnimationStyle)A style resource for the popup animation when show and dismiss. final IntegergetSpinnerPopupWidth()A width size of the spinner popup. final UnitsetSpinnerPopupWidth(Integer spinnerPopupWidth)A width size of the spinner popup. final IntegergetSpinnerPopupHeight()A height size of the spinner popup. final UnitsetSpinnerPopupHeight(Integer spinnerPopupHeight)A height size of the spinner popup. final IntegergetSpinnerPopupMaxHeight()A max height size of the spinner popup. final UnitsetSpinnerPopupMaxHeight(Integer spinnerPopupMaxHeight)A max height size of the spinner popup. final IntegergetSpinnerItemHeight()A fixed item height size of the spinner popup. final UnitsetSpinnerItemHeight(Integer spinnerItemHeight)A fixed item height size of the spinner popup. final DrawablegetSpinnerSelectedItemBackground()A background of the selected item. final UnitsetSpinnerSelectedItemBackground(Drawable spinnerSelectedItemBackground)A background of the selected item. final BooleangetDismissWhenNotifiedItemSelected()The spinner popup will be dismissed when got notified an item is selected. final UnitsetDismissWhenNotifiedItemSelected(Boolean dismissWhenNotifiedItemSelected)The spinner popup will be dismissed when got notified an item is selected. final OnSpinnerOutsideTouchListenergetSpinnerOutsideTouchListener()Interface definition for a callback to be invoked when touched on outside of the spinner popup. final UnitsetSpinnerOutsideTouchListener(OnSpinnerOutsideTouchListener spinnerOutsideTouchListener)Interface definition for a callback to be invoked when touched on outside of the spinner popup. final OnSpinnerDismissListenergetOnSpinnerDismissListener()Interface definition for a callback to be invoked when spinner popup is dismissed. final UnitsetOnSpinnerDismissListener(OnSpinnerDismissListener onSpinnerDismissListener)Interface definition for a callback to be invoked when spinner popup is dismissed. final SpinnerAnimationgetSpinnerPopupAnimation()A collection of the spinner popup animation when show and dismiss. final UnitsetSpinnerPopupAnimation(SpinnerAnimation spinnerPopupAnimation)A collection of the spinner popup animation when show and dismiss. final StringgetPreferenceName()A preferences name of the spinner. final UnitsetPreferenceName(String preferenceName)final LifecycleOwnergetLifecycleOwner()A lifecycle owner for observing the lifecycle owner's lifecycle. final UnitsetLifecycleOwner(LifecycleOwner lifecycleOwner)final RecyclerViewgetSpinnerRecyclerView()gets the spinner popup's recyclerView. final FrameLayoutgetSpinnerBodyView()gets the spinner popup's body. final <T extends Any> UnitsetItems(List<T> itemList)Sets an item list for setting items of the adapter. final UnitsetItems(@ArrayRes() Integer resource)Sets a string array resource for setting items of the adapter. final <T extends Any> UnitsetSpinnerAdapter(PowerSpinnerInterface<T> powerSpinnerInterface)sets an adapter of the PowerSpinnerView. final <T extends Any> PowerSpinnerInterface<T>getSpinnerAdapter()gets an adapter of the PowerSpinnerView. final <T extends Any> UnitsetOnSpinnerItemSelectedListener(OnSpinnerItemSelectedListener<T> onSpinnerItemSelectedListener)sets a OnSpinnerItemSelectedListener to the default adapter. final Unitshow(Integer xOff, Integer yOff)shows the spinner popup menu to the center. final Unitshow(Integer xOff)shows the spinner popup menu to the center. final Unitshow()shows the spinner popup menu to the center. final IntegergetSpinnerHeight()Returns the window height size of the spinner. final Unitdismiss()dismiss the spinner popup menu. final UnitshowOrDismiss(Integer xOff, Integer yOff)If the popup is not showing, shows the spinner popup menu to the center. final UnitshowOrDismiss(Integer xOff)If the popup is not showing, shows the spinner popup menu to the center. final UnitshowOrDismiss()If the popup is not showing, shows the spinner popup menu to the center. final UnitsetDisableChangeTextWhenNotified(Boolean value)Disable changing text automatically when an item selection notified. final UnitsetIsFocusable(Boolean isFocusable)sets isFocusable of the spinner popup. final UnitselectItemByIndex(Integer index)Select an item by index. final UnitnotifyItemSelected(Integer index, CharSequence changedText)notifies to PowerSpinnerView of changed information from PowerSpinnerInterface. final UnitclearSelectedItem()clears a selected item. UnitonDestroy(LifecycleOwner owner)dismiss automatically when lifecycle owner is destroyed. -
Methods inherited from class androidx.lifecycle.DefaultLifecycleObserver
onCreate, onPause, onResume, onStart, onStop -
Methods inherited from class android.view.View
addChildrenForAccessibility, addFocusables, addFocusables, addKeyboardNavigationClusters, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, addTouchables, animate, announceForAccessibility, autofill, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearFocus, clearViewTranslationCallback, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchGenericMotionEvent, dispatchKeyEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPointerCaptureChanged, dispatchPopulateAccessibilityEvent, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, draw, findFocus, findOnBackInvokedDispatcher, findViewById, findViewWithTag, focusSearch, forceHasOverlappingRendering, forceLayout, gatherTransparentRegion, generateDisplayHash, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillId, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getPreferKeepClearRects, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocus, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasPointerCapture, hasTransientState, hasWindowFocus, invalidate, invalidate, invalidate, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isAutoHandwritingEnabled, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPreferKeepClear, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, layout, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCreateVirtualViewTranslationRequests, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyLongPress, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onScrollCaptureSearch, onStartTemporaryDetach, onViewTranslationResponse, onVirtualViewTranslationResponses, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocus, requestFocusFromTouch, requestLayout, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requestUnbufferedDispatch, requireViewById, resetPivot, restoreDefaultFocus, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, scrollTo, sendAccessibilityEvent, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAlpha, setAnimation, setAnimationMatrix, setAutoHandwritingEnabled, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundGravity, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPivotX, setPivotY, setPointerIcon, setPreferKeepClear, setPreferKeepClearRects, setPressed, setRenderEffect, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setWindowInsetsAnimationCallback, setX, setY, setZ, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw -
Methods inherited from class android.widget.TextView
addExtraDataToAccessibilityNodeInfo, addTextChangedListener, append, append, autofill, beginBatchEdit, bringPointIntoView, cancelLongPress, clearComposingText, computeScroll, debug, didTouchFocusSelect, drawableHotspotChanged, endBatchEdit, extractText, findViewsWithText, getAccessibilityClassName, getAutoLinkMask, getAutofillHints, getAutofillType, getAutofillValue, getBaseline, getBreakStrategy, getCompoundDrawablePadding, getCompoundDrawableTintBlendMode, getCompoundDrawableTintList, getCompoundDrawableTintMode, getCompoundDrawables, getCompoundDrawablesRelative, getCompoundPaddingBottom, getCompoundPaddingEnd, getCompoundPaddingLeft, getCompoundPaddingRight, getCompoundPaddingStart, getCompoundPaddingTop, getCurrentHintTextColor, getCurrentTextColor, getCustomInsertionActionModeCallback, getEditableText, getEllipsize, getError, getExtendedPaddingBottom, getExtendedPaddingTop, getFilters, getFocusedRect, getFontFeatureSettings, getFontVariationSettings, getFreezesText, getGravity, getHighlightColor, getHint, getHintTextColors, getHyphenationFrequency, getImeActionId, getImeActionLabel, getImeHintLocales, getImeOptions, getIncludeFontPadding, getInputExtras, getInputType, getJustificationMode, getKeyListener, getLayout, getLetterSpacing, getLineBounds, getLineBreakStyle, getLineBreakWordStyle, getLineCount, getLineHeight, getLineSpacingExtra, getLineSpacingMultiplier, getLinkTextColors, getLinksClickable, getMarqueeRepeatLimit, getMaxEms, getMaxHeight, getMaxLines, getMaxWidth, getMinEms, getMinHeight, getMinLines, getMinWidth, getMovementMethod, getOffsetForPosition, getPaint, getPaintFlags, getPrivateImeOptions, getSelectionEnd, getSelectionStart, getShadowColor, getShadowDx, getShadowDy, getShadowRadius, getShowSoftInputOnFocus, getTextColors, getTextCursorDrawable, getTextDirectionHeuristic, getTextLocale, getTextLocales, getTextMetricsParams, getTextScaleX, getTextSelectHandle, getTextSelectHandleLeft, getTextSelectHandleRight, getTextSize, getTextSizeUnit, getTotalPaddingBottom, getTotalPaddingEnd, getTotalPaddingLeft, getTotalPaddingRight, getTotalPaddingStart, getTotalPaddingTop, getTransformationMethod, getTypeface, getUrls, hasOverlappingRendering, hasSelection, invalidateDrawable, isAllCaps, isCursorVisible, isElegantTextHeight, isFallbackLineSpacing, isHorizontallyScrollable, isInputMethodTarget, isSingleLine, isSuggestionsEnabled, isTextSelectable, jumpDrawablesToCurrentState, length, moveCursorToVisibleOffset, onBeginBatchEdit, onCheckIsTextEditor, onCommitCompletion, onCommitCorrection, onCreateViewTranslationRequest, onDragEvent, onEditorAction, onEndBatchEdit, onGenericMotionEvent, onKeyDown, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPreDraw, onPrivateIMECommand, onReceiveContent, onResolvePointerIcon, onRestoreInstanceState, onRtlPropertiesChanged, onSaveInstanceState, onScreenStateChanged, onTextContextMenuItem, onTouchEvent, onTrackballEvent, onVisibilityAggregated, onWindowFocusChanged, performLongClick, removeTextChangedListener, sendAccessibilityEventUnchecked, setAutoLinkMask, setBreakStrategy, setCompoundDrawablePadding, setCompoundDrawableTintBlendMode, setCompoundDrawableTintList, setCompoundDrawableTintMode, setCursorVisible, setCustomInsertionActionModeCallback, setEditableFactory, setElegantTextHeight, setEllipsize, setEms, setEnabled, setError, setError, setExtractedText, setFallbackLineSpacing, setFontFeatureSettings, setFontVariationSettings, setFreezesText, setGravity, setHeight, setHighlightColor, setHint, setHint, setHintTextColor, setHintTextColor, setHorizontallyScrolling, setHyphenationFrequency, setImeActionLabel, setImeHintLocales, setImeOptions, setIncludeFontPadding, setInputExtras, setInputType, setJustificationMode, setKeyListener, setLetterSpacing, setLineBreakStyle, setLineBreakWordStyle, setLineSpacing, setLines, setLinkTextColor, setLinkTextColor, setLinksClickable, setMarqueeRepeatLimit, setMaxEms, setMaxHeight, setMaxLines, setMaxWidth, setMinEms, setMinHeight, setMinLines, setMinWidth, setMovementMethod, setOnEditorActionListener, setPadding, setPaddingRelative, setPaintFlags, setPrivateImeOptions, setRawInputType, setScroller, setSelectAllOnFocus, setSelected, setShadowLayer, setShowSoftInputOnFocus, setSingleLine, setSingleLine, setSpannableFactory, setText, setText, setText, setText, setText, setTextAppearance, setTextColor, setTextColor, setTextCursorDrawable, setTextCursorDrawable, setTextIsSelectable, setTextKeepState, setTextKeepState, setTextLocale, setTextLocales, setTextMetricsParams, setTextScaleX, setTextSelectHandle, setTextSelectHandle, setTextSelectHandleLeft, setTextSelectHandleLeft, setTextSelectHandleRight, setTextSelectHandleRight, setTextSize, setTransformationMethod, setTypeface, setWidth, showContextMenu, showContextMenu -
Methods inherited from class androidx.appcompat.widget.AppCompatTextView
getAutoSizeMaxTextSize, getAutoSizeMinTextSize, getAutoSizeStepGranularity, getAutoSizeTextAvailableSizes, getAutoSizeTextType, getCustomSelectionActionModeCallback, getFirstBaselineToTopHeight, getLastBaselineToBottomHeight, getSupportBackgroundTintList, getSupportBackgroundTintMode, getSupportCompoundDrawablesTintList, getSupportCompoundDrawablesTintMode, getText, getTextClassifier, getTextMetricsParamsCompat, isEmojiCompatEnabled, onCreateInputConnection, setAllCaps, setAutoSizeTextTypeUniformWithConfiguration, setAutoSizeTextTypeUniformWithPresetSizes, setAutoSizeTextTypeWithDefaults, setBackgroundDrawable, setBackgroundResource, setCompoundDrawables, setCompoundDrawablesRelative, setCompoundDrawablesRelativeWithIntrinsicBounds, setCompoundDrawablesRelativeWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCompoundDrawablesWithIntrinsicBounds, setCustomSelectionActionModeCallback, setEmojiCompatEnabled, setFilters, setFirstBaselineToTopHeight, setLastBaselineToBottomHeight, setLineHeight, setPrecomputedText, setSupportBackgroundTintList, setSupportBackgroundTintMode, setSupportCompoundDrawablesTintList, setSupportCompoundDrawablesTintMode, setTextAppearance, setTextClassifier, setTextFuture, setTextMetricsParamsCompat, setTextSize, setTypeface -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
PowerSpinnerView
PowerSpinnerView(Context context)
-
PowerSpinnerView
PowerSpinnerView(Context context, AttributeSet attributeSet)
-
PowerSpinnerView
PowerSpinnerView(Context context, AttributeSet attributeSet, Integer defStyle)
-
-
Method Detail
-
getSpinnerWindow
final PopupWindow getSpinnerWindow()
PopupWindow for creating the spinner.
-
getSelectedIndex
final Integer getSelectedIndex()
An index of the selected item.
-
getArrowAnimate
final Boolean getArrowAnimate()
The arrow will be animated or not when show and dismiss the spinner.
-
setArrowAnimate
final Unit setArrowAnimate(Boolean arrowAnimate)
The arrow will be animated or not when show and dismiss the spinner.
-
getArrowAnimationDuration
final Long getArrowAnimationDuration()
A duration of the arrow animation when show and dismiss.
-
setArrowAnimationDuration
final Unit setArrowAnimationDuration(Long arrowAnimationDuration)
A duration of the arrow animation when show and dismiss.
-
getArrowDrawable
final Drawable getArrowDrawable()
A drawable of the arrow.
-
setArrowDrawable
final Unit setArrowDrawable(Drawable arrowDrawable)
A drawable of the arrow.
-
getDebounceDuration
final Long getDebounceDuration()
A duration of the debounce for showOrDismiss.
-
getArrowResource
@DrawableRes() final Integer getArrowResource()
-
setArrowResource
final Unit setArrowResource(Integer arrowResource)
-
getShowArrow
final Boolean getShowArrow()
-
setShowArrow
final Unit setShowArrow(Boolean showArrow)
-
getArrowGravity
final SpinnerGravity getArrowGravity()
-
setArrowGravity
final Unit setArrowGravity(SpinnerGravity arrowGravity)
-
getArrowSize
final SpinnerSizeSpec getArrowSize()
-
setArrowSize
final Unit setArrowSize(SpinnerSizeSpec arrowSize)
-
getArrowPadding
@Px() final Integer getArrowPadding()
-
setArrowPadding
final Unit setArrowPadding(Integer arrowPadding)
-
getArrowTint
@ColorInt() final Integer getArrowTint()
-
setArrowTint
final Unit setArrowTint(Integer arrowTint)
-
getShowDivider
final Boolean getShowDivider()
-
setShowDivider
final Unit setShowDivider(Boolean showDivider)
-
getDividerSize
@Px() final Integer getDividerSize()
-
setDividerSize
final Unit setDividerSize(Integer dividerSize)
-
getDividerColor
@ColorInt() final Integer getDividerColor()
-
setDividerColor
final Unit setDividerColor(Integer dividerColor)
-
getSpinnerPopupBackground
final Drawable getSpinnerPopupBackground()
-
setSpinnerPopupBackground
final Unit setSpinnerPopupBackground(Drawable spinnerPopupBackground)
-
getSpinnerPopupElevation
@Px() final Integer getSpinnerPopupElevation()
-
setSpinnerPopupElevation
final Unit setSpinnerPopupElevation(Integer spinnerPopupElevation)
-
getSpinnerPopupAnimationStyle
final Integer getSpinnerPopupAnimationStyle()
A style resource for the popup animation when show and dismiss.
-
setSpinnerPopupAnimationStyle
final Unit setSpinnerPopupAnimationStyle(@StyleRes() Integer spinnerPopupAnimationStyle)
A style resource for the popup animation when show and dismiss.
-
getSpinnerPopupWidth
final Integer getSpinnerPopupWidth()
A width size of the spinner popup.
-
setSpinnerPopupWidth
final Unit setSpinnerPopupWidth(Integer spinnerPopupWidth)
A width size of the spinner popup.
-
getSpinnerPopupHeight
final Integer getSpinnerPopupHeight()
A height size of the spinner popup.
-
setSpinnerPopupHeight
final Unit setSpinnerPopupHeight(Integer spinnerPopupHeight)
A height size of the spinner popup.
-
getSpinnerPopupMaxHeight
final Integer getSpinnerPopupMaxHeight()
A max height size of the spinner popup.
-
setSpinnerPopupMaxHeight
final Unit setSpinnerPopupMaxHeight(Integer spinnerPopupMaxHeight)
A max height size of the spinner popup.
-
getSpinnerItemHeight
final Integer getSpinnerItemHeight()
A fixed item height size of the spinner popup.
-
setSpinnerItemHeight
final Unit setSpinnerItemHeight(Integer spinnerItemHeight)
A fixed item height size of the spinner popup.
-
getSpinnerSelectedItemBackground
final Drawable getSpinnerSelectedItemBackground()
A background of the selected item.
-
setSpinnerSelectedItemBackground
final Unit setSpinnerSelectedItemBackground(Drawable spinnerSelectedItemBackground)
A background of the selected item.
-
getDismissWhenNotifiedItemSelected
final Boolean getDismissWhenNotifiedItemSelected()
The spinner popup will be dismissed when got notified an item is selected.
-
setDismissWhenNotifiedItemSelected
final Unit setDismissWhenNotifiedItemSelected(Boolean dismissWhenNotifiedItemSelected)
The spinner popup will be dismissed when got notified an item is selected.
-
getSpinnerOutsideTouchListener
final OnSpinnerOutsideTouchListener getSpinnerOutsideTouchListener()
Interface definition for a callback to be invoked when touched on outside of the spinner popup.
-
setSpinnerOutsideTouchListener
final Unit setSpinnerOutsideTouchListener(OnSpinnerOutsideTouchListener spinnerOutsideTouchListener)
Interface definition for a callback to be invoked when touched on outside of the spinner popup.
-
getOnSpinnerDismissListener
final OnSpinnerDismissListener getOnSpinnerDismissListener()
Interface definition for a callback to be invoked when spinner popup is dismissed.
-
setOnSpinnerDismissListener
final Unit setOnSpinnerDismissListener(OnSpinnerDismissListener onSpinnerDismissListener)
Interface definition for a callback to be invoked when spinner popup is dismissed.
-
getSpinnerPopupAnimation
final SpinnerAnimation getSpinnerPopupAnimation()
A collection of the spinner popup animation when show and dismiss.
-
setSpinnerPopupAnimation
final Unit setSpinnerPopupAnimation(SpinnerAnimation spinnerPopupAnimation)
A collection of the spinner popup animation when show and dismiss.
-
getPreferenceName
final String getPreferenceName()
A preferences name of the spinner.
-
setPreferenceName
final Unit setPreferenceName(String preferenceName)
-
getLifecycleOwner
final LifecycleOwner getLifecycleOwner()
A lifecycle owner for observing the lifecycle owner's lifecycle. It is recommended that this field be should be set for avoiding memory leak of the popup window. Avoid Memory leak
-
setLifecycleOwner
final Unit setLifecycleOwner(LifecycleOwner lifecycleOwner)
-
getSpinnerRecyclerView
final RecyclerView getSpinnerRecyclerView()
gets the spinner popup's recyclerView.
-
getSpinnerBodyView
final FrameLayout getSpinnerBodyView()
gets the spinner popup's body.
-
setItems
final <T extends Any> Unit setItems(List<T> itemList)
Sets an item list for setting items of the adapter.
- Parameters:
itemList- An item list for the RecyclerView.Adapter which extends the PowerSpinnerInterface.
-
setItems
final Unit setItems(@ArrayRes() Integer resource)
Sets a string array resource for setting items of the adapter. This function only works for the DefaultSpinnerAdapter.
- Parameters:
resource- A resource of the string array.
-
setSpinnerAdapter
final <T extends Any> Unit setSpinnerAdapter(PowerSpinnerInterface<T> powerSpinnerInterface)
sets an adapter of the PowerSpinnerView.
-
getSpinnerAdapter
final <T extends Any> PowerSpinnerInterface<T> getSpinnerAdapter()
gets an adapter of the PowerSpinnerView.
-
setOnSpinnerItemSelectedListener
final <T extends Any> Unit setOnSpinnerItemSelectedListener(OnSpinnerItemSelectedListener<T> onSpinnerItemSelectedListener)
sets a OnSpinnerItemSelectedListener to the default adapter.
-
show
@MainThread()@JvmOverloads() final Unit show(Integer xOff, Integer yOff)
shows the spinner popup menu to the center.
-
show
@MainThread()@JvmOverloads() final Unit show(Integer xOff)
shows the spinner popup menu to the center.
-
show
@MainThread()@JvmOverloads() final Unit show()
shows the spinner popup menu to the center.
-
getSpinnerHeight
final Integer getSpinnerHeight()
Returns the window height size of the spinner.
-
dismiss
@MainThread() final Unit dismiss()
dismiss the spinner popup menu.
-
showOrDismiss
@MainThread()@JvmOverloads() final Unit showOrDismiss(Integer xOff, Integer yOff)
If the popup is not showing, shows the spinner popup menu to the center. If the popup is already showing, dismiss the spinner popup menu.
-
showOrDismiss
@MainThread()@JvmOverloads() final Unit showOrDismiss(Integer xOff)
If the popup is not showing, shows the spinner popup menu to the center. If the popup is already showing, dismiss the spinner popup menu.
-
showOrDismiss
@MainThread()@JvmOverloads() final Unit showOrDismiss()
If the popup is not showing, shows the spinner popup menu to the center. If the popup is already showing, dismiss the spinner popup menu.
-
setDisableChangeTextWhenNotified
final Unit setDisableChangeTextWhenNotified(Boolean value)
Disable changing text automatically when an item selection notified.
-
setIsFocusable
final Unit setIsFocusable(Boolean isFocusable)
sets isFocusable of the spinner popup. The spinner popup will be got a focus and onSpinnerDismissListener will be replaced.
-
selectItemByIndex
final Unit selectItemByIndex(Integer index)
Select an item by index. This method must be invoked after adapter items are set using the setItems.
- Parameters:
index- An index should be selected.
-
notifyItemSelected
final Unit notifyItemSelected(Integer index, CharSequence changedText)
notifies to PowerSpinnerView of changed information from PowerSpinnerInterface.
-
clearSelectedItem
final Unit clearSelectedItem()
clears a selected item.
-
onDestroy
Unit onDestroy(LifecycleOwner owner)
dismiss automatically when lifecycle owner is destroyed.
-
-
-
-