Skip to content

Commit

Permalink
fix(android): description of pinfall
Browse files Browse the repository at this point in the history
  • Loading branch information
autoreleasefool committed Sep 13, 2024
1 parent de587cf commit a076f15
Showing 1 changed file with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
Expand All @@ -28,11 +29,13 @@ import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import ca.josephroque.bowlingcompanion.core.designsystem.components.ArchiveDialog
import ca.josephroque.bowlingcompanion.core.designsystem.components.DiscardChangesDialog
import ca.josephroque.bowlingcompanion.core.designsystem.components.form.FormRadioGroup
import ca.josephroque.bowlingcompanion.core.designsystem.components.form.FormSection
import ca.josephroque.bowlingcompanion.core.designsystem.components.form.FormSectionFooter
import ca.josephroque.bowlingcompanion.core.designsystem.components.form.FormSwitch
import ca.josephroque.bowlingcompanion.core.model.ExcludeFromStatistics
import ca.josephroque.bowlingcompanion.core.model.LeagueRecurrence
Expand Down Expand Up @@ -129,8 +132,6 @@ fun LeagueForm(

HorizontalDivider()

// TODO: add explanation with R.string-league_form_property_pinfall_footer

IncludeAdditionalPinFallSwitch(
includeAdditionalPinFall = state.includeAdditionalPinFall,
onIncludeAdditionalPinFallChanged = {
Expand All @@ -143,8 +144,7 @@ fun LeagueForm(
Column(
verticalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier
.fillMaxWidth()
.padding(bottom = 16.dp),
.fillMaxWidth(),
) {
AdditionalPinFallField(
additionalPinFall = state.additionalPinFall,
Expand Down Expand Up @@ -173,6 +173,8 @@ fun LeagueForm(
IncludeAdditionalPinFall.NONE -> Unit
}

FormSectionFooter(footerResourceId = R.string.league_form_property_pinfall_footer)

HorizontalDivider()
FormSection(Modifier.padding(top = 16.dp)) {
ExcludeFromStatisticsPicker(
Expand Down Expand Up @@ -424,3 +426,16 @@ private fun AdditionalGamesField(additionalGames: Int, onAdditionalGamesChanged:
.padding(horizontal = 16.dp),
)
}

@Preview
@Composable
private fun LeagueFormPreview() {
Surface {
LeagueForm(
state = LeagueFormUiState(
// includeAdditionalPinFall = IncludeAdditionalPinFall.INCLUDE
),
onAction = {},
)
}
}

0 comments on commit a076f15

Please sign in to comment.