Skip to content

Commit

Permalink
Merge branch 'fix/fab-overlap' into 'master'
Browse files Browse the repository at this point in the history
Add extra bottom padding to screens with FAB

See merge request fmasa/wfrp-master!201
  • Loading branch information
fmasa committed Apr 3, 2021
2 parents 4833023 + 3bf58b4 commit 5db3748
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import cz.frantisekmasa.wfrp_master.core.ui.buttons.BackButton
import cz.frantisekmasa.wfrp_master.core.ui.dialogs.DialogState
import cz.frantisekmasa.wfrp_master.core.ui.primitives.ContextMenu
import cz.frantisekmasa.wfrp_master.core.ui.primitives.FullScreenProgress
import cz.frantisekmasa.wfrp_master.core.ui.primitives.Spacing
import cz.frantisekmasa.wfrp_master.core.ui.primitives.WithContextMenu
import cz.frantisekmasa.wfrp_master.core.ui.scaffolding.Subtitle
import cz.frantisekmasa.wfrp_master.core.ui.scaffolding.TopBarAction
Expand Down Expand Up @@ -105,7 +106,7 @@ fun <T : CompendiumItem> CompendiumTab(
items == null -> FullScreenProgress()
items.isEmpty() -> emptyUI()
else -> {
LazyColumn {
LazyColumn(contentPadding = PaddingValues(bottom = Spacing.bottomPaddingUnderFab)) {
items(items) { item ->
WithContextMenu(
items = listOf(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package cz.frantisekmasa.wfrp_master.core.ui.primitives

import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.ui.unit.dp

object Spacing {
Expand All @@ -9,4 +10,12 @@ object Spacing {
val small = 8.dp
val tiny = 4.dp
val bodyPadding = extraLarge

val bottomPaddingUnderFab = 80.dp
val bodyPaddingWithFab = PaddingValues(
start = bodyPadding,
top = bodyPadding,
end = bodyPadding,
bottom = bottomPaddingUnderFab,
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ private fun MainContainer(viewModel: SpellsViewModel) {

var editedSpellId: UUID? by rememberSaveable { mutableStateOf(null) }

LazyColumn {
LazyColumn(contentPadding = PaddingValues(bottom = Spacing.bottomPaddingUnderFab)) {
items(spells) { spell ->
SpellItem(
spell,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ internal fun CharacterCharacteristicsScreen(
Column(
Modifier
.verticalScroll(rememberScrollState())
.padding(top = Spacing.small),
.padding(top = Spacing.small, bottom = Spacing.bottomPaddingUnderFab),
) {
PointsSection(character.getPoints()) { points -> viewModel.updatePoints { points } }
CharacteristicsSection(character.getCharacteristics())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ import cz.frantisekmasa.wfrp_master.compendium.ui.CompendiumViewModel
import cz.muni.fi.rpg.R
import cz.frantisekmasa.wfrp_master.core.domain.character.Character
import cz.frantisekmasa.wfrp_master.core.domain.identifiers.CharacterId
import cz.frantisekmasa.wfrp_master.core.ui.primitives.ContextMenu
import cz.frantisekmasa.wfrp_master.core.ui.primitives.EmptyUI
import cz.frantisekmasa.wfrp_master.core.viewModel.viewModel
import cz.frantisekmasa.wfrp_master.core.domain.party.Invitation
import cz.frantisekmasa.wfrp_master.core.domain.party.PartyId
import cz.frantisekmasa.wfrp_master.core.ui.buttons.PrimaryButton
import cz.frantisekmasa.wfrp_master.core.ui.primitives.CardContainer
import cz.frantisekmasa.wfrp_master.core.ui.primitives.CardItem
import cz.frantisekmasa.wfrp_master.core.ui.primitives.*
import cz.muni.fi.rpg.ui.common.composables.*
import cz.muni.fi.rpg.ui.gameMaster.adapter.Player
import cz.frantisekmasa.wfrp_master.navigation.Route
import cz.frantisekmasa.wfrp_master.navigation.Routing
import cz.muni.fi.rpg.ui.common.composables.CardTitle
import cz.muni.fi.rpg.ui.gameMaster.rolls.SkillTestDialog
import cz.muni.fi.rpg.viewModels.GameMasterViewModel
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -69,7 +67,8 @@ internal fun PartySummaryScreen(
Column(
Modifier
.background(MaterialTheme.colors.background)
.verticalScroll(rememberScrollState()),
.verticalScroll(rememberScrollState())
.padding(bottom = Spacing.bottomPaddingUnderFab)
) {
val party = viewModel.party.observeAsState().value
?: return@Column
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private fun MainContainer(
.fillMaxSize()
.background(MaterialTheme.colors.background)
.verticalScroll(rememberScrollState())
.padding(top = 6.dp),
.padding(top = 6.dp, bottom = Spacing.bottomPaddingUnderFab),
) {
DescriptionCard(viewModel)
CombatantsCard(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ private fun EncounterList(
.background(MaterialTheme.colors.background)
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(Spacing.bodyPadding),
.padding(Spacing.bodyPaddingWithFab),
horizontalAlignment = Alignment.CenterHorizontally,
) {
DraggableListFor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ fun PartyList(
) {
LazyColumn(
Modifier.fillMaxHeight(),
contentPadding = PaddingValues(top = 12.dp)
contentPadding = PaddingValues(top = 12.dp, bottom = Spacing.bottomPaddingUnderFab)
) {
items(parties) { party ->
val isGameMaster =
Expand Down

0 comments on commit 5db3748

Please sign in to comment.