mirror of
https://github.com/bitwarden/android.git
synced 2024-11-21 17:05:44 +03:00
Update Slider UI after Compose BOM update (#3885)
This commit is contained in:
parent
b7544ef7f4
commit
fa93985a2e
1 changed files with 28 additions and 8 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
package com.x8bit.bitwarden.ui.tools.feature.generator
|
||||
|
||||
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.ColumnScope
|
||||
import androidx.compose.foundation.layout.Row
|
||||
|
@ -49,6 +50,7 @@ import androidx.compose.ui.semantics.semantics
|
|||
import androidx.compose.ui.text.input.KeyboardType
|
||||
import androidx.compose.ui.tooling.preview.Preview
|
||||
import androidx.compose.ui.unit.Dp
|
||||
import androidx.compose.ui.unit.DpSize
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.net.toUri
|
||||
import androidx.hilt.navigation.compose.hiltViewModel
|
||||
|
@ -582,6 +584,7 @@ private fun ColumnScope.PasswordTypeContent(
|
|||
)
|
||||
}
|
||||
|
||||
@OptIn(ExperimentalMaterial3Api::class)
|
||||
@Suppress("LongMethod")
|
||||
@Composable
|
||||
private fun PasswordLengthSliderItem(
|
||||
|
@ -646,6 +649,12 @@ private fun PasswordLengthSliderItem(
|
|||
.width(16.dp + labelTextWidth + 16.dp),
|
||||
)
|
||||
|
||||
val colors = SliderDefaults.colors(
|
||||
activeTickColor = Color.Transparent,
|
||||
inactiveTickColor = Color.Transparent,
|
||||
disabledActiveTickColor = Color.Transparent,
|
||||
disabledInactiveTickColor = Color.Transparent,
|
||||
)
|
||||
Slider(
|
||||
value = sliderValue.toFloat(),
|
||||
onValueChange = { newValue ->
|
||||
|
@ -656,16 +665,27 @@ private fun PasswordLengthSliderItem(
|
|||
},
|
||||
valueRange = sliderRange,
|
||||
steps = maxValue - 1,
|
||||
colors = SliderDefaults.colors(
|
||||
activeTickColor = Color.Transparent,
|
||||
inactiveTickColor = Color.Transparent,
|
||||
disabledActiveTickColor = Color.Transparent,
|
||||
disabledInactiveTickColor = Color.Transparent,
|
||||
),
|
||||
colors = colors,
|
||||
thumb = {
|
||||
SliderDefaults.Thumb(
|
||||
interactionSource = remember { MutableInteractionSource() },
|
||||
colors = colors,
|
||||
thumbSize = DpSize(width = 20.dp, height = 20.dp),
|
||||
)
|
||||
},
|
||||
track = { sliderState ->
|
||||
SliderDefaults.Track(
|
||||
modifier = Modifier.height(height = 4.dp),
|
||||
drawStopIndicator = null,
|
||||
colors = colors,
|
||||
sliderState = sliderState,
|
||||
thumbTrackGapSize = 0.dp,
|
||||
)
|
||||
},
|
||||
modifier = Modifier
|
||||
.focusProperties { canFocus = false }
|
||||
.testTag("PasswordLengthSlider")
|
||||
.weight(1f),
|
||||
.testTag(tag = "PasswordLengthSlider")
|
||||
.weight(weight = 1f),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue