mirror of
https://github.com/bitwarden/android.git
synced 2024-11-23 01:46:00 +03:00
Update generator item spacing, remove vertical arrangement (#291)
This commit is contained in:
parent
3a17462ad8
commit
f8f89a5903
1 changed files with 30 additions and 2 deletions
|
@ -2,11 +2,12 @@
|
|||
|
||||
package com.x8bit.bitwarden.ui.tools.feature.generator
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.Row
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.fillMaxHeight
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.foundation.layout.wrapContentWidth
|
||||
|
@ -170,7 +171,6 @@ private fun ScrollContent(
|
|||
modifier: Modifier = Modifier,
|
||||
) {
|
||||
Column(
|
||||
verticalArrangement = Arrangement.spacedBy(16.dp),
|
||||
modifier = modifier
|
||||
.fillMaxHeight()
|
||||
.verticalScroll(rememberScrollState()),
|
||||
|
@ -182,12 +182,16 @@ private fun ScrollContent(
|
|||
onRegenerateClick = onRegenerateClick,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
MainStateOptionsItem(
|
||||
selectedType = state.selectedType,
|
||||
possibleMainStates = state.typeOptions,
|
||||
onMainStateOptionClicked = onMainStateOptionClicked,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
BitwardenListHeaderText(
|
||||
label = stringResource(id = R.string.options),
|
||||
modifier = Modifier
|
||||
|
@ -195,6 +199,8 @@ private fun ScrollContent(
|
|||
.padding(horizontal = 16.dp),
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
when (val selectedType = state.selectedType) {
|
||||
is GeneratorState.MainType.Passcode -> {
|
||||
PasscodeTypeItems(
|
||||
|
@ -328,11 +334,16 @@ private fun PasswordTypeContent(
|
|||
passwordTypeState: GeneratorState.MainType.Passcode.PasscodeType.Password,
|
||||
passwordHandlers: PasswordHandlers,
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
PasswordLengthSliderItem(
|
||||
length = passwordTypeState.length,
|
||||
onPasswordSliderLengthChange =
|
||||
passwordHandlers.onPasswordSliderLengthChange,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
|
@ -358,16 +369,25 @@ private fun PasswordTypeContent(
|
|||
passwordHandlers.onPasswordToggleSpecialCharactersChange,
|
||||
)
|
||||
}
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
PasswordMinNumbersCounterItem(
|
||||
minNumbers = passwordTypeState.minNumbers,
|
||||
onPasswordMinNumbersCounterChange =
|
||||
passwordHandlers.onPasswordMinNumbersCounterChange,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
PasswordMinSpecialCharactersCounterItem(
|
||||
minSpecial = passwordTypeState.minSpecial,
|
||||
onPasswordMinSpecialCharactersChange =
|
||||
passwordHandlers.onPasswordMinSpecialCharactersChange,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
PasswordAvoidAmbiguousCharsToggleItem(
|
||||
avoidAmbiguousChars = passwordTypeState.avoidAmbiguousChars,
|
||||
onPasswordToggleAvoidAmbiguousCharsChange =
|
||||
|
@ -544,16 +564,24 @@ private fun PassphraseTypeContent(
|
|||
passphraseTypeState: GeneratorState.MainType.Passcode.PasscodeType.Passphrase,
|
||||
passphraseHandlers: PassphraseHandlers,
|
||||
) {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
PassphraseNumWordsCounterItem(
|
||||
numWords = passphraseTypeState.numWords,
|
||||
onPassphraseNumWordsCounterChange =
|
||||
passphraseHandlers.onPassphraseNumWordsCounterChange,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
|
||||
PassphraseWordSeparatorInputItem(
|
||||
wordSeparator = passphraseTypeState.wordSeparator,
|
||||
onPassphraseWordSeparatorChange =
|
||||
passphraseHandlers.onPassphraseWordSeparatorChange,
|
||||
)
|
||||
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
Column(
|
||||
modifier = Modifier.fillMaxWidth(),
|
||||
) {
|
||||
|
|
Loading…
Reference in a new issue