Skip to content

Commit

Permalink
Adds customization of strokeCap to LinearProgressBar
Browse files Browse the repository at this point in the history
  • Loading branch information
Tweener committed Mar 14, 2024
1 parent 7fd3318 commit 4351648
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package com.tweener.czan.designsystem.atom.bars.progress

import androidx.annotation.FloatRange
import androidx.compose.material3.LinearProgressIndicator
import androidx.compose.material3.ProgressIndicatorDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.StrokeCap
import com.tweener.czan.theme.CzanUiDefaults

/**
Expand All @@ -17,12 +19,14 @@ fun LinearProgressBar(
modifier: Modifier = Modifier,
@FloatRange(from = 0.0, to = 1.0) progress: Float = 0f,
color: Color = CzanUiDefaults.ProgressBar.color,
selectedColor: Color = CzanUiDefaults.ProgressBar.selectedColor
selectedColor: Color = CzanUiDefaults.ProgressBar.selectedColor,
strokeCap: StrokeCap = ProgressIndicatorDefaults.LinearStrokeCap,
) {
LinearProgressIndicator(
modifier = modifier,
progress = { progress },
color = color,
trackColor = selectedColor
trackColor = selectedColor,
strokeCap = strokeCap,
)
}

0 comments on commit 4351648

Please sign in to comment.