@@ -17,6 +17,7 @@ import androidx.compose.ui.Alignment
1717import androidx.compose.ui.Modifier
1818import androidx.compose.ui.draw.shadow
1919import androidx.compose.ui.geometry.Offset
20+ import androidx.compose.ui.graphics.Brush
2021import androidx.compose.ui.graphics.Color
2122import androidx.compose.ui.graphics.Shape
2223import androidx.compose.ui.platform.LocalDensity
@@ -45,6 +46,7 @@ internal fun DefaultOverlay(
4546
4647 val verticalThumbMove = overlayStyle.verticalThumbMove
4748 val dividerColor = overlayStyle.dividerColor
49+ val dividerBrush = overlayStyle.dividerBrush
4850 val dividerWidth = overlayStyle.dividerWidth
4951 val thumbBackgroundColor = overlayStyle.thumbBackgroundColor
5052 val thumbTintColor = overlayStyle.thumbTintColor
@@ -90,7 +92,14 @@ internal fun DefaultOverlay(
9092 ) {
9193 Canvas (modifier = Modifier .fillMaxSize()) {
9294
93- drawLine(
95+ dividerBrush?.let {
96+ drawLine(
97+ dividerBrush,
98+ strokeWidth = dividerWidth.toPx(),
99+ start = Offset (linePosition, 0f ),
100+ end = Offset (linePosition, size.height)
101+ )
102+ } ? : drawLine(
94103 dividerColor,
95104 strokeWidth = dividerWidth.toPx(),
96105 start = Offset (linePosition, 0f ),
@@ -117,8 +126,9 @@ internal fun DefaultOverlay(
117126/* *
118127 * Values for styling [DefaultOverlay]
119128 * @param verticalThumbMove when true thumb can move vertically based on user touch
120- * @param dividerColor color if divider line
121- * @param dividerWidth width if divider line
129+ * @param dividerColor color of divider line
130+ * @param dividerBrush brush to set color gradiant in divider line
131+ * @param dividerWidth width of divider line
122132 * @param thumbBackgroundColor background color of thumb [Icon]
123133 * @param thumbTintColor tint color of thumb [Icon]
124134 * @param thumbShape shape of thumb [Icon]
@@ -131,6 +141,7 @@ internal fun DefaultOverlay(
131141@Immutable
132142class OverlayStyle (
133143 val dividerColor : Color = Color .White ,
144+ val dividerBrush : Brush ? = null ,
134145 val dividerWidth : Dp = 1.5 .dp,
135146 val verticalThumbMove : Boolean = false ,
136147 val thumbBackgroundColor : Color = Color .White ,
0 commit comments