diff --git a/compose_compiler_config.conf b/compose_compiler_config.conf new file mode 100644 index 00000000..2341256f --- /dev/null +++ b/compose_compiler_config.conf @@ -0,0 +1,6 @@ +// This file contains classes (with possible wildcards) that the Compose Compiler will treat as stable. +// It allows us to define classes that our not part of our codebase without wrapping them in a stable class. +// For more information, check https://developer.android.com/jetpack/compose/performance/stability/fix#configuration-file + +java.time.ZoneId +java.time.ZoneOffset diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Color.kt b/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Color.kt deleted file mode 100644 index 637e8f34..00000000 --- a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Color.kt +++ /dev/null @@ -1,23 +0,0 @@ -package org.mifos.mobilewallet.mifospay.designsystem.theme - -import androidx.compose.ui.graphics.Color - -val Purple80 = Color(0xFFD0BCFF) -val PurpleGrey80 = Color(0xFFCCC2DC) -val Pink80 = Color(0xFFEFB8C8) - -val Purple40 = Color(0xFF6650a4) -val PurpleGrey40 = Color(0xFF625b71) -val Pink40 = Color(0xFF7D5260) - -// colors -val black = Color(0xFF000000) -val grey = Color(0xFF757074) -val lightGrey = Color(0xFFD9D9D9) -val border = Color(0x66000000) -val green = Color(0xFF008135) -val red = Color(0xFFCD0000) -val mifosText = Color(0xFF212121) -val chipSelectedColor = Color(0xFF00BFFF) -val creditTextColor = Color(0xFF009688) -val debitTextColor = Color(0xFFF10606) \ No newline at end of file diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Theme.kt b/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Theme.kt deleted file mode 100644 index e2ae9b42..00000000 --- a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Theme.kt +++ /dev/null @@ -1,67 +0,0 @@ -package org.mifos.mobilewallet.mifospay.designsystem.theme - -import android.os.Build -import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.darkColorScheme -import androidx.compose.material3.dynamicDarkColorScheme -import androidx.compose.material3.dynamicLightColorScheme -import androidx.compose.material3.lightColorScheme -import androidx.compose.runtime.Composable -import androidx.compose.ui.platform.LocalContext - -private val DarkColorScheme = darkColorScheme( - primary = Purple80, - secondary = PurpleGrey80, - tertiary = Pink80 -) - -private val LightColorScheme = lightColorScheme( - primary = Purple40, - secondary = PurpleGrey40, - tertiary = Pink40 - - /* Other default colors to override - background = Color(0xFFFFFBFE), - surface = Color(0xFFFFFBFE), - onPrimary = Color.White, - onSecondary = Color.White, - onTertiary = Color.White, - onBackground = Color(0xFF1C1B1F), - onSurface = Color(0xFF1C1B1F), - */ -) - -@Composable -fun MifosTheme( - darkTheme: Boolean = isSystemInDarkTheme(), - // Dynamic color is available on Android 12+ - dynamicColor: Boolean = true, - content: @Composable () -> Unit -) { - val colorScheme = when { - dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> { - val context = LocalContext.current - if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context) - } - - darkTheme -> DarkColorScheme - else -> LightColorScheme - } - - // TODO see use case and implement - /*val view = LocalView.current - if (!view.isInEditMode) { - SideEffect { - val window = (view.context as Activity).window - window.statusBarColor = colorScheme.primary.toArgb() - WindowCompat.getInsetsController(window, view).isAppearanceLightStatusBars = darkTheme - } - }*/ - - MaterialTheme( - colorScheme = colorScheme, - typography = Typography, - content = content - ) -} \ No newline at end of file diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/Background.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/Background.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/Background.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/Background.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/FaqItemScreen.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/FaqItemScreen.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/FaqItemScreen.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/FaqItemScreen.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/LoadingWheel.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/LoadingWheel.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/LoadingWheel.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/LoadingWheel.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosBottomSheet.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosBottomSheet.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosBottomSheet.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosBottomSheet.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosDialogBox.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosDialogBox.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosDialogBox.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosDialogBox.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosItemCard.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosItemCard.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosItemCard.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosItemCard.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosOutlineTextField.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosOutlineTextField.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosOutlineTextField.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosOutlineTextField.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTextUserImage.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTextUserImage.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTextUserImage.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTextUserImage.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTopBar.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTopBar.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTopBar.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/MifosTopBar.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/Navigation.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/Navigation.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/Navigation.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/Navigation.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/TextField.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/TextField.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/TextField.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/TextField.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/TopAppBar.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/TopAppBar.kt similarity index 94% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/TopAppBar.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/TopAppBar.kt index 41df2b9c..e4223550 100644 --- a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/component/TopAppBar.kt +++ b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/component/TopAppBar.kt @@ -1,3 +1,6 @@ + +@file:OptIn(ExperimentalMaterial3Api::class) + package org.mifos.mobilewallet.mifospay.designsystem.component import androidx.annotation.StringRes @@ -54,14 +57,14 @@ fun MifosTopAppBar( } }, colors = colors, - modifier = modifier.testTag("niaTopAppBar"), + modifier = modifier.testTag("mifosTopAppBar"), ) } @OptIn(ExperimentalMaterial3Api::class) @Preview("Top App Bar") @Composable -private fun NiaTopAppBarPreview() { +private fun MifosTopAppBarPreview() { MifosTheme { MifosTopAppBar( titleRes = android.R.string.untitled, diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/icon/MifosIcons.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/icon/MifosIcons.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/icon/MifosIcons.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/icon/MifosIcons.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Background.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Background.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Background.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Background.kt diff --git a/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Color.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Color.kt new file mode 100644 index 00000000..568f8632 --- /dev/null +++ b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Color.kt @@ -0,0 +1,77 @@ +package org.mifos.mobilewallet.mifospay.designsystem.theme + +import androidx.compose.ui.graphics.Color + +val md_theme_light_primary = Color(0xFF984061) +val md_theme_light_onPrimary = Color(0xFFFFFFFF) +val md_theme_light_primaryContainer = Color(0xFFFFD9E2) +val md_theme_light_onPrimaryContainer = Color(0xFF3E001D) +val md_theme_light_secondary = Color(0xFF984061) +val md_theme_light_onSecondary = Color(0xFFFFFFFF) +val md_theme_light_secondaryContainer = Color(0xFFFFD9E2) +val md_theme_light_onSecondaryContainer = Color(0xFF3E001D) +val md_theme_light_tertiary = Color(0xFF7D4996) +val md_theme_light_onTertiary = Color(0xFFFFFFFF) +val md_theme_light_tertiaryContainer = Color(0xFFF6D9FF) +val md_theme_light_onTertiaryContainer = Color(0xFF310049) +val md_theme_light_error = Color(0xFFBA1A1A) +val md_theme_light_errorContainer = Color(0xFFFFDAD6) +val md_theme_light_onError = Color(0xFFFFFFFF) +val md_theme_light_onErrorContainer = Color(0xFF410002) +val md_theme_light_background = Color(0xFFFFFBFF) +val md_theme_light_onBackground = Color(0xFF330045) +val md_theme_light_surface = Color(0xFFFFFBFF) +val md_theme_light_onSurface = Color(0xFF330045) +val md_theme_light_surfaceVariant = Color(0xFFF2DDE1) +val md_theme_light_onSurfaceVariant = Color(0xFF514347) +val md_theme_light_outline = Color(0xFF837377) +val md_theme_light_inverseOnSurface = Color(0xFFFFEBFF) +val md_theme_light_inverseSurface = Color(0xFF4D1661) +val md_theme_light_inversePrimary = Color(0xFFFFB1C8) +val md_theme_light_shadow = Color(0xFF000000) +val md_theme_light_surfaceTint = Color(0xFF984061) +val md_theme_light_outlineVariant = Color(0xFFD5C2C6) +val md_theme_light_scrim = Color(0xFF000000) + +val md_theme_dark_primary = Color(0xFFFFB1C8) +val md_theme_dark_onPrimary = Color(0xFF5E1133) +val md_theme_dark_primaryContainer = Color(0xFF7B2949) +val md_theme_dark_onPrimaryContainer = Color(0xFFFFD9E2) +val md_theme_dark_secondary = Color(0xFFFFB1C8) +val md_theme_dark_onSecondary = Color(0xFF5E1133) +val md_theme_dark_secondaryContainer = Color(0xFF7B2949) +val md_theme_dark_onSecondaryContainer = Color(0xFFFFD9E2) +val md_theme_dark_tertiary = Color(0xFFE8B3FF) +val md_theme_dark_onTertiary = Color(0xFF4A1764) +val md_theme_dark_tertiaryContainer = Color(0xFF63307C) +val md_theme_dark_onTertiaryContainer = Color(0xFFF6D9FF) +val md_theme_dark_error = Color(0xFFFFB4AB) +val md_theme_dark_errorContainer = Color(0xFF93000A) +val md_theme_dark_onError = Color(0xFF690005) +val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6) +val md_theme_dark_background = Color(0xFF330045) +val md_theme_dark_onBackground = Color(0xFFFAD7FF) +val md_theme_dark_surface = Color(0xFF330045) +val md_theme_dark_onSurface = Color(0xFFFAD7FF) +val md_theme_dark_surfaceVariant = Color(0xFF514347) +val md_theme_dark_onSurfaceVariant = Color(0xFFD5C2C6) +val md_theme_dark_outline = Color(0xFF9E8C90) +val md_theme_dark_inverseOnSurface = Color(0xFF330045) +val md_theme_dark_inverseSurface = Color(0xFFFAD7FF) +val md_theme_dark_inversePrimary = Color(0xFF984061) +val md_theme_dark_shadow = Color(0xFF000000) +val md_theme_dark_surfaceTint = Color(0xFFFFB1C8) +val md_theme_dark_outlineVariant = Color(0xFF514347) +val md_theme_dark_scrim = Color(0xFF000000) + +// colors +val black = Color(0xFF000000) +val grey = Color(0xFF757074) +val lightGrey = Color(0xFFD9D9D9) +val border = Color(0x66000000) +val green = Color(0xFF008135) +val red = Color(0xFFCD0000) +val mifosText = Color(0xFF212121) +val chipSelectedColor = Color(0xFF00BFFF) +val creditTextColor = Color(0xFF009688) +val debitTextColor = Color(0xFFF10606) \ No newline at end of file diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Gradient.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Gradient.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Gradient.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Gradient.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/MifosTextStyle.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/MifosTextStyle.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/MifosTextStyle.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/MifosTextStyle.kt diff --git a/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Theme.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Theme.kt new file mode 100644 index 00000000..fb880004 --- /dev/null +++ b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Theme.kt @@ -0,0 +1,118 @@ +package org.mifos.mobilewallet.mifospay.designsystem.theme + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.darkColorScheme +import androidx.compose.material3.lightColorScheme +import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.ui.unit.dp + +private val LightDefaultColorScheme = lightColorScheme( + primary = md_theme_light_primary, + onPrimary = md_theme_light_onPrimary, + primaryContainer = md_theme_light_primaryContainer, + onPrimaryContainer = md_theme_light_onPrimaryContainer, + secondary = md_theme_light_secondary, + onSecondary = md_theme_light_onSecondary, + secondaryContainer = md_theme_light_secondaryContainer, + onSecondaryContainer = md_theme_light_onSecondaryContainer, + tertiary = md_theme_light_tertiary, + onTertiary = md_theme_light_onTertiary, + tertiaryContainer = md_theme_light_tertiaryContainer, + onTertiaryContainer = md_theme_light_onTertiaryContainer, + error = md_theme_light_error, + errorContainer = md_theme_light_errorContainer, + onError = md_theme_light_onError, + onErrorContainer = md_theme_light_onErrorContainer, + background = md_theme_light_background, + onBackground = md_theme_light_onBackground, + surface = md_theme_light_surface, + onSurface = md_theme_light_onSurface, + surfaceVariant = md_theme_light_surfaceVariant, + onSurfaceVariant = md_theme_light_onSurfaceVariant, + outline = md_theme_light_outline, + inverseOnSurface = md_theme_light_inverseOnSurface, + inverseSurface = md_theme_light_inverseSurface, + inversePrimary = md_theme_light_inversePrimary, + surfaceTint = md_theme_light_surfaceTint, + outlineVariant = md_theme_light_outlineVariant, + scrim = md_theme_light_scrim, +) + + +private val DarkDefaultColorScheme = darkColorScheme( + primary = md_theme_dark_primary, + onPrimary = md_theme_dark_onPrimary, + primaryContainer = md_theme_dark_primaryContainer, + onPrimaryContainer = md_theme_dark_onPrimaryContainer, + secondary = md_theme_dark_secondary, + onSecondary = md_theme_dark_onSecondary, + secondaryContainer = md_theme_dark_secondaryContainer, + onSecondaryContainer = md_theme_dark_onSecondaryContainer, + tertiary = md_theme_dark_tertiary, + onTertiary = md_theme_dark_onTertiary, + tertiaryContainer = md_theme_dark_tertiaryContainer, + onTertiaryContainer = md_theme_dark_onTertiaryContainer, + error = md_theme_dark_error, + errorContainer = md_theme_dark_errorContainer, + onError = md_theme_dark_onError, + onErrorContainer = md_theme_dark_onErrorContainer, + background = md_theme_dark_background, + onBackground = md_theme_dark_onBackground, + surface = md_theme_dark_surface, + onSurface = md_theme_dark_onSurface, + surfaceVariant = md_theme_dark_surfaceVariant, + onSurfaceVariant = md_theme_dark_onSurfaceVariant, + outline = md_theme_dark_outline, + inverseOnSurface = md_theme_dark_inverseOnSurface, + inverseSurface = md_theme_dark_inverseSurface, + inversePrimary = md_theme_dark_inversePrimary, + surfaceTint = md_theme_dark_surfaceTint, + outlineVariant = md_theme_dark_outlineVariant, + scrim = md_theme_dark_scrim, +) + +@Composable +fun MifosTheme( + darkTheme: Boolean = isSystemInDarkTheme(), + // Dynamic color is available on Android 12+ + dynamicColor: Boolean = true, + content: @Composable () -> Unit +) { + // Color scheme + val colorScheme = when { + else -> if (darkTheme) DarkDefaultColorScheme else LightDefaultColorScheme + } + val defaultGradientColors = GradientColors( + top = colorScheme.inverseOnSurface, + bottom = colorScheme.primaryContainer, + container = colorScheme.surface, + ) + val gradientColors = when { + else -> defaultGradientColors + } + // Background theme + val defaultBackgroundTheme = BackgroundTheme( + color = colorScheme.surface, + tonalElevation = 2.dp, + ) + val backgroundTheme = when { + else -> defaultBackgroundTheme + } + val tintTheme = when { + else -> TintTheme() + } + // Composition locals + CompositionLocalProvider( + LocalGradientColors provides gradientColors, + LocalBackgroundTheme provides backgroundTheme, + LocalTintTheme provides tintTheme, + ) { + MaterialTheme( + colorScheme = colorScheme, + typography = MifosTypography, + content = content, + ) + } +} diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Tint.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Tint.kt similarity index 100% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Tint.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Tint.kt diff --git a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Type.kt b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Type.kt similarity index 68% rename from core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Type.kt rename to core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Type.kt index 4ae387a1..8e63a6cb 100644 --- a/core/designsystem/src/main/java/org/mifos/mobilewallet/mifospay/designsystem/theme/Type.kt +++ b/core/designsystem/src/main/kotlin/org/mifos/mobilewallet/mifospay/designsystem/theme/Type.kt @@ -2,12 +2,12 @@ package org.mifos.mobilewallet.mifospay.designsystem.theme import androidx.compose.material3.Typography import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.LineHeightStyle import androidx.compose.ui.unit.sp // Set of Material typography styles to start with -val Typography = Typography( +internal val MifosTypography = Typography( displayLarge = TextStyle( fontWeight = FontWeight.Normal, fontSize = 57.sp, @@ -43,12 +43,20 @@ val Typography = Typography( fontSize = 24.sp, lineHeight = 32.sp, letterSpacing = 0.sp, + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Bottom, + trim = LineHeightStyle.Trim.None, + ), ), titleLarge = TextStyle( fontWeight = FontWeight.Bold, fontSize = 22.sp, lineHeight = 28.sp, letterSpacing = 0.sp, + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Bottom, + trim = LineHeightStyle.Trim.LastLineBottom, + ), ), titleMedium = TextStyle( fontWeight = FontWeight.Bold, @@ -62,11 +70,16 @@ val Typography = Typography( lineHeight = 20.sp, letterSpacing = 0.1.sp, ), + // Default text style bodyLarge = TextStyle( fontWeight = FontWeight.Normal, fontSize = 16.sp, lineHeight = 24.sp, letterSpacing = 0.5.sp, + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Center, + trim = LineHeightStyle.Trim.None, + ), ), bodyMedium = TextStyle( fontWeight = FontWeight.Normal, @@ -80,22 +93,37 @@ val Typography = Typography( lineHeight = 16.sp, letterSpacing = 0.4.sp, ), + // Used for Button labelLarge = TextStyle( fontWeight = FontWeight.Medium, fontSize = 14.sp, lineHeight = 20.sp, letterSpacing = 0.1.sp, + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Center, + trim = LineHeightStyle.Trim.LastLineBottom, + ), ), + // Used for Navigation items labelMedium = TextStyle( fontWeight = FontWeight.Medium, fontSize = 12.sp, lineHeight = 16.sp, letterSpacing = 0.5.sp, + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Center, + trim = LineHeightStyle.Trim.LastLineBottom, + ), ), + // Used for Tag labelSmall = TextStyle( fontWeight = FontWeight.Medium, fontSize = 10.sp, - lineHeight = 16.sp, + lineHeight = 14.sp, letterSpacing = 0.sp, + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Center, + trim = LineHeightStyle.Trim.LastLineBottom, + ), ), -) \ No newline at end of file +) diff --git a/core/ui/src/androidTest/java/org/mifos/mobilewallet/mifospay/ui/ExampleInstrumentedTest.kt b/core/ui/src/androidTest/java/org/mifos/mobilewallet/mifospay/ui/ExampleInstrumentedTest.kt deleted file mode 100644 index c42303a7..00000000 --- a/core/ui/src/androidTest/java/org/mifos/mobilewallet/mifospay/ui/ExampleInstrumentedTest.kt +++ /dev/null @@ -1,24 +0,0 @@ -package org.mifos.mobilewallet.mifospay.ui - -import androidx.test.platform.app.InstrumentationRegistry -import androidx.test.ext.junit.runners.AndroidJUnit4 - -import org.junit.Test -import org.junit.runner.RunWith - -import org.junit.Assert.* - -/** - * Instrumented test, which will execute on an Android device. - * - * See [testing documentation](http://d.android.com/tools/testing). - */ -@RunWith(AndroidJUnit4::class) -class ExampleInstrumentedTest { - @Test - fun useAppContext() { - // Context of the app under test. - val appContext = InstrumentationRegistry.getInstrumentation().targetContext - assertEquals("org.mifos.mobilewallet.mifospay.ui.test", appContext.packageName) - } -} \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f2d94a0f..973480e7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -6,7 +6,7 @@ constraintlayoutVersion = "2.1.4" coreKtxVersion = "1.12.0" minSdk = "24" targetSdk = "34" -androidTools = "31.3.0" +androidTools = "31.3.1" androidxActivity = "1.8.2" androidxComposeBom = "2024.02.02" androidxComposeCompiler = "1.5.10" diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/MainActivity.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/MainActivity.kt index 6ebc7d4e..3c0ff621 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/MainActivity.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/MainActivity.kt @@ -119,13 +119,13 @@ class MainActivity : ComponentActivity() { /** * The default light scrim, as defined by androidx and the platform: - * https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/java/androidx/activity/EdgeToEdge.kt;l=35-38;drc=27e7d52e8604a080133e8b842db10c89b4482598 + * https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/kotlin/androidx/activity/EdgeToEdge.kt;l=35-38;drc=27e7d52e8604a080133e8b842db10c89b4482598 */ private val lightScrim = android.graphics.Color.argb(0xe6, 0xFF, 0xFF, 0xFF) /** * The default dark scrim, as defined by androidx and the platform: - * https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/java/androidx/activity/EdgeToEdge.kt;l=40-44;drc=27e7d52e8604a080133e8b842db10c89b4482598 + * https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:activity/activity/src/main/kotlin/androidx/activity/EdgeToEdge.kt;l=40-44;drc=27e7d52e8604a080133e8b842db10c89b4482598 */ private val darkScrim = android.graphics.Color.argb(0x80, 0x1b, 0x1b, 0x1b) } diff --git a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/savedcards/presenter/CardsPresenter.kt b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/savedcards/presenter/CardsPresenter.kt index b6b48958..09a9fd8c 100644 --- a/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/savedcards/presenter/CardsPresenter.kt +++ b/mifospay/src/main/java/org/mifos/mobilewallet/mifospay/savedcards/presenter/CardsPresenter.kt @@ -159,7 +159,7 @@ class CardsPresenter @Inject constructor( * @param str : String to be validated * Luhn Algorithm for validating Credit Card Number * src: https://www.journaldev - * .com/1443/java-credit-card-validation-luhn-algorithm-java + * .com/1443/kotlin-credit-card-validation-luhn-algorithm-kotlin */ private fun validateCreditCardNumber(str: String): Boolean { val u = 2