Skip to content

Commit

Permalink
Add padding for navigationBars when fully scrolled (Fixes #45)
Browse files Browse the repository at this point in the history
  • Loading branch information
soupslurpr committed Jan 5, 2024
1 parent 37c3dad commit bea6e2d
Show file tree
Hide file tree
Showing 7 changed files with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import android.content.pm.PackageManager
import android.graphics.drawable.Drawable
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
Expand Down Expand Up @@ -76,6 +81,9 @@ fun AppListScreen(
)
}
}
item {
Spacer(Modifier.padding(WindowInsets.navigationBars.asPaddingValues()))
}
}
}

Expand Down
10 changes: 10 additions & 0 deletions app/src/main/kotlin/dev/soupslurpr/appverifier/ui/CreditsScreen.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package dev.soupslurpr.appverifier.ui

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material.icons.Icons
Expand Down Expand Up @@ -1148,6 +1152,12 @@ fun CreditsScreen() {
dependencyLicense = APACHE2LICENSE,
)
}


// This MUST stay at the bottom or else when fully scrolled some credits will be blocked.
item {
Spacer(Modifier.padding(WindowInsets.navigationBars.asPaddingValues()))
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package dev.soupslurpr.appverifier.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand All @@ -20,5 +24,7 @@ fun LicenseScreen() {
modifier = Modifier.padding(horizontal = 15.dp),
text = stringResource(R.string.full_license)
)

Spacer(Modifier.padding(WindowInsets.navigationBars.asPaddingValues()))
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package dev.soupslurpr.appverifier.ui

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand All @@ -20,5 +24,7 @@ fun PrivacyPolicyScreen() {
modifier = Modifier.padding(horizontal = 15.dp),
text = stringResource(R.string.full_privacy_policy)
)

Spacer(Modifier.padding(WindowInsets.navigationBars.asPaddingValues()))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ package dev.soupslurpr.appverifier.ui
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.selection.toggleable
Expand Down Expand Up @@ -131,6 +135,8 @@ fun SettingsScreen(
}
)
}

Spacer(Modifier.padding(WindowInsets.navigationBars.asPaddingValues()))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,7 @@ fun StartupScreen(
Spacer(modifier = modifier.width(8.dp))
Text(stringResource(R.string.settings))
}

Spacer(Modifier.padding(WindowInsets.navigationBars.asPaddingValues()))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ 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.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.navigationBars
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width
Expand Down Expand Up @@ -191,6 +194,8 @@ fun VerifyAppScreen(
}
}
}

Spacer(Modifier.padding(WindowInsets.navigationBars.asPaddingValues()))
}

if (showMoreInfoAboutInternalDatabaseStatusDialog) {
Expand Down

0 comments on commit bea6e2d

Please sign in to comment.