react-native-slider icon indicating copy to clipboard operation
react-native-slider copied to clipboard

feat(android): progressbar thickness

Open lovegaoshi opened this issue 6 months ago • 0 comments

Summary:

addresses #85 for android only. This PR adds props for android to adjust progress bar thickness, roundness, and thumb size, because android's AppCompatSeekBar is very thin.

The progress bar thickness is done by setting all of AppCompatSeekBar's getProgressDrawable's Layers (where for android 15, 0 is the background; 1 is unknown; 2 is the current progress) height to a given value.

The roundness is done by wrapping all of these layers into a com.facebook.drawee.drawable.RoundedCornersDrawable then applying a radius.

The thumb size is done by using a custom Drawable (ForwardDrawable wrapping the original getThumb() Drawable) to draw a circle with a given size at the original thumb's getRect.

Test Plan:

with prop thickness={100}, it should look like Image

with prop thickness={100} and roundness={100}, it should look like Image

with prop thickness={100} and roundness={100} and thumbsize={100}, it should look like Image

above tests were done with android 14+ devices. tested iOS builds does NOT break with android only props.

lovegaoshi avatar Jun 26 '25 21:06 lovegaoshi