Skip to content

Commit

Permalink
Merge pull request #191 from niscy-eudiw/bugfix/fix_modals_colors_and…
Browse files Browse the repository at this point in the history
…_paddings

Bugfix/fix modals colors and paddings
  • Loading branch information
stzouvaras authored Sep 26, 2024
2 parents d7d5613 + 898ce3e commit b59b7b6
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -739,44 +739,6 @@ private fun DocumentContent(dataItem: DocumentUi) {
}
}

@Composable
private fun IssuedDocument(dataItem: DocumentUi) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(SPACING_MEDIUM.dp),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center
) {
Box {
WrapIcon(
iconData = AppIcons.Id,
customTint = MaterialTheme.colorScheme.primary
)
if (dataItem.documentHasExpired) {
IconWarningIndicator(
backgroundColor = MaterialTheme.colorScheme.backgroundDefault
)
}
}
Box(
modifier = Modifier
.wrapContentWidth()
.height(28.dp),
contentAlignment = Alignment.Center
) {
ScalableText(
text = dataItem.documentName,
textStyle = MaterialTheme.typography.titleMedium.copy(
color = MaterialTheme.colorScheme.textPrimaryDark
)
)
}
VSpacer.Small()
ExpirationInfo(dataItem)
}
}

@Composable
private fun ExpirationInfo(
document: DocumentUi,
Expand Down Expand Up @@ -890,15 +852,46 @@ private fun DashboardScreenPreview() {
documentImage = "image3",
documentDetails = emptyList(),
documentIssuanceState = DocumentUiIssuanceState.Pending
)
),
DocumentUi(
documentId = "3",
documentName = "National ID",
documentIdentifier = DocumentIdentifier.PID,
documentExpirationDateFormatted = "30 Mar 2050",
documentHasExpired = false,
documentImage = "image1",
documentDetails = emptyList(),
documentIssuanceState = DocumentUiIssuanceState.Failed
),
)
Content(
context = context,
state = State(
allowUserInteraction = true,
isLoading = false,
error = null,
userFirstName = "Jane",
documents = documents + documents
documents = documents,
isBottomSheetOpen = true,
sheetContent = DashboardBottomSheetContent.Options(
listOf(
ModalOptionUi(
title = stringResource(R.string.dashboard_bottom_sheet_options_action_1),
icon = AppIcons.Edit,
event = Event.BottomSheet.Options.OpenChangeQuickPin
),
ModalOptionUi(
title = stringResource(R.string.dashboard_bottom_sheet_options_action_2),
icon = AppIcons.QrScanner,
event = Event.BottomSheet.Options.OpenScanQr
),
ModalOptionUi(
title = stringResource(R.string.dashboard_bottom_sheet_options_action_3),
icon = AppIcons.OpenNew,
event = Event.BottomSheet.Options.RetrieveLogs
)
)
)
),
effectFlow = Channel<Effect>().receiveAsFlow(),
onEventSend = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.navigation.NavController
import eu.europa.ec.resourceslogic.R
import eu.europa.ec.resourceslogic.theme.values.backgroundPaper
import eu.europa.ec.resourceslogic.theme.values.bottomCorneredShapeSmall
import eu.europa.ec.uilogic.component.AppIcons
import eu.europa.ec.uilogic.component.preview.PreviewTheme
Expand Down Expand Up @@ -106,7 +105,7 @@ private fun Content(
.fillMaxWidth()
.fillMaxHeight(animatedWeight)
.background(
color = MaterialTheme.colorScheme.backgroundPaper,
color = MaterialTheme.colorScheme.background,
shape = MaterialTheme.shapes.bottomCorneredShapeSmall
),
contentAlignment = Alignment.Center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ data class ThemeColorsTemplate(
surfaceContainer = Color.Unspecified,
surfaceContainerHigh = Color.Unspecified,
surfaceContainerHighest = Color.Unspecified,
surfaceContainerLow = Color.Unspecified,
surfaceContainerLow = Color(background),
surfaceContainerLowest = Color.Unspecified
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ class ThemeColors {
internal const val eudiw_theme_light_textDisabledDark: Long = 0x61000000
internal const val eudiw_theme_light_dividerDark: Long = 0x1F000000
internal const val eudiw_theme_light_backgroundDefault: Long = 0xFFF5F5F5
const val eudiw_theme_light_backgroundPaper: Long = 0xFFFFFFFF
internal const val eudiw_theme_light_textSecondaryLight: Long = 0xB3FFFFFF
internal const val eudiw_theme_light_textDisabledLight: Long = 0x80FFFFFF

Expand All @@ -64,7 +63,6 @@ class ThemeColors {
internal const val eudiw_theme_dark_textDisabledDark: Long = 0xFF646670
internal const val eudiw_theme_dark_dividerDark: Long = 0x1FFFFFFF
internal const val eudiw_theme_dark_backgroundDefault: Long = 0xFF44474F
const val eudiw_theme_dark_backgroundPaper: Long = 0xFF000000
internal const val eudiw_theme_dark_textSecondaryLight: Long = 0xB3000000
internal const val eudiw_theme_dark_textDisabledLight: Long = 0x80000000

Expand All @@ -85,7 +83,7 @@ class ThemeColors {
private const val eudiw_theme_light_errorContainer: Long = 0xFFFFDAD5
private const val eudiw_theme_light_onError: Long = white
private const val eudiw_theme_light_onErrorContainer: Long = 0xFF410002
private const val eudiw_theme_light_background: Long = white
const val eudiw_theme_light_background: Long = white
private const val eudiw_theme_light_onBackground: Long = black
private const val eudiw_theme_light_surface: Long = white
private const val eudiw_theme_light_onSurface: Long = black
Expand Down Expand Up @@ -116,7 +114,7 @@ class ThemeColors {
private const val eudiw_theme_dark_errorContainer: Long = 0xFF930009
private const val eudiw_theme_dark_onError: Long = 0xFF690004
private const val eudiw_theme_dark_onErrorContainer: Long = 0xFFFFDAD5
private const val eudiw_theme_dark_background: Long = black
const val eudiw_theme_dark_background: Long = black
private const val eudiw_theme_dark_onBackground: Long = white
private const val eudiw_theme_dark_surface: Long = black
private const val eudiw_theme_dark_onSurface: Long = white
Expand Down Expand Up @@ -278,13 +276,6 @@ class ThemeColors {
Color(eudiw_theme_light_backgroundDefault)
}

val backgroundPaper: Color
get() = if (isInDarkMode) {
Color(eudiw_theme_dark_backgroundPaper)
} else {
Color(eudiw_theme_light_backgroundPaper)
}

val textSecondaryLight: Color
get() = if (isInDarkMode) {
Color(eudiw_theme_dark_textSecondaryLight)
Expand Down Expand Up @@ -338,13 +329,6 @@ val ColorScheme.backgroundDefault: Color
Color(ThemeColors.eudiw_theme_light_backgroundDefault)
}

val ColorScheme.backgroundPaper: Color
@Composable get() = if (isSystemInDarkTheme()) {
Color(ThemeColors.eudiw_theme_dark_backgroundPaper)
} else {
Color(ThemeColors.eudiw_theme_light_backgroundPaper)
}

val ColorScheme.textSecondaryLight: Color
@Composable get() = if (isSystemInDarkTheme()) {
Color(ThemeColors.eudiw_theme_dark_textSecondaryLight)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.navigation.NavController
import eu.europa.ec.resourceslogic.theme.values.backgroundPaper
import eu.europa.ec.uilogic.component.AppIcons
import eu.europa.ec.uilogic.component.utils.OneTimeLaunchedEffect
import eu.europa.ec.uilogic.component.wrap.WrapImage
Expand Down Expand Up @@ -89,7 +88,7 @@ private fun Content(
Modifier
.fillMaxSize()
.padding(paddingValues)
.background(MaterialTheme.colorScheme.backgroundPaper),
.background(MaterialTheme.colorScheme.background),
contentAlignment = Alignment.Center
) {
AnimatedVisibility(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.Color
import eu.europa.ec.resourceslogic.theme.values.backgroundPaper
import eu.europa.ec.uilogic.component.content.ToolBarActions
import eu.europa.ec.uilogic.component.content.ToolbarAction
import eu.europa.ec.uilogic.component.preview.PreviewTheme
Expand Down Expand Up @@ -59,7 +58,7 @@ fun ActionTopBar(
private fun TopBarPreview() {
PreviewTheme {
ActionTopBar(
contentColor = MaterialTheme.colorScheme.backgroundPaper,
contentColor = MaterialTheme.colorScheme.background,
iconColor = MaterialTheme.colorScheme.primary,
iconData = AppIcons.Close
) {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import eu.europa.ec.resourceslogic.theme.values.backgroundPaper
import eu.europa.ec.uilogic.component.preview.PreviewTheme
import eu.europa.ec.uilogic.component.preview.ThemeModePreviews
import eu.europa.ec.uilogic.component.utils.SIZE_EXTRA_LARGE
Expand All @@ -42,7 +41,7 @@ enum class GradientEdge {
@Composable
fun ContentGradient(
modifier: Modifier,
gradientStartColor: Color = MaterialTheme.colorScheme.backgroundPaper,
gradientStartColor: Color = MaterialTheme.colorScheme.background,
gradientEndColor: Color = Color.Transparent,
gradientEdge: GradientEdge = GradientEdge.BOTTOM,
height: Dp = SIZE_EXTRA_LARGE.dp,
Expand Down Expand Up @@ -139,7 +138,7 @@ private fun ContentGradientColoredPreview() {
Box(
modifier = Modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.backgroundPaper)
.background(MaterialTheme.colorScheme.background)
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import eu.europa.ec.resourceslogic.theme.values.ThemeColors
* */
@Preview(
name = "Light Mode", showBackground = true, uiMode = UI_MODE_NIGHT_NO,
backgroundColor = ThemeColors.eudiw_theme_light_backgroundPaper
backgroundColor = ThemeColors.eudiw_theme_light_background
)
@Preview(
name = "Dark Mode", showBackground = true, uiMode = UI_MODE_NIGHT_YES,
backgroundColor = ThemeColors.eudiw_theme_dark_backgroundPaper
backgroundColor = ThemeColors.eudiw_theme_dark_background
)
annotation class ThemeModePreviews
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import eu.europa.ec.resourceslogic.theme.values.backgroundPaper
import eu.europa.ec.resourceslogic.theme.values.dividerDark
import eu.europa.ec.resourceslogic.theme.values.textDisabledDark
import eu.europa.ec.resourceslogic.theme.values.textPrimaryDark
Expand All @@ -49,7 +48,7 @@ fun WrapPrimaryButton(
val textColor = if (isSystemInDarkTheme()) {
Color.White
} else {
MaterialTheme.colorScheme.backgroundPaper
MaterialTheme.colorScheme.background
}

Button(
Expand Down Expand Up @@ -81,9 +80,9 @@ fun WrapSecondaryButton(
onClick = onClick,
shape = buttonsShape,
colors = ButtonDefaults.outlinedButtonColors(
containerColor = MaterialTheme.colorScheme.backgroundPaper,
containerColor = MaterialTheme.colorScheme.background,
contentColor = MaterialTheme.colorScheme.textPrimaryDark,
disabledContainerColor = MaterialTheme.colorScheme.backgroundPaper,
disabledContainerColor = MaterialTheme.colorScheme.background,
disabledContentColor = MaterialTheme.colorScheme.textDisabledDark,
),
border = BorderStroke(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import eu.europa.ec.resourceslogic.theme.values.allCorneredShapeLarge
import eu.europa.ec.resourceslogic.theme.values.backgroundPaper
import eu.europa.ec.resourceslogic.theme.values.textPrimaryDark
import eu.europa.ec.uilogic.component.AppIcons
import eu.europa.ec.uilogic.component.preview.PreviewTheme
Expand All @@ -41,14 +40,14 @@ private val primaryFabContentColor: Color
@Composable get() = if (isSystemInDarkTheme()) {
Color.White
} else {
MaterialTheme.colorScheme.backgroundPaper
MaterialTheme.colorScheme.background
}

private val secondaryFabContainerColor: Color
@Composable get() = if (isSystemInDarkTheme()) {
Color.DarkGray
} else {
MaterialTheme.colorScheme.backgroundPaper
MaterialTheme.colorScheme.background
}

private val secondaryFabContentColor: Color
Expand Down
Loading

0 comments on commit b59b7b6

Please sign in to comment.