SeslProgressBar
SeslProgressBar is a base widget for visualizing and controlling progress in One UI, supporting both determinate and indeterminate modes, custom shapes, and smooth gradient styling.
Configurable functionalities (via XML attributes and/or public methods):
- Progress Range:
- Progress Values:
- Set or get the current progress with setProgress, getProgress, or
android:progress. - Set or get secondary progress with setSecondaryProgress, getSecondaryProgress, or
android:secondaryProgress.
- Set or get the current progress with setProgress, getProgress, or
- Indeterminate Mode:
- Enable indeterminate mode with setIndeterminate or
android:indeterminate. - Customize the indeterminate drawable using setIndeterminateDrawable or
android:indeterminateDrawable.
- Enable indeterminate mode with setIndeterminate or
- Progress Drawable:
- Set the progress drawable with setProgressDrawable or
android:progressDrawable.
- Set the progress drawable with setProgressDrawable or
- Tinting:
- Apply tint to progress and indeterminate drawables using setProgressTintList, setIndeterminateTintList, or
android:progressTintandandroid:indeterminateTintattributes.
- Apply tint to progress and indeterminate drawables using setProgressTintList, setIndeterminateTintList, or
- Dimensions &Style:
- Control size and appearance using
android:minWidth,android:maxWidth,android:minHeight,android:maxHeight, andandroid:styleattributes.
- Control size and appearance using
- Accessibility:
- Supports accessibility events and node info customization for assistive technologies.
SESL9/8.5 Enhancements:
- Gradient Modes: Introduced MODE_GRADIENT_HORIZONTAL and MODE_GRADIENT_CIRCLE modes for animated linear and circular sweep gradient progress indicators.
- Gradient Smoothing: Integrates SeslProgressBarGradientSmoother to apply Catmull-Rom cubic spline interpolation over gradient color stops and positions for smoother color transitions.
- Custom Circle Sizing: Supports XML configuration for stroke width (
R.styleable#ProgressBar_seslCircleModeStrokeWidth) and padding (R.styleable#ProgressBar_seslCircleModePadding) whenseslUseCustomWidthForCircleModeis enabled. - Animated Gradient Shaders: Drives continuous gradient translation and rotation via createGradientProgressAnimator and GradientHorizontalProgressDrawable.
ProgressBar Modes:
- MODE_STANDARD: Default horizontal progress bar.
- MODE_WARNING: Progress bar with warning state styling.
- MODE_DUAL_COLOR: Dual-color progress indicator.
- MODE_VERTICAL: Vertical orientation progress bar.
- MODE_SPLIT: Split progress bar.
- MODE_EXPAND: Expandable horizontal progress bar.
- MODE_EXPAND_VERTICAL: Expandable vertical progress bar.
- MODE_CIRCLE: Circular progress bar.
- MODE_LEVEL_BAR: Level bar style indicator.
- MODE_GRADIENT_HORIZONTAL: Horizontal progress bar with animated smoothed linear gradient.
- MODE_GRADIENT_CIRCLE: Circular progress bar with animated smoothed sweep gradient.
See also
Inheritors
Constructors
Link copied to clipboard
Create a new progress bar with range 0...100 and initial progress of 0.
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int)
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int, defStyleRes: Int)
Properties
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns the drawable currently used to draw the progress bar.
Link copied to clipboard
Get the drawable used to draw the progress bar in indeterminate mode.
Link copied to clipboard
Link copied to clipboard
Returns the blending mode used to apply the tint to the indeterminate drawable, if specified.
Link copied to clipboard
Gets the acceleration curve type for the indeterminate animation.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Get the progress bar's current level of progress.
Link copied to clipboard
Returns the tint applied to the progress background, if specified.
Link copied to clipboard
Link copied to clipboard
Get the drawable used to draw the progress bar in progress mode.
Link copied to clipboard
Returns the tint applied to the progress drawable, if specified.
Link copied to clipboard
Returns the blending mode used to apply the tint to the progress drawable, if specified.
Link copied to clipboard
Get the progress bar's current level of secondary progress.
Link copied to clipboard
Returns the tint applied to the secondary progress drawable, if specified.
Link copied to clipboard
Returns the blending mode used to apply the tint to the secondary progress drawable, if specified.
Link copied to clipboard
Increase the progress bar's progress by the specified amount.
Link copied to clipboard
Increase the progress bar's secondary progress by the specified amount.
Link copied to clipboard
Link copied to clipboard
Returns whether the ProgressBar is animating or not.
Link copied to clipboard
Indicate whether this progress bar is in indeterminate mode.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Called when the visual state of a progress indicator changes.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Change the indeterminate mode for this progress bar.
Link copied to clipboard
Define the drawable used to draw the progress bar in indeterminate mode.
Link copied to clipboard
Define the tileable drawable used to draw the progress bar in indeterminate mode.
Link copied to clipboard
Applies a tint to the indeterminate drawable.
Link copied to clipboard
Specifies the blending mode used to apply the tint specified by setIndeterminateTintList to the indeterminate drawable.
Link copied to clipboard
Sets the acceleration curve for the indeterminate animation.
Link copied to clipboard
Sets the maximum height the progress bar can have.
Link copied to clipboard
Sets the maximum width the progress bar can have.
Link copied to clipboard
Sets the minimum height the progress bar can have.
Link copied to clipboard
Sets the minimum width the progress bar can have.
Link copied to clipboard
Sets the current progress to the specified value.
Sets the current progress to the specified value, optionally animating the visual position between the current and target values.
Link copied to clipboard
Applies a tint to the progress background, if one exists.
Link copied to clipboard
Specifies the blending mode used to apply the tint specified by setProgressBackgroundTintList} to the progress background.
Link copied to clipboard
Define the drawable used to draw the progress bar in progress mode.
Link copied to clipboard
Define the tileable drawable used to draw the progress bar in progress mode.
Link copied to clipboard
Applies a tint to the progress indicator, if one exists, or to the entire progress drawable otherwise.
Link copied to clipboard
Specifies the blending mode used to apply the tint specified by setProgressTintList} to the progress indicator.
Link copied to clipboard
Set the current secondary progress to the specified value.
Link copied to clipboard
Applies a tint to the secondary progress indicator, if one exists.
Link copied to clipboard
Specifies the blending mode used to apply the tint specified by setSecondaryProgressTintList} to the secondary progress indicator.