Merge pull request #470 from c5inco/ui-polish

[UI Polish] Adjusted spacing based on design spec
pull/635/head
Milosz Moczkowski 3 years ago committed by GitHub
commit 1ab9de2bd0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -21,6 +21,7 @@ import android.net.Uri
import androidx.annotation.ColorInt import androidx.annotation.ColorInt
import androidx.browser.customtabs.CustomTabColorSchemeParams import androidx.browser.customtabs.CustomTabColorSchemeParams
import androidx.browser.customtabs.CustomTabsIntent import androidx.browser.customtabs.CustomTabsIntent
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.LazyGridScope import androidx.compose.foundation.lazy.grid.LazyGridScope
@ -31,6 +32,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.tooling.preview.Devices import androidx.compose.ui.tooling.preview.Devices
@ -78,6 +80,7 @@ fun LazyGridScope.newsFeed(
) )
}, },
onTopicClick = onTopicClick, onTopicClick = onTopicClick,
modifier = Modifier.padding(horizontal = 8.dp),
) )
} }
} }

@ -159,7 +159,7 @@ private fun EmptyState(modifier: Modifier = Modifier) {
contentDescription = null, contentDescription = null,
) )
Spacer(modifier = Modifier.height(16.dp)) Spacer(modifier = Modifier.height(48.dp))
Text( Text(
text = stringResource(id = R.string.bookmarks_empty_error), text = stringResource(id = R.string.bookmarks_empty_error),

@ -38,6 +38,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.widthIn
import androidx.compose.foundation.layout.windowInsetsBottomHeight import androidx.compose.foundation.layout.windowInsetsBottomHeight
import androidx.compose.foundation.lazy.LazyListScope import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.grid.GridCells import androidx.compose.foundation.lazy.grid.GridCells
@ -247,7 +248,7 @@ private fun LazyGridScope.onboarding(
text = stringResource(R.string.onboarding_guidance_subtitle), text = stringResource(R.string.onboarding_guidance_subtitle),
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.padding(top = 8.dp, start = 16.dp, end = 16.dp), .padding(top = 8.dp, start = 24.dp, end = 24.dp),
textAlign = TextAlign.Center, textAlign = TextAlign.Center,
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
) )
@ -265,8 +266,9 @@ private fun LazyGridScope.onboarding(
onClick = saveFollowedTopics, onClick = saveFollowedTopics,
enabled = onboardingUiState.isDismissable, enabled = onboardingUiState.isDismissable,
modifier = Modifier modifier = Modifier
.padding(horizontal = 40.dp) .padding(horizontal = 24.dp)
.width(364.dp), .widthIn(364.dp)
.fillMaxWidth(),
) { ) {
Text( Text(
text = stringResource(R.string.done), text = stringResource(R.string.done),

@ -65,7 +65,7 @@ fun InterestsItem(
.padding(vertical = itemSeparation), .padding(vertical = itemSeparation),
) { ) {
InterestsIcon(topicImageUrl, iconModifier.size(64.dp)) InterestsIcon(topicImageUrl, iconModifier.size(64.dp))
Spacer(modifier = Modifier.width(16.dp)) Spacer(modifier = Modifier.width(24.dp))
InterestContent(name, description) InterestContent(name, description)
} }
NiaIconToggleButton( NiaIconToggleButton(

@ -38,9 +38,9 @@ fun TopicsTabContent(
) { ) {
LazyColumn( LazyColumn(
modifier = modifier modifier = modifier
.padding(horizontal = 16.dp) .padding(horizontal = 24.dp)
.testTag("interests:topics"), .testTag("interests:topics"),
contentPadding = PaddingValues(top = 8.dp), contentPadding = PaddingValues(vertical = 16.dp),
) { ) {
topics.forEach { followableTopic -> topics.forEach { followableTopic ->
val topicId = followableTopic.topic.id val topicId = followableTopic.topic.id

Loading…
Cancel
Save