Skip to content

Commit

Permalink
fix(settings): top padding
Browse files Browse the repository at this point in the history
  • Loading branch information
z-huang authored and Malopieds committed Aug 22, 2024
1 parent a8eb8ce commit bfb844e
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsPadding
Expand Down Expand Up @@ -52,10 +54,12 @@ fun AboutScreen(
modifier =
Modifier
.fillMaxWidth()
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

Spacer(Modifier.height(4.dp))

Image(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import androidx.compose.foundation.isSystemInDarkTheme
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.WindowInsetsSides
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -209,9 +212,11 @@ fun AppearanceSettings(

Column(
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

PreferenceGroupTitle(
title = stringResource(R.string.theme),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ package com.malopieds.innertune.ui.screens.settings
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -50,9 +53,11 @@ fun BackupAndRestore(

Column(
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

PreferenceEntry(
title = { Text(stringResource(R.string.backup)) },
icon = { Icon(painterResource(R.drawable.backup), null) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package com.malopieds.innertune.ui.screens.settings

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -78,9 +81,11 @@ fun ContentSettings(

Column(
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

PreferenceEntry(
title = { Text(if (isLoggedIn) accountName else stringResource(R.string.login)) },
description =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.windowInsetsPadding
Expand Down Expand Up @@ -106,9 +108,11 @@ fun DiscordSettings(

Column(
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

AnimatedVisibility(
visible = !infoDismissed,
) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.malopieds.innertune.ui.screens.settings

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -41,9 +44,11 @@ fun PlayerSettings(

Column(
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

EnumListPreference(
title = { Text(stringResource(R.string.audio_quality)) },
icon = { Icon(painterResource(R.drawable.graphic_eq), null) },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.malopieds.innertune.ui.screens.settings

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -132,9 +135,11 @@ fun PrivacySettings(

Column(
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

SwitchPreference(
title = { Text(stringResource(R.string.pause_listen_history)) },
icon = { Icon(painterResource(R.drawable.history), null) },
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package com.malopieds.innertune.ui.screens.settings

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
Expand Down Expand Up @@ -34,11 +37,12 @@ fun SettingsScreen(
val uriHandler = LocalUriHandler.current

Column(
modifier =
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.verticalScroll(rememberScrollState()),
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

PreferenceEntry(
title = { Text(stringResource(R.string.appearance)) },
icon = { Icon(painterResource(R.drawable.palette), null) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ package com.malopieds.innertune.ui.screens.settings

import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
Expand Down Expand Up @@ -101,9 +104,11 @@ fun StorageSettings(

Column(
Modifier
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current)
.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom))
.verticalScroll(rememberScrollState()),
) {
Spacer(Modifier.windowInsetsPadding(LocalPlayerAwareWindowInsets.current.only(WindowInsetsSides.Top)))

PreferenceGroupTitle(
title = stringResource(R.string.downloaded_songs),
)
Expand Down

0 comments on commit bfb844e

Please sign in to comment.