diff --git a/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/component/Navigation.kt b/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/component/Navigation.kt index 1e722d189..61b198126 100644 --- a/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/component/Navigation.kt +++ b/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/component/Navigation.kt @@ -61,8 +61,7 @@ fun RowScope.MifosNavigationBarItem( enabled = enabled, label = label, alwaysShowLabel = alwaysShowLabel, - colors = - NavigationBarItemDefaults.colors( + colors = NavigationBarItemDefaults.colors( selectedIconColor = MifosNavigationDefaults.navigationSelectedItemColor(), unselectedIconColor = MifosNavigationDefaults.navigationContentColor(), selectedTextColor = MifosNavigationDefaults.navigationSelectedItemColor(), @@ -86,6 +85,7 @@ fun MifosNavigationBar( ) { NavigationBar( modifier = modifier, + containerColor = MaterialTheme.colorScheme.onPrimary, contentColor = MifosNavigationDefaults.navigationContentColor(), tonalElevation = 0.dp, content = content, @@ -126,8 +126,7 @@ fun MifosNavigationRailItem( enabled = enabled, label = label, alwaysShowLabel = alwaysShowLabel, - colors = - NavigationRailItemDefaults.colors( + colors = NavigationRailItemDefaults.colors( selectedIconColor = MifosNavigationDefaults.navigationSelectedItemColor(), unselectedIconColor = MifosNavigationDefaults.navigationContentColor(), selectedTextColor = MifosNavigationDefaults.navigationSelectedItemColor(), @@ -164,20 +163,18 @@ fun MifosNavigationRail( @Composable fun MifosNavigationBarPreview() { val items = listOf("Home", "Payments", "Finance", "Profile") - val icons = - listOf( - MifosIcons.Home, - MifosIcons.Payment, - MifosIcons.Finance, - MifosIcons.Profile, - ) - val selectedIcons = - listOf( - MifosIcons.HomeBoarder, - MifosIcons.Payment, - MifosIcons.Finance, - MifosIcons.ProfileBoarder, - ) + val icons = listOf( + MifosIcons.Home, + MifosIcons.Payment, + MifosIcons.Finance, + MifosIcons.Profile, + ) + val selectedIcons = listOf( + MifosIcons.HomeBoarder, + MifosIcons.Payment, + MifosIcons.Finance, + MifosIcons.ProfileBoarder, + ) MifosTheme { MifosNavigationBar { @@ -208,20 +205,18 @@ fun MifosNavigationBarPreview() { @Composable fun MifosNavigationRailPreview() { val items = listOf("Home", "Payments", "Finance", "Profile") - val icons = - listOf( - MifosIcons.Home, - MifosIcons.Payment, - MifosIcons.Finance, - MifosIcons.Profile, - ) - val selectedIcons = - listOf( - MifosIcons.HomeBoarder, - MifosIcons.Payment, - MifosIcons.Finance, - MifosIcons.ProfileBoarder, - ) + val icons = listOf( + MifosIcons.Home, + MifosIcons.Payment, + MifosIcons.Finance, + MifosIcons.Profile, + ) + val selectedIcons = listOf( + MifosIcons.HomeBoarder, + MifosIcons.Payment, + MifosIcons.Finance, + MifosIcons.ProfileBoarder, + ) MifosTheme { MifosNavigationRail { @@ -256,8 +251,8 @@ object MifosNavigationDefaults { fun navigationContentColor() = MaterialTheme.colorScheme.onSurfaceVariant @Composable - fun navigationSelectedItemColor() = MaterialTheme.colorScheme.onPrimaryContainer + fun navigationSelectedItemColor() = MaterialTheme.colorScheme.onSurface @Composable - fun navigationIndicatorColor() = MaterialTheme.colorScheme.primaryContainer + fun navigationIndicatorColor() = MaterialTheme.colorScheme.onPrimary } diff --git a/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/icon/MifosIcons.kt b/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/icon/MifosIcons.kt index 1f01147bb..26bb1d2b1 100644 --- a/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/icon/MifosIcons.kt +++ b/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/icon/MifosIcons.kt @@ -65,13 +65,13 @@ object MifosIcons { val Visibility: ImageVector = Icons.Filled.Visibility val Check: ImageVector = Icons.Default.Check val KeyboardArrowDown: ImageVector = Icons.Default.KeyboardArrowDown - val Home = Icons.Outlined.Home - val HomeBoarder = Icons.Rounded.Home + val Home = Icons.Rounded.Home + val HomeBoarder = Icons.Outlined.Home val Payment = Icons.Rounded.SwapHoriz - val Finance = Icons.Outlined.Wallet - val FinanceBoarder = Icons.Rounded.Wallet - val Profile = Icons.Outlined.AccountCircle - val ProfileBoarder = Icons.Rounded.AccountCircle + val Finance = Icons.Rounded.Wallet + val FinanceBoarder = Icons.Outlined.Wallet + val Profile = Icons.Rounded.AccountCircle + val ProfileBoarder = Icons.Outlined.AccountCircle val MoreVert = Icons.Rounded.MoreVert val Search = Icons.Rounded.Search val Add = Icons.Rounded.Add diff --git a/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/theme/Color.kt b/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/theme/Color.kt index 8ffbff153..d609f2815 100644 --- a/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/theme/Color.kt +++ b/core/designsystem/src/main/kotlin/org/mifospay/core/designsystem/theme/Color.kt @@ -14,7 +14,7 @@ import androidx.compose.ui.graphics.Color val md_theme_light_primary = Color(0xFF0673BA) // primary val md_theme_light_onPrimary = Color(0xFFFFFFFF) // gradientOne val md_theme_light_primaryContainer = Color(0xFFF5F5F5) // container color -val md_theme_light_onPrimaryContainer = Color(0xFF3E001D) +val md_theme_light_onPrimaryContainer = Color(0xFFFFFBFF) // 0xFFF0F0F0 val md_theme_light_secondary = Color(0xFF984061) val md_theme_light_onSecondary = Color(0xFFFFFFFF) val md_theme_light_secondaryContainer = Color(0xFFFFD9E2) @@ -29,7 +29,7 @@ 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_surface = Color(0xFFF0F0F0) val md_theme_light_onSurface = Color(0xFF333333) // onSurface val md_theme_light_surfaceVariant = Color(0xFFF2DDE1) val md_theme_light_onSurfaceVariant = Color(0xFF514347) @@ -45,7 +45,7 @@ val md_theme_light_scrim = Color(0xFF000000) val md_theme_dark_primary = Color(0xFFFFFFFF) val md_theme_dark_onPrimary = Color(0xFF000000) val md_theme_dark_primaryContainer = Color(0xFF7B2949) -val md_theme_dark_onPrimaryContainer = Color(0xFFFFD9E2) +val md_theme_dark_onPrimaryContainer = Color(0xFF1C1C1C) val md_theme_dark_secondary = Color(0xFFFFB1C8) val md_theme_dark_onSecondary = Color(0xFF5E1133) val md_theme_dark_secondaryContainer = Color(0xFF7B2949) diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt b/core/ui/src/main/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt index 48c53fa4e..a7ad03f32 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt +++ b/core/ui/src/main/kotlin/org/mifospay/core/ui/ScrollableTabRow.kt @@ -29,9 +29,9 @@ fun MifosScrollableTabRow( tabContents: List, pagerState: PagerState, modifier: Modifier = Modifier, - containerColor: Color = MaterialTheme.colorScheme.primaryContainer, + containerColor: Color = MaterialTheme.colorScheme.surface, selectedContentColor: Color = MaterialTheme.colorScheme.primary, - unselectedContentColor: Color = MaterialTheme.colorScheme.primaryContainer, + unselectedContentColor: Color = MaterialTheme.colorScheme.surface, edgePadding: Dp = 8.dp, ) { val scope = rememberCoroutineScope() diff --git a/core/ui/src/main/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt b/core/ui/src/main/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt index 1428253f3..08b48d5e7 100644 --- a/core/ui/src/main/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt +++ b/core/ui/src/main/kotlin/org/mifospay/core/ui/TransactionItemScreen.kt @@ -32,7 +32,6 @@ import androidx.compose.ui.unit.dp import com.mifospay.core.model.domain.Transaction import com.mifospay.core.model.domain.TransactionType import org.mifospay.common.Utils.getNewCurrencyFormatter -import org.mifospay.core.designsystem.theme.NewUi import org.mifospay.core.designsystem.theme.green import org.mifospay.core.designsystem.theme.red @@ -77,8 +76,15 @@ fun TransactionItemScreen( }, modifier = when (transaction.transactionType) { TransactionType.DEBIT -> Modifier.size(16.dp) - TransactionType.CREDIT -> Modifier.graphicsLayer(rotationZ = 180f).size(16.dp) - else -> Modifier.graphicsLayer(rotationZ = 180f).size(16.dp) + TransactionType.CREDIT -> + Modifier + .graphicsLayer(rotationZ = 180f) + .size(16.dp) + + else -> + Modifier + .graphicsLayer(rotationZ = 180f) + .size(16.dp) }, tint = when (transaction.transactionType) { TransactionType.CREDIT -> green @@ -104,7 +110,7 @@ fun TransactionItemScreen( .fillMaxWidth() .padding(horizontal = 20.dp), thickness = 1.dp, - color = NewUi.onSurface.copy(alpha = 0.05f), + color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.13f), ) } } diff --git a/feature/history/src/main/kotlin/org/mifospay/feature/history/HistoryScreen.kt b/feature/history/src/main/kotlin/org/mifospay/feature/history/HistoryScreen.kt index 99869dada..1e6becd02 100644 --- a/feature/history/src/main/kotlin/org/mifospay/feature/history/HistoryScreen.kt +++ b/feature/history/src/main/kotlin/org/mifospay/feature/history/HistoryScreen.kt @@ -178,7 +178,7 @@ private fun Chip( modifier: Modifier = Modifier, ) { val context = LocalContext.current - val backgroundColor = MaterialTheme.colorScheme.onPrimary + val backgroundColor = MaterialTheme.colorScheme.onPrimaryContainer MifosButton( modifier = modifier.then( if (selected) { diff --git a/feature/home/src/main/kotlin/org/mifospay/feature/home/HomeScreen.kt b/feature/home/src/main/kotlin/org/mifospay/feature/home/HomeScreen.kt index 950456a4a..8145b8b69 100644 --- a/feature/home/src/main/kotlin/org/mifospay/feature/home/HomeScreen.kt +++ b/feature/home/src/main/kotlin/org/mifospay/feature/home/HomeScreen.kt @@ -115,7 +115,8 @@ private fun HomeScreen( ) { LazyColumn( modifier = modifier - .fillMaxSize(), + .fillMaxSize() + .background(MaterialTheme.colorScheme.surface), contentPadding = PaddingValues(horizontal = 20.dp), ) { item { @@ -304,7 +305,7 @@ fun MifosSendMoneyFreeCard(modifier: Modifier = Modifier) { Card( modifier = modifier, colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.surface, + containerColor = MaterialTheme.colorScheme.onPrimaryContainer, ), ) { Row( @@ -318,15 +319,16 @@ fun MifosSendMoneyFreeCard(modifier: Modifier = Modifier) { ) { Text( text = stringResource(id = R.string.start_sending_your_money_tax_free), - color = NewUi.primaryColor, + color = MaterialTheme.colorScheme.primary, fontWeight = FontWeight(500), style = MaterialTheme.typography.bodyLarge, ) Text( text = "Mifos Pay is the best place for users to receive and send money. Start saving money now!", - color = NewUi.onSurface, + color = MaterialTheme.colorScheme.onSurface, style = MaterialTheme.typography.bodySmall, fontWeight = FontWeight(300), + modifier = Modifier.padding(top = 15.dp), ) } @@ -346,7 +348,7 @@ fun TransactionHistoryCard(transactions: List, modifier: Modifier = modifier = modifier .fillMaxWidth(), colors = CardDefaults.cardColors( - containerColor = Color.White, + containerColor = MaterialTheme.colorScheme.onPrimaryContainer, ), ) { Column { @@ -360,7 +362,7 @@ fun TransactionHistoryCard(transactions: List, modifier: Modifier = ) { Text( text = "Transaction History", - color = NewUi.primaryColor, + color = MaterialTheme.colorScheme.onSurface, fontWeight = FontWeight(500), ) @@ -395,7 +397,7 @@ private fun PaymentButton( modifier = modifier, onClick = onClick, colors = ButtonDefaults.buttonColors( - containerColor = MaterialTheme.colorScheme.surface, + containerColor = MaterialTheme.colorScheme.onPrimaryContainer, contentColor = MaterialTheme.colorScheme.onSurface, ), ) { diff --git a/feature/payments/src/main/kotlin/org/mifospay/feature/payments/RequestScreen.kt b/feature/payments/src/main/kotlin/org/mifospay/feature/payments/RequestScreen.kt index 6e5d76bb0..857adbaeb 100644 --- a/feature/payments/src/main/kotlin/org/mifospay/feature/payments/RequestScreen.kt +++ b/feature/payments/src/main/kotlin/org/mifospay/feature/payments/RequestScreen.kt @@ -79,7 +79,14 @@ internal fun RequestScreenContent( horizontalArrangement = Arrangement.SpaceBetween, verticalAlignment = Alignment.CenterVertically, ) { - Text(text = stringResource(id = R.string.feature_payments_virtual_payment_address_vpa)) + Text( + text = stringResource( + id = R.string + .feature_payments_virtual_payment_address_vpa, + ), + color = MaterialTheme + .colorScheme.onSurface, + ) Text( text = vpa, style = MaterialTheme.typography.bodyMedium, @@ -99,10 +106,14 @@ internal fun RequestScreenContent( HorizontalDivider( thickness = 1.dp, color = MaterialTheme.colorScheme.onSurface.copy - (alpha = 0.05f), + (alpha = 0.13f), ) Column(modifier = Modifier.padding(top = 10.dp)) { - Text(text = stringResource(id = R.string.feature_payments_mobile_number)) + Text( + text = stringResource(id = R.string.feature_payments_mobile_number), + color = + MaterialTheme.colorScheme.onSurface, + ) Text( text = mobile, style = MaterialTheme.typography.bodyMedium, diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileCard.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileCard.kt index 44aab968b..32ac0cabd 100644 --- a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileCard.kt +++ b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileCard.kt @@ -44,7 +44,7 @@ fun ProfileDetailsCard( ), shape = RoundedCornerShape(15.dp), colors = CardDefaults.cardColors( - containerColor = MaterialTheme.colorScheme.primaryContainer, + containerColor = MaterialTheme.colorScheme.onPrimaryContainer, ), ) { Column( diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileScreen.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileScreen.kt index 220c9366e..a882264b7 100644 --- a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileScreen.kt +++ b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/ProfileScreen.kt @@ -18,6 +18,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -32,7 +33,6 @@ import org.koin.androidx.compose.koinViewModel import org.mifospay.core.designsystem.component.MfLoadingWheel import org.mifospay.core.designsystem.component.MifosButton import org.mifospay.core.designsystem.icon.MifosIcons -import org.mifospay.core.designsystem.theme.MifosBlue import org.mifospay.core.ui.ProfileImage @Composable @@ -79,7 +79,7 @@ fun ProfileScreenContent( .fillMaxWidth() .padding(horizontal = 20.dp) .height(54.dp), - color = MifosBlue, + color = MaterialTheme.colorScheme.primary, text = { Text(text = stringResource(id = R.string.feature_profile_personal_qr_code)) }, onClick = { /*TODO*/ }, leadingIcon = { @@ -97,7 +97,7 @@ fun ProfileScreenContent( .fillMaxWidth() .padding(horizontal = 20.dp) .height(55.dp), - color = MifosBlue, + color = MaterialTheme.colorScheme.primary, text = { Text(text = stringResource(id = R.string.feature_profile_link_bank_account)) }, onClick = onLinkAccount, leadingIcon = { @@ -128,8 +128,7 @@ internal class ProfilePreviewProvider : PreviewParameterProvider @Preview(showSystemUi = true, showBackground = true) @Composable private fun ProfileScreenPreview( - @PreviewParameter(ProfilePreviewProvider::class) - profileState: ProfileUiState, + @PreviewParameter(ProfilePreviewProvider::class) profileState: ProfileUiState, ) { ProfileScreenContent( profileState = profileState, diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt index e172dbb92..5371fa717 100644 --- a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt +++ b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreen.kt @@ -64,7 +64,6 @@ import org.mifospay.core.designsystem.component.MifosScaffold import org.mifospay.core.designsystem.component.MifosTextField import org.mifospay.core.designsystem.component.PermissionBox import org.mifospay.core.designsystem.icon.MifosIcons -import org.mifospay.core.designsystem.theme.MifosBlue import org.mifospay.core.designsystem.theme.MifosTheme import org.mifospay.core.designsystem.theme.styleMedium16sp import org.mifospay.feature.profile.R @@ -112,8 +111,7 @@ private fun EditProfileScreen( val snackbarHostState = remember { SnackbarHostState() } Box( - modifier = modifier - .fillMaxSize(), + modifier = modifier.fillMaxSize(), ) { MifosScaffold( topBarTitle = R.string.feature_profile_edit_profile, @@ -198,14 +196,13 @@ private fun EditProfileScreenContent( imageUri = uri } - val galleryLauncher = - rememberLauncherForActivityResult( - contract = ActivityResultContracts.GetContent(), - ) { uri: Uri? -> - uri?.let { - imageUri = uri - } + val galleryLauncher = rememberLauncherForActivityResult( + contract = ActivityResultContracts.GetContent(), + ) { uri: Uri? -> + uri?.let { + imageUri = uri } + } if (showBottomSheet) { MifosBottomSheet( @@ -254,6 +251,9 @@ private fun EditProfileScreenContent( value = username, onValueChange = { username = it }, label = stringResource(id = R.string.feature_profile_username), + textStyle = MaterialTheme.typography.bodyLarge.copy( + color = MaterialTheme.colorScheme.onSurface, + ), ) } @@ -262,6 +262,9 @@ private fun EditProfileScreenContent( value = email, onValueChange = { email = it }, label = stringResource(id = R.string.feature_profile_email), + textStyle = MaterialTheme.typography.bodyLarge.copy( + color = MaterialTheme.colorScheme.onSurface, + ), ) } @@ -270,6 +273,9 @@ private fun EditProfileScreenContent( value = vpa, onValueChange = { vpa = it }, label = stringResource(id = R.string.feature_profile_vpa), + textStyle = MaterialTheme.typography.bodyLarge.copy( + color = MaterialTheme.colorScheme.onSurface, + ), ) } @@ -278,6 +284,9 @@ private fun EditProfileScreenContent( value = mobile, onValueChange = { mobile = it }, label = stringResource(id = R.string.feature_profile_mobile), + textStyle = MaterialTheme.typography.bodyLarge.copy( + color = MaterialTheme.colorScheme.onSurface, + ), ) } @@ -287,8 +296,13 @@ private fun EditProfileScreenContent( .fillMaxWidth() .padding(horizontal = 20.dp) .height(54.dp), - color = MifosBlue, - text = { Text(text = stringResource(id = R.string.feature_profile_save)) }, + color = MaterialTheme.colorScheme.primary, + text = { + Text( + text = stringResource(id = R.string.feature_profile_save), + color = MaterialTheme.colorScheme.onPrimaryContainer, + ) + }, onClick = { if (isDataSaveNecessary(email, editProfileUiState.email)) { updateEmail(email) @@ -380,8 +394,12 @@ private fun ImagePickerOption( horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically, ) { - Icon(imageVector = icon, contentDescription = null) - Text(text = label) + Icon( + imageVector = icon, + contentDescription = null, + tint = MaterialTheme.colorScheme.onSurface, + ) + Text(text = label, color = MaterialTheme.colorScheme.onSurface) } } } @@ -420,25 +438,23 @@ private fun createImageFile(context: Context): File { internal class EditProfilePreviewProvider : PreviewParameterProvider { override val values: Sequence - get() = - sequenceOf( - EditProfileUiState.Loading, - EditProfileUiState.Success(), - EditProfileUiState.Success( - name = "John Doe", - username = "John", - email = "john@mifos.org", - vpa = "vpa", - mobile = "+1 55557772901", - ), - ) + get() = sequenceOf( + EditProfileUiState.Loading, + EditProfileUiState.Success(), + EditProfileUiState.Success( + name = "John Doe", + username = "John", + email = "john@mifos.org", + vpa = "vpa", + mobile = "+1 55557772901", + ), + ) } @Preview(showBackground = true, showSystemUi = true) @Composable private fun EditProfileScreenPreview( - @PreviewParameter(EditProfilePreviewProvider::class) - editProfileUiState: EditProfileUiState, + @PreviewParameter(EditProfilePreviewProvider::class) editProfileUiState: EditProfileUiState, ) { MifosTheme { EditProfileScreen( diff --git a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreenImage.kt b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreenImage.kt index cebdf9de0..0668f199b 100644 --- a/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreenImage.kt +++ b/feature/profile/src/main/kotlin/org/mifospay/feature/profile/edit/EditProfileScreenImage.kt @@ -19,11 +19,11 @@ import androidx.compose.foundation.shape.CircleShape import androidx.compose.material3.Icon import androidx.compose.material3.IconButton import androidx.compose.material3.IconButtonDefaults +import androidx.compose.material3.MaterialTheme import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.rememberVectorPainter import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.res.painterResource @@ -42,8 +42,7 @@ fun EditProfileScreenImage( onCameraIconClick: () -> Unit, ) { Box( - modifier = modifier - .size(150.dp), + modifier = modifier.size(150.dp), ) { if (imageUri != null) { AsyncImage( @@ -76,13 +75,13 @@ fun EditProfileScreenImage( .size(36.dp) .clip(CircleShape) .align(Alignment.BottomCenter), - colors = IconButtonDefaults.iconButtonColors(Color.White), + colors = IconButtonDefaults.iconButtonColors(MaterialTheme.colorScheme.onPrimaryContainer), ) { Icon( painter = rememberVectorPainter(MifosIcons.Edit2), contentDescription = null, - modifier = Modifier - .size(24.dp), + modifier = Modifier.size(24.dp), + tint = MaterialTheme.colorScheme.onSurface, ) } } diff --git a/feature/send-money/src/main/kotlin/org/mifospay/feature/send/money/SendScreenRoute.kt b/feature/send-money/src/main/kotlin/org/mifospay/feature/send/money/SendScreenRoute.kt index bf4541b15..d3bc1ea40 100644 --- a/feature/send-money/src/main/kotlin/org/mifospay/feature/send/money/SendScreenRoute.kt +++ b/feature/send-money/src/main/kotlin/org/mifospay/feature/send/money/SendScreenRoute.kt @@ -64,7 +64,6 @@ import org.mifospay.core.designsystem.component.MifosButton import org.mifospay.core.designsystem.component.MifosNavigationTopAppBar import org.mifospay.core.designsystem.component.MifosTextField import org.mifospay.core.designsystem.icon.MifosIcons -import org.mifospay.core.designsystem.theme.MifosBlue import org.mifospay.core.designsystem.theme.styleMedium16sp import org.mifospay.core.designsystem.theme.styleNormal18sp @@ -145,13 +144,12 @@ internal fun SendMoneyScreen( val contactUri by rememberSaveable { mutableStateOf(null) } fun validateInfo() { - isValidInfo = - when (sendMethodType) { - SendMethodType.VPA -> amount.isNotEmpty() && vpa.isNotEmpty() - SendMethodType.MOBILE -> { - isValidMobileNumber && mobileNumber.isNotEmpty() && amount.isNotEmpty() - } + isValidInfo = when (sendMethodType) { + SendMethodType.VPA -> amount.isNotEmpty() && vpa.isNotEmpty() + SendMethodType.MOBILE -> { + isValidMobileNumber && mobileNumber.isNotEmpty() && amount.isNotEmpty() } + } } LaunchedEffect(key1 = contactUri) { @@ -160,29 +158,24 @@ internal fun SendMoneyScreen( } } - val options = - GmsBarcodeScannerOptions - .Builder() - .setBarcodeFormats( - Barcode.FORMAT_QR_CODE, - Barcode.FORMAT_AZTEC, - ).build() + val options = GmsBarcodeScannerOptions.Builder().setBarcodeFormats( + Barcode.FORMAT_QR_CODE, + Barcode.FORMAT_AZTEC, + ).build() val scanner = GmsBarcodeScanning.getClient(context, options) fun startScan() { - scanner - .startScan() - .addOnSuccessListener { barcode -> - barcode.rawValue?.let { - vpa = it - } - }.addOnCanceledListener { - // Task canceled - }.addOnFailureListener { e -> - // Task failed with an exception - e.localizedMessage?.let { Log.d("SendMoney: Barcode scan failed", it) } + scanner.startScan().addOnSuccessListener { barcode -> + barcode.rawValue?.let { + vpa = it } + }.addOnCanceledListener { + // Task canceled + }.addOnFailureListener { e -> + // Task failed with an exception + e.localizedMessage?.let { Log.d("SendMoney: Barcode scan failed", it) } + } } Box( @@ -218,7 +211,10 @@ internal fun SendMoneyScreen( modifier = Modifier.padding(end = 8.dp), ) }, - indicatorColor = MifosBlue, + indicatorColor = MaterialTheme.colorScheme.primary, + textStyle = MaterialTheme.typography.bodyLarge.copy( + color = MaterialTheme.colorScheme.onSurface, + ), ) when (sendMethodType) { @@ -245,6 +241,9 @@ internal fun SendMoneyScreen( } }, indicatorColor = MaterialTheme.colorScheme.primary, + textStyle = MaterialTheme.typography.bodyLarge.copy( + color = MaterialTheme.colorScheme.onSurface, + ), ) } @@ -261,6 +260,7 @@ internal fun SendMoneyScreen( isValidMobileNumber = valid validateInfo() }, + ) } } @@ -274,8 +274,7 @@ internal fun SendMoneyScreen( ) Row( verticalAlignment = Alignment.CenterVertically, - modifier = - Modifier + modifier = Modifier .fillMaxWidth() .padding(16.dp), ) { @@ -352,6 +351,9 @@ private fun EnterPhoneScreen( keyboardActions = KeyboardActions { keyboardController?.hide() }, indicatorColor = MaterialTheme.colorScheme.primary, errorIndicatorColor = MaterialTheme.colorScheme.error, + textStyle = MaterialTheme.typography.bodyLarge.copy( + color = MaterialTheme.colorScheme.onSurface, + ), ) } @@ -364,9 +366,8 @@ private fun VpaMobileChip( ) { MifosButton( onClick = onClick, - color = MaterialTheme.colorScheme.onPrimary, - modifier = - modifier + color = MaterialTheme.colorScheme.onPrimaryContainer, + modifier = modifier .wrapContentSize() .padding(4.dp) .then( @@ -395,14 +396,13 @@ private suspend fun getContactPhoneNumber( ): String { val contactId: String = uri.lastPathSegment ?: return "" return withContext(Dispatchers.IO) { - val phoneCursor = - context.contentResolver.query( - ContactsContract.CommonDataKinds.Phone.CONTENT_URI, - arrayOf(ContactsContract.CommonDataKinds.Phone.NUMBER), - "${ContactsContract.CommonDataKinds.Phone.CONTACT_ID} = ?", - arrayOf(contactId), - null, - ) + val phoneCursor = context.contentResolver.query( + ContactsContract.CommonDataKinds.Phone.CONTENT_URI, + arrayOf(ContactsContract.CommonDataKinds.Phone.NUMBER), + "${ContactsContract.CommonDataKinds.Phone.CONTACT_ID} = ?", + arrayOf(contactId), + null, + ) phoneCursor?.use { cursor -> if (cursor.moveToFirst()) { val phoneNumberIndex = diff --git a/feature/settings/src/main/kotlin/org/mifospay/feature/settings/SettingsScreen.kt b/feature/settings/src/main/kotlin/org/mifospay/feature/settings/SettingsScreen.kt index 8a18533c1..be413be00 100644 --- a/feature/settings/src/main/kotlin/org/mifospay/feature/settings/SettingsScreen.kt +++ b/feature/settings/src/main/kotlin/org/mifospay/feature/settings/SettingsScreen.kt @@ -35,10 +35,8 @@ import androidx.compose.ui.res.stringResource import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.unit.dp -import com.mifospay.core.model.entity.savedcards.Card import org.koin.androidx.compose.koinViewModel import org.mifospay.core.designsystem.component.MifosTopBar -import org.mifospay.core.designsystem.theme.NewUi import org.mifospay.core.ui.utility.DialogState import org.mifospay.core.ui.utility.DialogType @@ -126,7 +124,7 @@ fun SettingsScreenRoute( fun SettingsCardItem( title: String, modifier: Modifier = Modifier, - color: Color = NewUi.onSurface, + color: Color = MaterialTheme.colorScheme.onSurface, onClick: (() -> Unit)? = null, hasHorizontalDivider: Boolean = true, ) { @@ -152,7 +150,7 @@ fun SettingsCardItem( .fillMaxWidth() .padding(horizontal = 20.dp), thickness = 1.dp, - color = NewUi.onSurface.copy(alpha = 0.05f), + color = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.05f), ) } } diff --git a/feature/standing-instruction/src/main/kotlin/org/mifospay/feature/standing/instruction/NewSIScreenRoute.kt b/feature/standing-instruction/src/main/kotlin/org/mifospay/feature/standing/instruction/NewSIScreenRoute.kt index 6ade5bfc8..01322a4ec 100644 --- a/feature/standing-instruction/src/main/kotlin/org/mifospay/feature/standing/instruction/NewSIScreenRoute.kt +++ b/feature/standing-instruction/src/main/kotlin/org/mifospay/feature/standing/instruction/NewSIScreenRoute.kt @@ -28,6 +28,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material3.Icon import androidx.compose.material3.IconButton +import androidx.compose.material3.MaterialTheme import androidx.compose.material3.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.getValue @@ -227,7 +228,7 @@ private fun NewSIBody( Icon( imageVector = MifosIcons.QrCode2, contentDescription = "Scan QR", - tint = Color.Blue, + tint = MaterialTheme.colorScheme.surface, ) } }, @@ -257,11 +258,12 @@ private fun NewSIBody( .width(150.dp) .padding(top = 16.dp) .align(Alignment.CenterHorizontally), + color = MaterialTheme.colorScheme.primary, onClick = { showDatePickerDialog() }, ) { val text = selectedDate.ifEmpty { stringResource(R.string.feature_standing_instruction_select_date) } - Text(text = text, color = Color.White) + Text(text = text, color = MaterialTheme.colorScheme.onPrimary) } MifosButton( @@ -269,6 +271,7 @@ private fun NewSIBody( .width(150.dp) .padding(top = 16.dp) .align(Alignment.CenterHorizontally), + color = MaterialTheme.colorScheme.primary, onClick = { fetchClient(vpa) if (updateSuccess) { @@ -293,7 +296,7 @@ private fun NewSIBody( ) { Text( text = stringResource(id = R.string.feature_standing_instruction_submit), - color = Color.White, + color = MaterialTheme.colorScheme.onPrimary, ) } } @@ -347,9 +350,12 @@ private fun ConfirmTransfer( ) { Text( text = stringResource(id = R.string.feature_standing_instruction_sending_to), - style = TextStyle(color = Color.Blue, fontSize = 15.sp), + style = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 15.sp), + ) + Text( + text = clientName, + style = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 20.sp), ) - Text(text = clientName, style = TextStyle(color = Color.Black, fontSize = 20.sp)) } Row( modifier = Modifier.fillMaxWidth(), @@ -358,9 +364,12 @@ private fun ConfirmTransfer( ) { Text( text = stringResource(id = R.string.feature_standing_instruction_vpa), - style = TextStyle(color = Color.Black, fontSize = 15.sp), + style = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 15.sp), + ) + Text( + text = clientVpa, + style = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 20.sp), ) - Text(text = clientVpa, style = TextStyle(color = Color.Black, fontSize = 20.sp)) } Row( modifier = Modifier.fillMaxWidth(), @@ -369,11 +378,11 @@ private fun ConfirmTransfer( ) { Text( text = stringResource(id = R.string.feature_standing_instruction_amount), - style = TextStyle(color = Color.Blue, fontSize = 15.sp), + style = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 15.sp), ) Text( text = amount, - style = TextStyle(color = Color.Black, fontSize = 20.sp), + style = TextStyle(color = MaterialTheme.colorScheme.primary, fontSize = 20.sp), ) } } @@ -387,11 +396,12 @@ private fun ConfirmTransfer( modifier = Modifier .width(150.dp) .padding(top = 16.dp), + color = MaterialTheme.colorScheme.primary, onClick = { cancel.invoke() }, ) { Text( text = stringResource(id = R.string.feature_standing_instruction_cancel), - color = Color.White, + color = MaterialTheme.colorScheme.onPrimary, ) } @@ -399,6 +409,7 @@ private fun ConfirmTransfer( modifier = Modifier .width(150.dp) .padding(top = 16.dp), + color = MaterialTheme.colorScheme.primary, onClick = { if (amount.isNotEmpty()) { confirm.invoke( @@ -435,7 +446,7 @@ private fun ConfirmTransfer( ) { Text( text = stringResource(id = R.string.feature_standing_instruction_confirm), - color = Color.White, + color = MaterialTheme.colorScheme.onPrimary, ) } } diff --git a/mifospay/src/main/java/org/mifospay/ui/MifosApp.kt b/mifospay/src/main/java/org/mifospay/ui/MifosApp.kt index 14be70bbc..0829c434c 100644 --- a/mifospay/src/main/java/org/mifospay/ui/MifosApp.kt +++ b/mifospay/src/main/java/org/mifospay/ui/MifosApp.kt @@ -14,17 +14,21 @@ import androidx.compose.foundation.background 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.WindowInsets import androidx.compose.foundation.layout.WindowInsetsSides import androidx.compose.foundation.layout.consumeWindowInsets import androidx.compose.foundation.layout.fillMaxSize 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.safeDrawing import androidx.compose.foundation.layout.safeDrawingPadding +import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.windowInsetsPadding import androidx.compose.foundation.layout.wrapContentSize +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material3.DropdownMenu import androidx.compose.material3.DropdownMenuItem import androidx.compose.material3.ExperimentalMaterial3Api @@ -46,9 +50,9 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.ExperimentalComposeUiApi import androidx.compose.ui.Modifier import androidx.compose.ui.composed +import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.drawWithContent import androidx.compose.ui.geometry.Offset -import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.testTag import androidx.compose.ui.res.stringResource import androidx.compose.ui.semantics.semantics @@ -153,7 +157,7 @@ fun MifosApp( modifier = Modifier.semantics { testTagsAsResourceId = true }, - containerColor = Color.Transparent, + containerColor = MaterialTheme.colorScheme.surface, contentColor = MaterialTheme.colorScheme.onBackground, snackbarHost = { SnackbarHost(snackbarHostState) }, bottomBar = { @@ -289,16 +293,26 @@ private fun MifosBottomBar( Icon( imageVector = destination.unselectedIcon, contentDescription = null, + tint = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.5f), ) }, modifier = if (hasUnread) Modifier.notificationDot() else Modifier, selectedIcon = { - Icon( - imageVector = destination.selectedIcon, - contentDescription = null, - ) + Box(contentAlignment = Alignment.Center) { + Icon( + imageVector = destination.selectedIcon, + contentDescription = null, + ) + Spacer( + modifier = Modifier + .padding(top = 31.dp) + .height(4.dp) + .width(11.dp) + .clip(RoundedCornerShape(100)) + .background(MaterialTheme.colorScheme.primary.copy(alpha = 0.7f)), + ) + } }, - label = { Text(stringResource(destination.iconTextId)) }, ) } }