refactor(feature): replace MaterialTheme with KptMaterialTheme (#1897)

This commit is contained in:
Hekmatullah 2025-08-01 09:46:55 +01:00 committed by GitHub
parent 6fa42412bc
commit d453dc0668
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
58 changed files with 633 additions and 669 deletions

View File

@ -1,4 +1,4 @@
package: name='org.mifospay' versionCode='1' versionName='2025.7.5-beta.0.5' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15'
package: name='org.mifospay' versionCode='1' versionName='2025.7.5-beta.0.6' platformBuildVersionName='15' platformBuildVersionCode='35' compileSdkVersion='35' compileSdkVersionCodename='15'
minSdkVersion:'26'
targetSdkVersion:'34'
uses-permission: name='android.permission.INTERNET'

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.layout.safeDrawingPadding
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarDuration.Indefinite
import androidx.compose.material3.SnackbarHost
@ -64,6 +63,7 @@ import org.mifospay.feature.profile.navigation.navigateToEditProfile
import org.mifospay.feature.settings.navigation.navigateToSettings
import org.mifospay.shared.navigation.MifosNavHost
import org.mifospay.shared.utils.TopLevelDestination
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun MifosApp(
@ -99,7 +99,7 @@ internal fun MifosApp(
Scaffold(
modifier = Modifier,
containerColor = Color.Transparent,
contentColor = MaterialTheme.colorScheme.onBackground,
contentColor = KptTheme.colorScheme.onBackground,
snackbarHost = { SnackbarHost(snackbarHostState) },
bottomBar = {
if (appState.shouldShowBottomBar && destination != null) {
@ -185,7 +185,7 @@ private fun MifosAppBar(
when (destination) {
TopLevelDestination.HOME -> {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
IconBox(
icon = MifosIcons.OutlinedNotifications,
@ -289,7 +289,7 @@ private fun MifosBottomBar(
private fun Modifier.notificationDot(): Modifier =
composed {
val tertiaryColor = MaterialTheme.colorScheme.tertiary
val tertiaryColor = KptTheme.colorScheme.tertiary
drawWithContent {
drawContent()
drawCircle(

View File

@ -31,7 +31,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.designsystem.theme.MifosTheme
@ -185,7 +184,7 @@ fun MifosTopAppBar(
navigationIcon = navigationIconContent,
title = {
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
// The height of the component is controlled and will only allow for 1 extra row,
// making adding any arguments for softWrap and minLines superfluous.

View File

@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
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.ui.Modifier
@ -58,7 +57,7 @@ fun VerifyStepHeader(
Icon(
imageVector = MifosIcons.Check,
contentDescription = null,
tint = if (isVerified) KptTheme.colorScheme.onSurface else MaterialTheme.colorScheme.outline,
tint = if (isVerified) KptTheme.colorScheme.onSurface else KptTheme.colorScheme.outline,
modifier = Modifier.size(24.dp),
)
}

View File

@ -25,7 +25,6 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.FabPosition
@ -37,7 +36,6 @@ import androidx.compose.material3.IconButton
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
@ -102,6 +100,7 @@ import org.mifospay.core.ui.rememberRevealState
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.accounts.beneficiary.BeneficiaryAddEditType
import org.mifospay.feature.accounts.savingsaccount.SavingsAddEditType
import template.core.base.designsystem.theme.KptTheme
@Composable
fun AccountsScreen(
@ -204,7 +203,7 @@ internal fun AccountsScreenContent(
title = stringResource(Res.string.feature_accounts_error_oops),
subTitle = stringResource(Res.string.feature_accounts_unexpected_error_subtitle),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -271,13 +270,13 @@ private fun AccountsList(
modifier = modifier
.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
Text(
text = stringResource(Res.string.feature_accounts_savings_account),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
}
@ -304,7 +303,7 @@ private fun AccountsList(
item {
Text(
text = stringResource(Res.string.feature_accounts_beneficiaries),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
}
@ -323,7 +322,7 @@ private fun AccountsList(
HorizontalDivider(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 8.dp),
.padding(vertical = KptTheme.spacing.sm),
)
}
@ -370,16 +369,16 @@ private fun AccountItem(
RevealSwipe(
modifier = modifier,
state = state,
shape = RoundedCornerShape(8.dp),
backgroundCardStartColor = MaterialTheme.colorScheme.tertiary,
backgroundCardEndColor = MaterialTheme.colorScheme.secondary,
shape = KptTheme.shapes.small,
backgroundCardStartColor = KptTheme.colorScheme.tertiary,
backgroundCardEndColor = KptTheme.colorScheme.secondary,
backgroundStartActionLabel = null,
backgroundEndActionLabel = stringResource(Res.string.feature_accounts_edit),
card = { shape, content ->
Card(
modifier = Modifier.matchParentSize(),
colors = CardDefaults.cardColors(
contentColor = MaterialTheme.colorScheme.onSecondary,
contentColor = KptTheme.colorScheme.onSecondary,
containerColor = Color.Transparent,
),
shape = shape,
@ -391,7 +390,10 @@ private fun AccountItem(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.Center),
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally),
horizontalArrangement = Arrangement.spacedBy(
KptTheme.spacing.sm,
Alignment.CenterHorizontally,
),
verticalAlignment = Alignment.CenterVertically,
) {
AnimatedVisibility(
@ -428,7 +430,7 @@ private fun AccountItem(
shape = it,
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
contentColor = MaterialTheme.colorScheme.onSurface,
contentColor = KptTheme.colorScheme.onSurface,
),
) {
ListItem(
@ -441,12 +443,12 @@ private fun AccountItem(
leadingContent = {
AvatarBox(
icon = MifosIcons.Bank,
backgroundColor = MaterialTheme.colorScheme.secondaryContainer,
backgroundColor = KptTheme.colorScheme.secondaryContainer,
)
},
trailingContent = {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
verticalAlignment = Alignment.CenterVertically,
) {
SavingAccountStatusCard(account.status)
@ -454,15 +456,15 @@ private fun AccountItem(
AnimatedVisibility(isDefault) {
OutlinedCard(
onClick = {},
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
colors = CardDefaults.outlinedCardColors(
containerColor = MaterialTheme.colorScheme.tertiary,
containerColor = KptTheme.colorScheme.tertiary,
),
) {
Text(
text = stringResource(Res.string.feature_accounts_default),
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(4.dp),
style = KptTheme.typography.bodySmall,
modifier = Modifier.padding(KptTheme.spacing.xs),
)
}
}
@ -494,10 +496,10 @@ private fun BeneficiaryItem(
) {
OutlinedCard(
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(8.dp),
shape = KptTheme.shapes.small,
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
contentColor = MaterialTheme.colorScheme.onSurface,
contentColor = KptTheme.colorScheme.onSurface,
),
) {
ListItem(
@ -510,22 +512,22 @@ private fun BeneficiaryItem(
leadingContent = {
AvatarBox(
icon = MifosIcons.AccountCircle,
backgroundColor = MaterialTheme.colorScheme.tertiaryContainer,
contentColor = MaterialTheme.colorScheme.tertiary,
backgroundColor = KptTheme.colorScheme.tertiaryContainer,
contentColor = KptTheme.colorScheme.tertiary,
)
},
trailingContent = {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
FilledTonalIconButton(
onClick = {
onClickEdit(beneficiary)
},
colors = IconButtonDefaults.filledTonalIconButtonColors(
containerColor = MaterialTheme.colorScheme.surfaceContainerHighest,
contentColor = MaterialTheme.colorScheme.onSurfaceVariant,
containerColor = KptTheme.colorScheme.surfaceContainerHighest,
contentColor = KptTheme.colorScheme.onSurfaceVariant,
),
) {
Icon(
@ -539,8 +541,8 @@ private fun BeneficiaryItem(
onClickDelete(beneficiary.id)
},
colors = IconButtonDefaults.filledTonalIconButtonColors(
containerColor = MaterialTheme.colorScheme.errorContainer,
contentColor = MaterialTheme.colorScheme.error,
containerColor = KptTheme.colorScheme.errorContainer,
contentColor = KptTheme.colorScheme.error,
),
) {
Icon(
@ -595,8 +597,8 @@ private fun SavingAccountStatusCard(
) {
val activeStatus = SavingAccountStatus.entries.filter { it.isActive(status) }
FlowRow(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
modifier = modifier,
) {
activeStatus.forEach { statusEnum ->
@ -613,7 +615,7 @@ private fun StatusChip(label: String, color: Color) {
MifosSmallChip(
label = label,
containerColor = color,
contentColor = MaterialTheme.colorScheme.scrim,
contentColor = KptTheme.colorScheme.scrim,
)
}
@ -621,28 +623,34 @@ enum class SavingAccountStatus(
val isActive: (Status) -> Boolean,
val labelRes: StringResource,
) {
PendingApproval({ it.submittedAndPendingApproval }, Res.string.feature_accounts_status_pending_approval),
PendingApproval(
{ it.submittedAndPendingApproval },
Res.string.feature_accounts_status_pending_approval,
),
Approved({ it.approved }, Res.string.feature_accounts_status_approved),
Rejected({ it.rejected }, Res.string.feature_accounts_status_rejected),
Withdrawn({ it.withdrawnByApplicant }, Res.string.feature_accounts_status_withdrawn),
Active({ it.active }, Res.string.feature_accounts_status_active),
Closed({ it.closed }, Res.string.feature_accounts_status_closed),
PrematureClosed({ it.prematureClosed }, Res.string.feature_accounts_status_prematurely_closed),
TransferInProgress({ it.transferInProgress }, Res.string.feature_accounts_status_transfer_in_progress),
TransferInProgress(
{ it.transferInProgress },
Res.string.feature_accounts_status_transfer_in_progress,
),
TransferOnHold({ it.transferOnHold }, Res.string.feature_accounts_status_transfer_on_hold),
Matured({ it.matured }, Res.string.feature_accounts_status_matured),
}
val SavingAccountStatus.color: Color
@Composable get() = when (this) {
SavingAccountStatus.PendingApproval -> MaterialTheme.colorScheme.primaryContainer.copy(alpha = 0.6f)
SavingAccountStatus.Approved -> MaterialTheme.colorScheme.tertiaryContainer
SavingAccountStatus.Rejected -> MaterialTheme.colorScheme.errorContainer
SavingAccountStatus.Withdrawn -> MaterialTheme.colorScheme.secondaryContainer
SavingAccountStatus.Active -> MaterialTheme.colorScheme.primaryContainer
SavingAccountStatus.Closed -> MaterialTheme.colorScheme.surfaceVariant
SavingAccountStatus.PrematureClosed -> MaterialTheme.colorScheme.surfaceVariant.copy(alpha = 0.8f)
SavingAccountStatus.TransferInProgress -> MaterialTheme.colorScheme.tertiaryContainer.copy(alpha = 0.7f)
SavingAccountStatus.TransferOnHold -> MaterialTheme.colorScheme.secondaryContainer.copy(alpha = 0.7f)
SavingAccountStatus.Matured -> MaterialTheme.colorScheme.tertiaryContainer
SavingAccountStatus.PendingApproval -> KptTheme.colorScheme.primaryContainer.copy(alpha = 0.6f)
SavingAccountStatus.Approved -> KptTheme.colorScheme.tertiaryContainer
SavingAccountStatus.Rejected -> KptTheme.colorScheme.errorContainer
SavingAccountStatus.Withdrawn -> KptTheme.colorScheme.secondaryContainer
SavingAccountStatus.Active -> KptTheme.colorScheme.primaryContainer
SavingAccountStatus.Closed -> KptTheme.colorScheme.surfaceVariant
SavingAccountStatus.PrematureClosed -> KptTheme.colorScheme.surfaceVariant.copy(alpha = 0.8f)
SavingAccountStatus.TransferInProgress -> KptTheme.colorScheme.tertiaryContainer.copy(alpha = 0.7f)
SavingAccountStatus.TransferOnHold -> KptTheme.colorScheme.secondaryContainer.copy(alpha = 0.7f)
SavingAccountStatus.Matured -> KptTheme.colorScheme.tertiaryContainer
}

View File

@ -65,6 +65,7 @@ import org.mifospay.core.model.utils.Locale
import org.mifospay.core.model.utils.filterLocales
import org.mifospay.core.ui.MifosDivider
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun AddEditBeneficiaryScreen(
@ -125,8 +126,8 @@ internal fun AddEditBeneficiaryScreenContent(
modifier = modifier
.fillMaxSize()
.padding(paddingValues),
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
horizontalAlignment = Alignment.CenterHorizontally,
) {
item {

View File

@ -32,7 +32,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ExposedDropdownMenuBox
import androidx.compose.material3.ExposedDropdownMenuDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.MenuAnchorType
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
@ -87,6 +86,7 @@ import org.mifospay.core.model.utils.filterLocales
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.MifosDivider
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun AddEditSavingAccountScreen(
@ -187,7 +187,7 @@ internal fun AddEditSavingAccountScreenContent(
title = stringResource(Res.string.feature_accounts_error_oops),
subTitle = state.viewState.message,
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -226,8 +226,8 @@ internal fun AddEditSavingAccountScreenContent(
modifier = modifier
.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item("Client Name") {
MifosTextField(
@ -296,7 +296,7 @@ internal fun AddEditSavingAccountScreenContent(
text = {
Text(
text = product.name,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
},
)
@ -305,7 +305,7 @@ internal fun AddEditSavingAccountScreenContent(
HorizontalDivider(
modifier = Modifier
.fillMaxWidth()
.padding(start = 44.dp),
.padding(start = KptTheme.spacing.xl),
)
}
}
@ -331,7 +331,7 @@ internal fun AddEditSavingAccountScreenContent(
item("Submitted Date & Date Format") {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
verticalAlignment = Alignment.CenterVertically,
) {
MifosTextField(
@ -412,14 +412,14 @@ internal fun AddEditSavingAccountScreenContent(
text = {
Text(
text = locale.countryName,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
},
)
if (index != filteredLocalList.size - 1) {
MifosDivider(
color = MaterialTheme.colorScheme.outlineVariant,
color = KptTheme.colorScheme.outlineVariant,
)
}
}
@ -552,7 +552,7 @@ private fun CustomCheckbox(
modifier = Modifier
.fillMaxHeight(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
Checkbox(
checked = checked,

View File

@ -26,13 +26,11 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.KeyboardArrowUp
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.SuggestionChip
@ -84,6 +82,7 @@ import org.mifospay.core.ui.TransactionHistoryCard
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.accounts.SavingAccountStatus
import org.mifospay.feature.accounts.color
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun SavingAccountDetailScreen(
@ -149,7 +148,7 @@ internal fun SavingAccountDetailScreen(
is SADState.ViewState.Loading -> {
MfLoadingWheel(
contentDesc = stringResource(Res.string.feature_accounts_loading),
backgroundColor = MaterialTheme.colorScheme.surface,
backgroundColor = KptTheme.colorScheme.surface,
)
}
@ -158,7 +157,7 @@ internal fun SavingAccountDetailScreen(
title = stringResource(Res.string.feature_accounts_error_oops),
subTitle = state.message,
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -198,9 +197,9 @@ private fun SavingAccountDetails(
LazyColumn(
modifier = modifier.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
SavingAccountCard(
@ -235,17 +234,17 @@ private fun SavingAccountSummaryCard(
modifier = modifier
.fillMaxWidth(),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surface,
containerColor = KptTheme.colorScheme.surface,
),
) {
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
Text(
text = stringResource(Res.string.feature_accounts_detail_account_summary),
color = MaterialTheme.colorScheme.primary,
color = KptTheme.colorScheme.primary,
fontWeight = FontWeight(500),
modifier = Modifier.padding(8.dp),
modifier = Modifier.padding(KptTheme.spacing.sm),
)
MifosDivider()
@ -254,9 +253,9 @@ private fun SavingAccountSummaryCard(
Text(text = stringResource(Res.string.feature_accounts_detail_account_balance))
Text(
text = summary.formatAmount(summary.accountBalance),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
@ -266,9 +265,9 @@ private fun SavingAccountSummaryCard(
Text(text = stringResource(Res.string.feature_accounts_detail_total_deposits))
Text(
text = summary.formatAmount(summary.totalDeposits),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
@ -278,9 +277,9 @@ private fun SavingAccountSummaryCard(
Text(text = stringResource(Res.string.feature_accounts_detail_total_withdrawals))
Text(
text = summary.formatAmount(summary.totalWithdrawals),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
@ -290,9 +289,9 @@ private fun SavingAccountSummaryCard(
Text(text = stringResource(Res.string.feature_accounts_detail_available_balance))
Text(
text = summary.formatAmount(summary.availableBalance),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
@ -302,9 +301,9 @@ private fun SavingAccountSummaryCard(
Text(text = stringResource(Res.string.feature_accounts_detail_total_interest_posted))
Text(
text = summary.totalInterestPosted.toString(),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
@ -314,9 +313,9 @@ private fun SavingAccountSummaryCard(
Text(text = stringResource(Res.string.feature_accounts_detail_total_overdraft))
Text(
text = summary.totalOverdraftInterestDerived.toString(),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
@ -326,9 +325,9 @@ private fun SavingAccountSummaryCard(
Text(text = stringResource(Res.string.feature_accounts_detail_interest_not_posted))
Text(
text = summary.interestNotPosted.toString(),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
}
@ -343,7 +342,7 @@ private inline fun RowBlock(
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 12.dp, vertical = 8.dp),
.padding(horizontal = KptTheme.spacing.md, vertical = KptTheme.spacing.sm),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
@ -365,17 +364,17 @@ private fun SavingAccountCard(
.background(
brush = Brush.linearGradient(
colors = listOf(
MaterialTheme.colorScheme.primary,
MaterialTheme.colorScheme.secondary,
KptTheme.colorScheme.primary,
KptTheme.colorScheme.secondary,
),
),
shape = RoundedCornerShape(16.dp),
shape = KptTheme.shapes.large,
),
) {
Column(
modifier = Modifier
.fillMaxSize()
.padding(12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.SpaceBetween,
) {
Row(
@ -388,14 +387,14 @@ private fun SavingAccountCard(
Text(
text = stringResource(Res.string.feature_accounts_detail_product_name),
fontWeight = FontWeight(300),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.surface,
style = KptTheme.typography.bodySmall,
color = KptTheme.colorScheme.surface,
)
Text(
text = account.name,
fontWeight = FontWeight(400),
color = MaterialTheme.colorScheme.surface,
color = KptTheme.colorScheme.surface,
)
}
@ -409,8 +408,8 @@ private fun SavingAccountCard(
Text(
text = account.number,
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.surface,
style = MaterialTheme.typography.headlineMedium,
color = KptTheme.colorScheme.surface,
style = KptTheme.typography.headlineMedium,
letterSpacing = 0.50.sp,
)
}
@ -425,8 +424,8 @@ private fun SavingAccountCard(
Text(
text = stringResource(Res.string.feature_accounts_detail_wallet_balance),
fontWeight = FontWeight(300),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.surface,
style = KptTheme.typography.bodySmall,
color = KptTheme.colorScheme.surface,
)
val accountBalance = CurrencyFormatter.format(
@ -437,18 +436,18 @@ private fun SavingAccountCard(
Text(
text = accountBalance,
color = MaterialTheme.colorScheme.surface,
style = MaterialTheme.typography.headlineLarge,
color = KptTheme.colorScheme.surface,
style = KptTheme.typography.headlineLarge,
)
}
Icon(
modifier = Modifier
.graphicsLayer(rotationZ = 90f)
.padding(4.dp),
.padding(KptTheme.spacing.xs),
imageVector = Icons.Filled.KeyboardArrowUp,
contentDescription = stringResource(Res.string.feature_accounts_detail_arrow),
tint = MaterialTheme.colorScheme.surface,
tint = KptTheme.colorScheme.surface,
)
}
}
@ -464,8 +463,8 @@ private fun SavingAccountStatusCard(
val activeStatuses = SavingAccountStatus.entries.filter { it.isActive(status) }
FlowRow(
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
modifier = modifier,
) {
activeStatuses.forEach { statusEnum ->

View File

@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -32,7 +31,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import kotlinx.coroutines.launch
import mobile_wallet.feature.auth.generated.resources.Res
@ -55,6 +53,7 @@ import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.designsystem.theme.styleNormal18sp
import org.mifospay.core.ui.MifosPasswordField
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun LoginScreen(
@ -109,7 +108,7 @@ private fun LoginScreen(
MifosScaffold(
snackbarHostState = snackbarHostState,
modifier = modifier.fillMaxSize(),
containerColor = MaterialTheme.colorScheme.background,
containerColor = KptTheme.colorScheme.background,
) { paddingValues ->
LoginScreenContent(
state = state,
@ -152,22 +151,22 @@ private fun LoginScreenContent(
modifier = modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(horizontal = 24.dp)
.padding(top = 100.dp),
.padding(horizontal = KptTheme.spacing.lg)
.padding(top = KptTheme.spacing.xxl),
horizontalAlignment = Alignment.Start,
) {
Text(
text = stringResource(Res.string.feature_auth_login),
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.primary,
style = KptTheme.typography.titleLarge,
color = KptTheme.colorScheme.primary,
)
Text(
modifier = Modifier
.padding(top = 24.dp),
.padding(top = KptTheme.spacing.lg),
text = stringResource(Res.string.feature_auth_welcome_back),
style = styleNormal18sp,
)
Spacer(modifier = Modifier.padding(top = 32.dp))
Spacer(modifier = Modifier.padding(top = KptTheme.spacing.xl))
MifosOutlinedTextField(
label = stringResource(Res.string.feature_auth_username),
value = state.username,
@ -176,7 +175,7 @@ private fun LoginScreenContent(
},
modifier = Modifier.fillMaxWidth(),
)
Spacer(modifier = Modifier.padding(top = 16.dp))
Spacer(modifier = Modifier.padding(horizontal = KptTheme.spacing.md))
MifosPasswordField(
label = stringResource(Res.string.feature_auth_password),
value = state.password,
@ -193,16 +192,16 @@ private fun LoginScreenContent(
MifosButton(
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp),
.padding(horizontal = KptTheme.spacing.md),
enabled = isLoginButtonEnabled,
onClick = {
onAction(LoginAction.LoginClicked)
},
contentPadding = PaddingValues(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_auth_login).uppercase(),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
}
@ -221,12 +220,12 @@ private fun SignupButton(
Row(
modifier = Modifier
.fillMaxWidth()
.padding(top = 24.dp),
.padding(top = KptTheme.spacing.lg),
horizontalArrangement = Arrangement.Center,
) {
Text(
text = "Dont have an account yet? ",
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
Text(
modifier = Modifier.clickable(
@ -237,8 +236,8 @@ private fun SignupButton(
},
text = stringResource(Res.string.feature_auth_sign_up),
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.primary,
style = MaterialTheme.typography.labelLarge.copy(
color = KptTheme.colorScheme.primary,
style = KptTheme.typography.labelLarge.copy(
textDecoration = TextDecoration.Underline,
),
)

View File

@ -16,7 +16,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
@ -26,7 +25,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import kotlinx.coroutines.launch
import mobile_wallet.feature.auth.generated.resources.Res
@ -52,6 +50,7 @@ import org.mifospay.core.designsystem.component.NavigationIcon
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun MobileVerificationScreen(
@ -159,8 +158,8 @@ fun PhoneNoVerifyContent(
Column(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
MifosOutlinedTextField(
modifier = modifier,
@ -173,22 +172,22 @@ fun PhoneNoVerifyContent(
Text(
text = stringResource(Res.string.feature_auth_enter_mobile_number_description),
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
)
MifosButton(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 32.dp, vertical = 16.dp),
.padding(horizontal = KptTheme.spacing.xl, vertical = KptTheme.spacing.md),
enabled = state.isPhoneNoValid,
onClick = {
onEvent(MobileVerificationAction.VerifyPhoneBtnClicked)
},
contentPadding = PaddingValues(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_auth_verify_phone).uppercase(),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
}
}
@ -210,8 +209,8 @@ fun OtpVerifyContent(
Column(
modifier = Modifier
.fillMaxSize()
.padding(horizontal = 12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
MifosOutlinedTextField(
modifier = modifier,
@ -224,22 +223,22 @@ fun OtpVerifyContent(
Text(
text = stringResource(Res.string.feature_auth_enter_otp_received),
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
)
MifosButton(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 32.dp, vertical = 16.dp),
.padding(horizontal = KptTheme.spacing.xl, vertical = KptTheme.spacing.md),
enabled = state.isOtpValid,
onClick = {
onEvent(MobileVerificationAction.VerifyOtpBtnClicked)
},
contentPadding = PaddingValues(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_auth_verify_otp).uppercase(),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
}
}

View File

@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
@ -39,7 +38,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardCapitalization
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import kotlinx.coroutines.launch
import mobile_wallet.feature.auth.generated.resources.Res
@ -75,6 +73,7 @@ import org.mifospay.core.ui.ExposedDropdownBox
import org.mifospay.core.ui.MifosPasswordField
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.auth.signup.SignUpState.DialogState
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun SignupScreen(
@ -130,7 +129,7 @@ private fun SignupScreen(
MifosScaffold(
snackbarHostState = snackbarHostState,
modifier = modifier,
containerColor = MaterialTheme.colorScheme.background,
containerColor = KptTheme.colorScheme.background,
topBar = {
MifosTopAppBar(
title = stringResource(Res.string.feature_auth_complete_your_registration),
@ -161,8 +160,8 @@ private fun SignupScreenContent(
LazyColumn(
modifier = modifier
.fillMaxSize(),
contentPadding = PaddingValues(12.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
item {
MifosOutlinedTextField(
@ -251,7 +250,7 @@ private fun SignupScreenContent(
showPasswordChange = { showPassword = !showPassword },
interactionSource = interactionSource,
)
Spacer(modifier = Modifier.height(4.dp))
Spacer(modifier = Modifier.height(KptTheme.spacing.xs))
CombinedPasswordErrorCard(
modifier = Modifier.fillMaxWidth(),
errors = state.passwordFeedback,
@ -317,7 +316,7 @@ private fun SignupScreenContent(
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
var isCountryDropdownExpanded by remember { mutableStateOf(false) }
var isStateDropdownExpanded by remember { mutableStateOf(false) }
@ -381,7 +380,7 @@ private fun SignupScreenContent(
onClick = {
onAction(SignUpAction.SubmitClick)
},
contentPadding = PaddingValues(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_auth_complete),

View File

@ -16,10 +16,8 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.wrapContentWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.runtime.Composable
@ -40,6 +38,7 @@ import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.designsystem.component.MifosTopAppBar
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.designsystem.theme.MifosTheme
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun SignupMethodScreen(
@ -100,34 +99,34 @@ private fun SignupMethodScreenContent(
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
modifier = Modifier.padding(top = 16.dp),
modifier = Modifier.padding(horizontal = KptTheme.spacing.md),
text = stringResource(Res.string.feature_auth_create_an_account),
)
MifosOutlinedButton(
modifier = Modifier.padding(top = 48.dp),
modifier = Modifier.padding(top = KptTheme.spacing.xl),
onClick = onSignUpAsMerchant,
border = BorderStroke(
1.dp,
MaterialTheme.colorScheme.primary,
KptTheme.colorScheme.primary,
),
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
) {
Text(
text = stringResource(Res.string.feature_auth_sign_up_as_merchant).uppercase(),
style = MaterialTheme.typography.labelMedium,
style = KptTheme.typography.labelMedium,
)
}
Row(
modifier = Modifier
.fillMaxWidth()
.padding(top = 24.dp),
.padding(horizontal = KptTheme.spacing.lg),
verticalAlignment = Alignment.CenterVertically,
) {
HorizontalDivider(
modifier = Modifier
.padding(start = 24.dp, end = 8.dp)
.padding(start = KptTheme.spacing.lg, end = KptTheme.spacing.sm)
.weight(.4f),
thickness = 1.dp,
)
@ -139,24 +138,24 @@ private fun SignupMethodScreenContent(
)
HorizontalDivider(
modifier = Modifier
.padding(start = 8.dp, end = 24.dp)
.padding(start = KptTheme.spacing.sm, end = KptTheme.spacing.lg)
.weight(.4f),
thickness = 1.dp,
)
}
MifosOutlinedButton(
modifier = Modifier.padding(top = 24.dp),
modifier = Modifier.padding(horizontal = KptTheme.spacing.lg),
onClick = onSignupAsCustomer,
border = BorderStroke(
1.dp,
MaterialTheme.colorScheme.primary,
KptTheme.colorScheme.primary,
),
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
) {
Text(
text = stringResource(Res.string.feature_auth_sign_up_as_customer).uppercase(),
style = MaterialTheme.typography.labelMedium,
style = KptTheme.typography.labelMedium,
)
}
}

View File

@ -29,7 +29,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import kotlinx.coroutines.launch
import mobile_wallet.feature.editpassword.generated.resources.Res
@ -49,6 +48,7 @@ import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.ui.MifosPasswordField
import org.mifospay.core.ui.PasswordStrengthIndicator
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun EditPasswordScreen(
@ -114,8 +114,8 @@ internal fun EditPasswordScreenContent(
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(paddingValues)
.padding(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
var showPassword by rememberSaveable { mutableStateOf(false) }
@ -163,7 +163,7 @@ internal fun EditPasswordScreenContent(
onClick = {
onAction(EditPasswordAction.SubmitClick)
},
contentPadding = PaddingValues(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_editpassword_save),

View File

@ -24,12 +24,10 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.HorizontalDivider
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
@ -38,6 +36,7 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.scale
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.RectangleShape
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
@ -50,6 +49,7 @@ import org.koin.compose.viewmodel.koinViewModel
import org.mifospay.core.designsystem.component.MifosTopBar
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun FaqScreenRoute(
@ -111,7 +111,7 @@ private fun FaqScreen(
HorizontalDivider(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 20.dp),
.padding(horizontal = KptTheme.spacing.lg),
)
}
}
@ -134,12 +134,12 @@ private fun FaqItemScreen(
colors = CardDefaults.cardColors(
containerColor = Color.Transparent,
),
shape = RoundedCornerShape(0.dp),
shape = RectangleShape,
) {
Column(
modifier = Modifier.padding(
horizontal = 20.dp,
vertical = 25.dp,
horizontal = KptTheme.spacing.lg,
vertical = KptTheme.spacing.lg,
),
) {
Row {
@ -173,10 +173,10 @@ private fun FaqItemScreen(
) {
Text(
text = stringResource(faq.answer),
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
modifier = Modifier
.fillMaxWidth()
.padding(top = 4.dp)
.padding(top = KptTheme.spacing.xs)
.weight(1f),
)
}

View File

@ -14,13 +14,11 @@ import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.history.generated.resources.Res
import mobile_wallet.feature.history.generated.resources.feature_history_empty
@ -35,6 +33,7 @@ import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.history.components.HistoryScreenFilter
import org.mifospay.feature.history.components.TransactionList
import template.core.base.designsystem.theme.KptTheme
@Composable
fun HistoryScreen(
@ -84,7 +83,7 @@ internal fun HistoryScreenContent(
title = stringResource(Res.string.feature_history_error_oops),
subTitle = stringResource(Res.string.feature_history_error),
modifier = Modifier.align(Alignment.Center),
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -117,12 +116,12 @@ private fun HistoryScreenContent(
Column(
modifier = modifier
.fillMaxSize(),
verticalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
HistoryScreenFilter(
selectedTransactionType = selectedTransactionType,
onAction = onAction,
modifier = Modifier.padding(top = 8.dp),
modifier = Modifier.padding(top = KptTheme.spacing.sm),
)
TransactionList(

View File

@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -25,7 +24,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import mobile_wallet.feature.history.generated.resources.Res
import mobile_wallet.feature.history.generated.resources.feature_history_all
import mobile_wallet.feature.history.generated.resources.feature_history_credits
@ -33,6 +31,7 @@ import mobile_wallet.feature.history.generated.resources.feature_history_debits
import org.jetbrains.compose.resources.stringResource
import org.mifospay.core.model.savingsaccount.TransactionType
import org.mifospay.feature.history.HistoryAction
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun HistoryScreenFilter(
@ -44,9 +43,9 @@ internal fun HistoryScreenFilter(
Row(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(12.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
TransactionType.entries.forEach { transactionType ->
FilterItem(
@ -65,8 +64,8 @@ private fun FilterItem(
transactionType: TransactionType,
isSelected: Boolean,
onAction: (HistoryAction.SetFilter) -> Unit,
selectedColor: Color = MaterialTheme.colorScheme.primary,
unSelectedColor: Color = MaterialTheme.colorScheme.surface,
selectedColor: Color = KptTheme.colorScheme.primary,
unSelectedColor: Color = KptTheme.colorScheme.surface,
modifier: Modifier = Modifier,
) {
val containerColor = if (isSelected) selectedColor else unSelectedColor
@ -87,7 +86,7 @@ private fun FilterItem(
minWidth = ButtonDefaults.MinWidth,
minHeight = ButtonDefaults.MinHeight,
)
.padding(horizontal = 24.dp, vertical = 8.dp),
.padding(horizontal = KptTheme.spacing.lg, vertical = KptTheme.spacing.sm),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.Center,
) {
@ -97,7 +96,7 @@ private fun FilterItem(
TransactionType.DEBIT -> stringResource(Res.string.feature_history_debits)
TransactionType.CREDIT -> stringResource(Res.string.feature_history_credits)
},
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
)
}

View File

@ -15,20 +15,17 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import mobile_wallet.feature.history.generated.resources.Res
import mobile_wallet.feature.history.generated.resources.feature_history_debited_from
import mobile_wallet.feature.history.generated.resources.feature_history_paid_to
@ -39,6 +36,7 @@ import org.mifospay.core.common.CurrencyFormatter
import org.mifospay.core.common.DateHelper
import org.mifospay.core.model.savingsaccount.TransferDetail
import org.mifospay.core.ui.AvatarBox
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun TransactionDetail(
@ -47,7 +45,7 @@ internal fun TransactionDetail(
) {
Card(
modifier = modifier.fillMaxSize(),
shape = RoundedCornerShape(8.dp),
shape = KptTheme.shapes.small,
colors = CardDefaults.cardColors(
containerColor = Color.Transparent,
),
@ -55,8 +53,8 @@ internal fun TransactionDetail(
Column(
modifier = Modifier
.fillMaxSize()
.padding(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
Row(
modifier = Modifier.fillMaxWidth(),
@ -65,7 +63,7 @@ internal fun TransactionDetail(
) {
Text(
text = stringResource(Res.string.feature_history_transaction_id),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
Text(text = detail.id.toString())
}
@ -81,7 +79,7 @@ internal fun TransactionDetail(
) {
Text(
text = stringResource(Res.string.feature_history_transaction_date),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
val date = DateHelper.getDateAsString(detail.transferDate)
Text(text = date)
@ -93,12 +91,12 @@ internal fun TransactionDetail(
Text(
text = stringResource(Res.string.feature_history_paid_to),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
Card(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
colors = CardDefaults.cardColors(
containerColor = Color.Transparent,
),
@ -123,7 +121,7 @@ internal fun TransactionDetail(
)
Text(
text = amount,
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
fontWeight = FontWeight.Bold,
)
},
@ -133,24 +131,24 @@ internal fun TransactionDetail(
)
Row(
modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
modifier = Modifier.fillMaxWidth().padding(horizontal = KptTheme.spacing.xs),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(
4.dp,
KptTheme.spacing.xs,
Alignment.CenterHorizontally,
),
) {
Text(
text = detail.toOffice.name,
style = MaterialTheme.typography.labelSmall,
style = KptTheme.typography.labelSmall,
)
Text(
text = "|",
style = MaterialTheme.typography.labelSmall,
style = KptTheme.typography.labelSmall,
)
Text(
text = detail.toAccountType.value,
style = MaterialTheme.typography.labelSmall,
style = KptTheme.typography.labelSmall,
)
}
}
@ -161,12 +159,12 @@ internal fun TransactionDetail(
Text(
text = stringResource(Res.string.feature_history_debited_from),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
Card(
modifier = Modifier.fillMaxWidth(),
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
colors = CardDefaults.cardColors(
containerColor = Color.Transparent,
),
@ -189,7 +187,7 @@ internal fun TransactionDetail(
)
Text(
text = amount,
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
fontWeight = FontWeight.Bold,
)
},
@ -198,24 +196,24 @@ internal fun TransactionDetail(
),
)
Row(
modifier = Modifier.fillMaxWidth().padding(vertical = 4.dp),
modifier = Modifier.fillMaxWidth().padding(horizontal = KptTheme.spacing.xs),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(
4.dp,
KptTheme.spacing.xs,
Alignment.CenterHorizontally,
),
) {
Text(
text = detail.fromOffice.name,
style = MaterialTheme.typography.labelSmall,
style = KptTheme.typography.labelSmall,
)
Text(
text = "|",
style = MaterialTheme.typography.labelSmall,
style = KptTheme.typography.labelSmall,
)
Text(
text = detail.fromAccountType.value,
style = MaterialTheme.typography.labelSmall,
style = KptTheme.typography.labelSmall,
)
}
}

View File

@ -23,7 +23,6 @@ import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -46,6 +45,7 @@ import org.mifospay.core.common.CurrencyFormatter
import org.mifospay.core.model.savingsaccount.Transaction
import org.mifospay.core.model.savingsaccount.TransactionType
import org.mifospay.feature.history.HistoryAction
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun TransactionList(
@ -74,7 +74,7 @@ internal fun TransactionList(
HorizontalDivider(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 20.dp),
.padding(horizontal = KptTheme.spacing.lg),
)
}
}
@ -95,24 +95,24 @@ internal fun TransactionItem(
transaction.transferId?.let { onClick(it) }
},
color = Color.Transparent,
contentColor = MaterialTheme.colorScheme.onSurface,
contentColor = KptTheme.colorScheme.onSurface,
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(KptTheme.spacing.md),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.SpaceBetween,
) {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
AnimatedVisibility(showLeadingIcon) {
Image(
modifier = Modifier
.size(20.dp)
.padding(top = 2.dp),
.padding(top = KptTheme.spacing.xs),
painter = painterResource(
resource = when (transaction.transactionType) {
TransactionType.DEBIT -> Res.drawable.core_ui_money_out
@ -128,12 +128,12 @@ internal fun TransactionItem(
Text(
text = transaction.transactionType.name,
fontWeight = FontWeight(400),
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
)
Text(
text = transaction.date,
fontWeight = FontWeight(300),
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
)
}
}
@ -149,19 +149,19 @@ internal fun TransactionItem(
else -> Modifier.graphicsLayer(rotationZ = 180f).size(16.dp)
},
tint = when (transaction.transactionType) {
TransactionType.CREDIT -> MaterialTheme.colorScheme.onTertiaryContainer.copy(
TransactionType.CREDIT -> KptTheme.colorScheme.onTertiaryContainer.copy(
red = 0f,
green = 0.51f,
blue = 0.21f,
)
TransactionType.DEBIT -> MaterialTheme.colorScheme.error.copy(
TransactionType.DEBIT -> KptTheme.colorScheme.error.copy(
red = 0.8f,
green = 0f,
blue = 0f,
)
else -> MaterialTheme.colorScheme.scrim
else -> KptTheme.colorScheme.scrim
},
contentDescription = null,
)
@ -177,19 +177,19 @@ internal fun TransactionItem(
fontSize = 16.sp,
fontWeight = FontWeight.Normal,
color = when (transaction.transactionType) {
TransactionType.CREDIT -> MaterialTheme.colorScheme.onTertiaryContainer.copy(
TransactionType.CREDIT -> KptTheme.colorScheme.onTertiaryContainer.copy(
red = 0f,
green = 0.51f,
blue = 0.21f,
)
TransactionType.DEBIT -> MaterialTheme.colorScheme.error.copy(
TransactionType.DEBIT -> KptTheme.colorScheme.error.copy(
red = 0.8f,
green = 0f,
blue = 0f,
)
else -> MaterialTheme.colorScheme.scrim
else -> KptTheme.colorScheme.scrim
},
textAlign = TextAlign.End,
),

View File

@ -14,7 +14,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
@ -35,6 +34,7 @@ import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.history.components.TransactionDetail
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun TransactionDetailScreen(
@ -103,7 +103,7 @@ internal fun TransactionDetailScreenContent(
title = stringResource(Res.string.feature_history_error_oops),
subTitle = stringResource(Res.string.feature_history_error),
modifier = Modifier.align(Alignment.Center),
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}

View File

@ -18,7 +18,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.history.generated.resources.Res
import mobile_wallet.feature.history.generated.resources.feature_history_error
@ -33,6 +32,7 @@ import org.mifospay.core.ui.ErrorScreenContent
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.history.components.TransactionDetail
import org.mifospay.feature.history.components.TransactionItem
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun SpecificTransactionsScreen(
@ -113,8 +113,8 @@ private fun TransactionDetails(
Column(
modifier = modifier
.fillMaxSize()
.padding(vertical = 12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
TransactionItem(
transaction = state.transaction,

View File

@ -47,7 +47,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
@ -112,6 +111,7 @@ import org.mifospay.core.ui.ErrorScreenContent
import org.mifospay.core.ui.MifosSmallChip
import org.mifospay.core.ui.TransactionHistoryCard
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
/*
* Feature Enhancement
@ -253,7 +253,7 @@ private fun HomeScreenContent(
modifier = modifier
.fillMaxSize(),
state = state,
contentPadding = PaddingValues(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
) {
item {
AccountList(
@ -270,7 +270,7 @@ private fun HomeScreenContent(
item {
PayRequestScreen(
modifier = Modifier.padding(vertical = 20.dp),
modifier = Modifier.padding(horizontal = KptTheme.spacing.lg),
onRequest = {
onAction(HomeAction.RequestClicked)
},
@ -286,7 +286,7 @@ private fun HomeScreenContent(
item {
TransactionHistoryCard(
modifier = Modifier.padding(vertical = 20.dp),
modifier = Modifier.padding(horizontal = KptTheme.spacing.lg),
transactions = viewState.transactions,
onClickViewAll = {
onAction(HomeAction.OnClickSeeAllTransactions)
@ -303,7 +303,7 @@ private fun HomeScreenContent(
modifier = Modifier
.fillMaxHeight()
.windowInsetsPadding(WindowInsets.systemBars)
.padding(horizontal = 1.dp)
.padding(horizontal = KptTheme.spacing.xs)
.align(Alignment.CenterEnd),
state = scrollbarState,
orientation = Orientation.Vertical,
@ -327,7 +327,7 @@ private fun AccountList(
HorizontalPager(
state = pagerState,
pageSpacing = 5.dp,
pageSpacing = KptTheme.spacing.xs,
modifier = modifier,
) {
AccountCard(
@ -346,8 +346,8 @@ private fun AccountCard(
onMarkAsDefault: (Long, String) -> Unit,
modifier: Modifier = Modifier,
onClick: (Long) -> Unit,
gradientStartColor: Color = MaterialTheme.colorScheme.primary,
gradientEndColor: Color = MaterialTheme.colorScheme.secondary,
gradientStartColor: Color = KptTheme.colorScheme.primary,
gradientEndColor: Color = KptTheme.colorScheme.secondary,
) {
val brush = remember {
Brush.linearGradient(
@ -361,7 +361,7 @@ private fun AccountCard(
.height(200.dp)
.background(
brush = brush,
shape = RoundedCornerShape(16.dp),
shape = KptTheme.shapes.large,
)
.clip(RoundedCornerShape(16.dp))
.clickable {
@ -371,7 +371,7 @@ private fun AccountCard(
Column(
modifier = Modifier
.fillMaxSize()
.padding(16.dp),
.padding(KptTheme.spacing.md),
verticalArrangement = Arrangement.SpaceBetween,
) {
Row(
@ -384,14 +384,14 @@ private fun AccountCard(
Text(
text = stringResource(Res.string.feature_home_account_type),
fontWeight = FontWeight(300),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.surface,
style = KptTheme.typography.bodySmall,
color = KptTheme.colorScheme.surface,
)
Text(
text = account.name,
fontWeight = FontWeight(400),
color = MaterialTheme.colorScheme.surface,
color = KptTheme.colorScheme.surface,
)
}
@ -401,7 +401,7 @@ private fun AccountCard(
if (it) {
MifosSmallChip(
label = "Default",
containerColor = MaterialTheme.colorScheme.primary,
containerColor = KptTheme.colorScheme.primary,
)
} else {
CardDropdownBox(
@ -420,8 +420,8 @@ private fun AccountCard(
Text(
text = account.number,
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.surface,
style = MaterialTheme.typography.headlineMedium,
color = KptTheme.colorScheme.surface,
style = KptTheme.typography.headlineMedium,
letterSpacing = 0.50.sp,
)
}
@ -436,8 +436,8 @@ private fun AccountCard(
Text(
text = stringResource(Res.string.feature_home_wallet_balance),
fontWeight = FontWeight(300),
style = MaterialTheme.typography.bodySmall,
color = MaterialTheme.colorScheme.surface,
style = KptTheme.typography.bodySmall,
color = KptTheme.colorScheme.surface,
)
val accountBalance = CurrencyFormatter.format(
@ -448,8 +448,8 @@ private fun AccountCard(
Text(
text = accountBalance,
color = MaterialTheme.colorScheme.surface,
style = MaterialTheme.typography.headlineLarge,
color = KptTheme.colorScheme.surface,
style = KptTheme.typography.headlineLarge,
)
}
@ -459,7 +459,7 @@ private fun AccountCard(
.padding(4.dp),
imageVector = Icons.Filled.KeyboardArrowUp,
contentDescription = stringResource(Res.string.feature_home_arrow_up),
tint = MaterialTheme.colorScheme.surface,
tint = KptTheme.colorScheme.surface,
)
}
}
@ -479,7 +479,7 @@ fun CardDropdownBox(
showDropdown = !showDropdown
},
colors = IconButtonDefaults.iconButtonColors(
contentColor = MaterialTheme.colorScheme.surface,
contentColor = KptTheme.colorScheme.surface,
),
) {
Icon(
@ -560,7 +560,7 @@ private fun MifosSendMoneyFreeCard(
Card(
modifier = modifier,
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surface,
containerColor = KptTheme.colorScheme.surface,
),
) {
Row(
@ -569,18 +569,23 @@ private fun MifosSendMoneyFreeCard(
) {
Column(
modifier = Modifier
.padding(start = 20.dp, end = 10.dp, top = 20.dp, bottom = 20.dp)
.padding(
start = KptTheme.spacing.lg,
end = KptTheme.spacing.md,
top = KptTheme.spacing.lg,
bottom = KptTheme.spacing.lg,
)
.weight(7.5f),
) {
Text(
text = stringResource(Res.string.start_sending_your_money_tax_free),
color = MaterialTheme.colorScheme.primary,
color = KptTheme.colorScheme.primary,
fontWeight = FontWeight(500),
style = MaterialTheme.typography.bodyLarge,
style = KptTheme.typography.bodyLarge,
)
Text(
text = stringResource(Res.string.feature_home_desc),
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
fontWeight = FontWeight(300),
)
}
@ -606,8 +611,8 @@ private fun PaymentButton(
modifier = modifier,
onClick = onClick,
colors = ButtonDefaults.buttonColors(
containerColor = MaterialTheme.colorScheme.surface,
contentColor = MaterialTheme.colorScheme.onSurface,
containerColor = KptTheme.colorScheme.surface,
contentColor = KptTheme.colorScheme.onSurface,
),
) {
Row(verticalAlignment = Alignment.CenterVertically) {

View File

@ -10,18 +10,15 @@
package org.mifospay.feature.invoices
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import mobile_wallet.feature.invoices.generated.resources.Res
import mobile_wallet.feature.invoices.generated.resources.ic_check
import mobile_wallet.feature.invoices.generated.resources.ic_remove
@ -29,6 +26,7 @@ import org.jetbrains.compose.resources.vectorResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.mifospay.core.model.datatables.invoice.Invoice
import org.mifospay.core.ui.AvatarBox
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun InvoiceItem(
@ -42,7 +40,7 @@ internal fun InvoiceItem(
onClick = {
onClick(invoice.invoiceId)
},
shape = RoundedCornerShape(8.dp),
shape = KptTheme.shapes.small,
colors = CardDefaults.cardColors(
containerColor = Color.Transparent,
),
@ -64,9 +62,9 @@ internal fun InvoiceItem(
},
),
contentColor = if (invoice.status == 1L) {
MaterialTheme.colorScheme.primary
KptTheme.colorScheme.primary
} else {
MaterialTheme.colorScheme.error
KptTheme.colorScheme.error
},
)
},
@ -74,7 +72,7 @@ internal fun InvoiceItem(
Text(
text = invoice.amount.toString(),
fontWeight = FontWeight.SemiBold,
style = MaterialTheme.typography.titleSmall,
style = KptTheme.typography.titleSmall,
)
},
colors = ListItemDefaults.colors(

View File

@ -19,13 +19,11 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.invoices.generated.resources.Res
import mobile_wallet.feature.invoices.generated.resources.feature_invoices_error_no_invoices_found
@ -39,6 +37,7 @@ import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.model.datatables.invoice.Invoice
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
fun InvoiceScreen(
@ -102,7 +101,7 @@ private fun InvoiceScreen(
title = stringResource(Res.string.feature_invoices_error_oops),
subTitle = stringResource(Res.string.feature_invoices_unexpected_error_subtitle),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -129,8 +128,8 @@ private fun InvoicesList(
LazyColumn(
modifier = modifier.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
items(
items = invoiceList,

View File

@ -21,7 +21,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -29,7 +28,6 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.invoices.generated.resources.Res
import mobile_wallet.feature.invoices.generated.resources.feature_invoices_amount
@ -53,6 +51,7 @@ import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.invoices.details.InvoiceDetailState.ViewState.Content
import org.mifospay.feature.invoices.details.InvoiceDetailState.ViewState.Error
import org.mifospay.feature.invoices.details.InvoiceDetailState.ViewState.Loading
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun InvoiceDetailScreen(
@ -128,8 +127,8 @@ private fun InvoiceDetailContent(
LazyColumn(
modifier = modifier.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
InvoiceDetailCard(
@ -153,7 +152,7 @@ private fun InvoiceDetailCard(
Text(text = stringResource(Res.string.feature_invoices_merchant_id))
Text(
text = invoice.consumerId,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
)
}
@ -162,7 +161,7 @@ private fun InvoiceDetailCard(
Text(text = stringResource(Res.string.feature_invoices_consumer_id))
Text(
text = invoice.consumerName,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
)
}
@ -171,7 +170,7 @@ private fun InvoiceDetailCard(
Text(text = stringResource(Res.string.feature_invoices_amount))
Text(
text = invoice.amount.toString(),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
)
}
@ -180,7 +179,7 @@ private fun InvoiceDetailCard(
Text(text = stringResource(Res.string.feature_invoices_items_bought))
Text(
text = invoice.itemsBought,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
)
}
@ -190,7 +189,7 @@ private fun InvoiceDetailCard(
Text(
text = if (invoice.status == 1L) Constants.DONE else Constants.PENDING,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
)
}
@ -199,7 +198,7 @@ private fun InvoiceDetailCard(
Text(text = stringResource(Res.string.feature_invoices_transaction_id))
Text(
text = invoice.transactionId,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
)
}
@ -209,7 +208,7 @@ private fun InvoiceDetailCard(
Text(
text = invoice.date,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
fontWeight = FontWeight.SemiBold,
)
}
@ -224,12 +223,12 @@ private inline fun RowBlock(
) {
Column(
modifier = modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 8.dp),
.padding(horizontal = KptTheme.spacing.sm),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {

View File

@ -17,13 +17,11 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -34,7 +32,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.kyc.generated.resources.Res
import mobile_wallet.feature.kyc.generated.resources.feature_kyc_check
@ -49,6 +46,7 @@ import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.ui.AvatarBox
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
fun KYCScreen(
@ -97,7 +95,7 @@ private fun KYCDescriptionScreen(
title = stringResource(Res.string.feature_kyc_error_oops),
subTitle = stringResource(Res.string.feature_kyc_unexpected_error_subtitle),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -124,16 +122,16 @@ private fun KYCDescriptionScreen(
Column(
modifier = modifier
.fillMaxSize()
.padding(16.dp)
.padding(KptTheme.spacing.md)
.verticalScroll(rememberScrollState()),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_kyc_complete_kyc),
modifier = Modifier.padding(vertical = 20.dp),
modifier = Modifier.padding(horizontal = KptTheme.spacing.lg),
textAlign = TextAlign.Center,
style = MaterialTheme.typography.titleMedium,
style = KptTheme.typography.titleMedium,
)
KycLevel.entries.forEach { kycLevel ->
@ -166,15 +164,15 @@ private fun KYCLevelCard(
Row(
modifier = modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
OutlinedCard(
enabled = enabled,
onClick = onClick,
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
disabledContainerColor = MaterialTheme.colorScheme.surfaceContainerHighest,
disabledContainerColor = KptTheme.colorScheme.surfaceContainerHighest,
),
border = CardDefaults.outlinedCardBorder(enabled = true),
modifier = Modifier.weight(2.5f, false),
@ -186,7 +184,7 @@ private fun KYCLevelCard(
leadingContent = {
AvatarBox(
icon = icon,
backgroundColor = MaterialTheme.colorScheme.secondaryContainer,
backgroundColor = KptTheme.colorScheme.secondaryContainer,
)
},
trailingContent = {

View File

@ -23,7 +23,6 @@ import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
@ -38,7 +37,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import kotlinx.coroutines.launch
import mobile_wallet.feature.kyc.generated.resources.Res
@ -59,6 +57,7 @@ import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.designsystem.component.MifosTextField
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun KYCLevel1Screen(
@ -122,8 +121,8 @@ private fun KYCLevel1ScreenContent(
modifier = Modifier
.fillMaxSize()
.padding(paddingValues),
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
MifosTextField(
@ -132,9 +131,6 @@ private fun KYCLevel1ScreenContent(
onValueChange = {
onAction(KycLevel1Action.FirstNameChanged(it))
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
@ -145,9 +141,6 @@ private fun KYCLevel1ScreenContent(
onValueChange = {
onAction(KycLevel1Action.LastNameChanged(it))
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
@ -159,9 +152,6 @@ private fun KYCLevel1ScreenContent(
onValueChange = {
onAction(KycLevel1Action.MobileNoChanged(it))
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
@ -172,9 +162,6 @@ private fun KYCLevel1ScreenContent(
onValueChange = {
onAction(KycLevel1Action.AddressLine1Changed(it))
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
@ -185,9 +172,6 @@ private fun KYCLevel1ScreenContent(
onValueChange = {
onAction(KycLevel1Action.AddressLine2Changed(it))
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
@ -240,8 +224,8 @@ private fun KYCLevel1ScreenContent(
showDialog = true
},
colors = IconButtonDefaults.iconButtonColors(
containerColor = MaterialTheme.colorScheme.tertiary,
contentColor = MaterialTheme.colorScheme.tertiaryContainer,
containerColor = KptTheme.colorScheme.tertiary,
contentColor = KptTheme.colorScheme.tertiaryContainer,
),
) {
Icon(
@ -251,9 +235,6 @@ private fun KYCLevel1ScreenContent(
}
},
onValueChange = {},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}

View File

@ -17,10 +17,8 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
@ -58,6 +56,7 @@ import org.mifospay.core.designsystem.component.MifosTextField
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.ui.AvatarBox
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun KYCLevel2Screen(
@ -133,8 +132,11 @@ private fun KYCLevel2ScreenContent(
modifier = modifier
.verticalScroll(rememberScrollState())
.fillMaxSize()
.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterVertically),
.padding(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(
KptTheme.spacing.md,
Alignment.CenterVertically,
),
horizontalAlignment = Alignment.CenterHorizontally,
) {
DocumentPicker(
@ -194,15 +196,15 @@ private fun DocumentPicker(
modifier = modifier
.fillMaxWidth()
.height(200.dp),
shape = RoundedCornerShape(8.dp),
shape = KptTheme.shapes.small,
border = CardDefaults.outlinedCardBorder(
enabled = true,
).copy(
width = 1.dp,
brush = Brush.sweepGradient(
colors = listOf(
MaterialTheme.colorScheme.primary,
MaterialTheme.colorScheme.secondary,
KptTheme.colorScheme.primary,
KptTheme.colorScheme.secondary,
),
),
),
@ -226,7 +228,7 @@ private fun DocumentPicker(
AvatarBox(
icon = MifosIcons.Add,
size = 120,
contentColor = MaterialTheme.colorScheme.secondary,
contentColor = KptTheme.colorScheme.secondary,
)
}
@ -234,7 +236,7 @@ private fun DocumentPicker(
AvatarBox(
icon = MifosIcons.Add,
size = 120,
contentColor = MaterialTheme.colorScheme.secondary,
contentColor = KptTheme.colorScheme.secondary,
)
}

View File

@ -23,13 +23,11 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -71,6 +69,7 @@ import org.mifospay.core.model.utils.PaymentQrData
import org.mifospay.core.ui.AvatarBox
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun MakeTransferScreen(
@ -141,8 +140,8 @@ internal fun MakeTransferScreen(
.fillMaxSize()
.padding(paddingValues),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
MifosTextField(
@ -194,7 +193,7 @@ private fun AccountListState(
) {
Box(
modifier = modifier.fillMaxWidth()
.padding(16.dp),
.padding(KptTheme.spacing.md),
contentAlignment = Alignment.Center,
) {
when (state) {
@ -204,7 +203,7 @@ private fun AccountListState(
contentDesc = stringResource(Res.string.feature_make_transfer_loading),
modifier = Modifier
.align(Alignment.Center)
.padding(16.dp),
.padding(KptTheme.spacing.md),
)
}
}
@ -220,7 +219,7 @@ private fun AccountListState(
EmptyContentScreen(
title = stringResource(Res.string.feature_make_transfer_oops_title),
subTitle = stringResource(Res.string.feature_make_transfer_no_accounts_found),
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -246,12 +245,12 @@ private fun AccountList(
) {
LazyColumn(
modifier = modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
Text(
text = stringResource(Res.string.feature_make_transfer_from_account),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
}
items(items = accounts, key = { account -> account.id }) { account ->
@ -290,7 +289,7 @@ private fun AccountItem(
leadingContent = {
AvatarBox(
icon = MifosIcons.Bank,
backgroundColor = MaterialTheme.colorScheme.surfaceContainerHigh,
backgroundColor = KptTheme.colorScheme.surfaceContainerHigh,
)
},
trailingContent = {
@ -305,9 +304,9 @@ private fun AccountItem(
},
contentDescription = stringResource(Res.string.feature_make_transfer_check_icon_description),
tint = if (it) {
MaterialTheme.colorScheme.primary
KptTheme.colorScheme.primary
} else {
MaterialTheme.colorScheme.outlineVariant
KptTheme.colorScheme.outlineVariant
},
)
}
@ -326,11 +325,11 @@ private fun ClientCard(
) {
Column(
modifier = modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_make_transfer_to_account),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
OutlinedCard(
@ -349,12 +348,12 @@ private fun ClientCard(
leadingContent = {
AvatarBox(
icon = MifosIcons.Bank,
backgroundColor = MaterialTheme.colorScheme.surfaceContainerHigh,
backgroundColor = KptTheme.colorScheme.surfaceContainerHigh,
)
},
trailingContent = {
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
verticalAlignment = Alignment.CenterVertically,
) {
AccountBadge(
@ -363,7 +362,7 @@ private fun ClientCard(
AccountBadge(
text = stringResource(Res.string.feature_make_transfer_badge_saving),
borderColor = MaterialTheme.colorScheme.secondary,
borderColor = KptTheme.colorScheme.secondary,
)
}
},
@ -379,7 +378,7 @@ private fun ClientCard(
private fun AccountBadge(
text: String,
modifier: Modifier = Modifier,
borderColor: Color = MaterialTheme.colorScheme.primary,
borderColor: Color = KptTheme.colorScheme.primary,
) {
OutlinedCard(
modifier = modifier,
@ -387,12 +386,12 @@ private fun AccountBadge(
containerColor = Color.Transparent,
),
border = BorderStroke(1.dp, borderColor),
shape = RoundedCornerShape(2.dp),
shape = KptTheme.shapes.extraSmall,
) {
Text(
text = text,
style = MaterialTheme.typography.labelSmall,
modifier = Modifier.padding(4.dp),
style = KptTheme.typography.labelSmall,
modifier = Modifier.padding(KptTheme.spacing.xs),
)
}
}

View File

@ -17,7 +17,6 @@ import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -33,6 +32,7 @@ import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.resources.vectorResource
import org.mifospay.core.designsystem.component.MifosButton
import org.mifospay.core.designsystem.component.MifosScaffold
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun TransferSuccessScreen(
@ -50,7 +50,7 @@ internal fun TransferSuccessScreen(
onClick = navigateBack,
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(KptTheme.spacing.md),
) {
Text(text = stringResource(Res.string.feature_make_transfer_back_to_home))
}
@ -66,7 +66,10 @@ internal fun TransferSuccessScreen(
Column(
modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterVertically),
verticalArrangement = Arrangement.spacedBy(
KptTheme.spacing.md,
Alignment.CenterVertically,
),
) {
Image(
imageVector = vectorResource(Res.drawable.process_ring),
@ -76,12 +79,12 @@ internal fun TransferSuccessScreen(
Text(
text = stringResource(Res.string.feature_make_transfer_payment_success),
style = MaterialTheme.typography.headlineMedium,
style = KptTheme.typography.headlineMedium,
)
Text(
text = stringResource(Res.string.feature_make_transfer_payment_done),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
)
}
}

View File

@ -19,7 +19,6 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SearchBar
import androidx.compose.material3.SearchBarDefaults
import androidx.compose.material3.Text
@ -31,7 +30,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalClipboardManager
import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import androidx.navigation.compose.rememberNavController
import mobile_wallet.feature.merchants.generated.resources.Res
@ -62,6 +60,7 @@ import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.feature.merchants.MerchantUiState
import org.mifospay.feature.merchants.MerchantViewModel
import org.mifospay.feature.merchants.navigation.navigateToMerchantTransferScreen
import template.core.base.designsystem.theme.KptTheme
@Composable
fun MerchantScreen(
@ -121,14 +120,14 @@ internal fun MerchantScreen(
title = stringResource(Res.string.feature_merchants_error_oops),
subTitle = stringResource(Res.string.feature_merchants_unexpected_error_subtitle),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
MerchantUiState.Loading -> {
MfLoadingWheel(
contentDesc = stringResource(Res.string.feature_merchants_loading),
backgroundColor = MaterialTheme.colorScheme.surface,
backgroundColor = KptTheme.colorScheme.surface,
)
}
@ -177,7 +176,7 @@ private fun MerchantList(
LazyColumn(
modifier = modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
.padding(horizontal = KptTheme.spacing.md),
) {
items(merchantList.size) { index ->
MerchantsItem(
@ -186,7 +185,7 @@ private fun MerchantList(
navController.navigateToMerchantTransferScreen(
merchantVPA = merchantList[index].accountNo,
merchantName = merchantList[index].clientName,
merchantAccountNumber = merchantList[index].accountNo.toString(),
merchantAccountNumber = merchantList[index].accountNo,
)
// val intent = Intent(context, MerchantTransferActivity::class.java)
// intent.putExtra(Constants.MERCHANT_NAME, merchantList[index].clientName)
@ -246,7 +245,7 @@ private fun SearchBarScreen(
onExpandedChange = {},
modifier = modifier
.fillMaxWidth()
.padding(vertical = 16.dp, horizontal = 16.dp),
.padding(vertical = KptTheme.spacing.md, horizontal = KptTheme.spacing.md),
shape = SearchBarDefaults.inputFieldShape,
colors = SearchBarDefaults.colors(),
tonalElevation = SearchBarDefaults.TonalElevation,

View File

@ -30,7 +30,6 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.HorizontalDivider
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
@ -77,6 +76,7 @@ import org.mifospay.core.model.savingsaccount.TransactionType
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.feature.merchants.MerchantTransferUiState
import org.mifospay.feature.merchants.MerchantTransferViewModel
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun MerchantTransferScreenRoute(
@ -125,7 +125,7 @@ internal fun MerchantTransferScreen(
is MerchantTransferUiState.Loading -> {
MfLoadingWheel(
contentDesc = stringResource(Res.string.feature_merchants_loading),
backgroundColor = MaterialTheme.colorScheme.surface,
backgroundColor = KptTheme.colorScheme.surface,
)
}
@ -134,7 +134,7 @@ internal fun MerchantTransferScreen(
modifier = Modifier,
title = stringResource(Res.string.feature_merchants_error_oops),
subTitle = stringResource(Res.string.feature_merchants_unexpected_error_subtitle),
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -200,17 +200,17 @@ private fun MerchantBottomSheet(
modifier =
Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 24.dp),
.padding(horizontal = KptTheme.spacing.md, vertical = KptTheme.spacing.lg),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
text = stringResource(Res.string.feature_merchants_transfer_money_to_this_merchant),
color = MaterialTheme.colorScheme.tertiaryContainer.copy(
color = KptTheme.colorScheme.tertiaryContainer.copy(
red = 0.38f,
green = 0f,
blue = 0.93f,
),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
)
Spacer(modifier = Modifier.height(24.dp))
@ -235,12 +235,12 @@ private fun MerchantBottomSheet(
merchantVPA,
)
},
colors = ButtonDefaults.buttonColors(MaterialTheme.colorScheme.primary),
colors = ButtonDefaults.buttonColors(KptTheme.colorScheme.primary),
modifier = Modifier.width(155.dp),
) {
Text(
stringResource(Res.string.feature_merchants_submit),
color = MaterialTheme.colorScheme.onPrimary,
color = KptTheme.colorScheme.onPrimary,
)
}
}
@ -258,20 +258,20 @@ private fun MerchantInfo(
) {
Column(
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(10.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
modifier = modifier,
) {
MerchantInitialAvatar(merchantName)
Text(
text = merchantName,
style = MaterialTheme.typography.labelMedium,
style = KptTheme.typography.labelMedium,
)
Text(
text = merchantVPA,
style = MaterialTheme.typography.labelMedium,
color = MaterialTheme.colorScheme.outline,
style = KptTheme.typography.labelMedium,
color = KptTheme.colorScheme.outline,
)
}
}
@ -288,14 +288,14 @@ private fun MerchantInitialAvatar(
modifier
.size(86.dp)
.background(
color = MaterialTheme.colorScheme.primary,
color = KptTheme.colorScheme.primary,
shape = CircleShape,
),
contentAlignment = Alignment.Center,
) {
Text(
text = initial,
color = MaterialTheme.colorScheme.onPrimary,
color = KptTheme.colorScheme.onPrimary,
fontSize = 44.sp,
fontWeight = FontWeight.Medium,
)
@ -307,7 +307,7 @@ private fun SpecificTransactionItem(
transaction: Transaction,
modifier: Modifier = Modifier,
) {
Column(modifier = modifier.padding(horizontal = 12.dp)) {
Column(modifier = modifier.padding(horizontal = KptTheme.spacing.md)) {
Row(verticalAlignment = Alignment.CenterVertically) {
SpecificTransactionAccountInfo(
amount = transaction.amount.toString(),
@ -323,19 +323,19 @@ private fun SpecificTransactionItem(
}
Spacer(modifier = Modifier.height(12.dp))
Row(
modifier = Modifier.padding(horizontal = 8.dp),
modifier = Modifier.padding(horizontal = KptTheme.spacing.sm),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
Column {
Text(
text = stringResource(Res.string.feature_merchants_transaction_id) + transaction.transactionId,
style = MaterialTheme.typography.bodyLarge,
color = MaterialTheme.colorScheme.primary,
style = KptTheme.typography.bodyLarge,
color = KptTheme.colorScheme.primary,
)
Text(
text = stringResource(Res.string.feature_merchants_transaction_date) + transaction.date,
style = MaterialTheme.typography.bodyLarge,
style = KptTheme.typography.bodyLarge,
)
Text(
text =
@ -344,28 +344,28 @@ private fun SpecificTransactionItem(
TransactionType.CREDIT -> stringResource(Res.string.feature_merchants_credits)
TransactionType.OTHER -> stringResource(Res.string.feature_merchants_other)
},
style = MaterialTheme.typography.bodyLarge,
style = KptTheme.typography.bodyLarge,
)
}
Spacer(modifier = Modifier.weight(1f))
Text(
text = "${transaction.currency.code}${transaction.amount}",
style = MaterialTheme.typography.displaySmall,
style = KptTheme.typography.displaySmall,
color =
when (transaction.transactionType) {
TransactionType.DEBIT -> MaterialTheme.colorScheme.error.copy(
TransactionType.DEBIT -> KptTheme.colorScheme.error.copy(
red = 0.8f,
green = 0f,
blue = 0f,
)
TransactionType.CREDIT -> MaterialTheme.colorScheme.onTertiaryContainer.copy(
TransactionType.CREDIT -> KptTheme.colorScheme.onTertiaryContainer.copy(
red = 0f,
green = 0.51f,
blue = 0.21f,
)
TransactionType.OTHER -> MaterialTheme.colorScheme.primaryContainer.copy(
TransactionType.OTHER -> KptTheme.colorScheme.primaryContainer.copy(
red = 1f,
green = 1f,
blue = 0f,
@ -393,11 +393,11 @@ private fun SpecificTransactionAccountInfo(
Icon(imageVector = MifosIcons.AccountCircle, contentDescription = null)
Text(
text = accountNo,
style = MaterialTheme.typography.titleSmall,
style = KptTheme.typography.titleSmall,
)
Text(
text = amount,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
)
}
}

View File

@ -19,7 +19,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
@ -32,6 +31,7 @@ import org.jetbrains.compose.ui.tooling.preview.Preview
import org.mifospay.core.designsystem.component.MifosCard
import org.mifospay.core.designsystem.theme.styleMedium16sp
import org.mifospay.core.model.savingsaccount.SavingsWithAssociationsEntity
import template.core.base.designsystem.theme.KptTheme
@OptIn(ExperimentalFoundationApi::class)
@Composable
@ -48,41 +48,41 @@ internal fun MerchantsItem(
onMerchantLongPressed(savingsWithAssociations.id.toString())
},
),
colors = CardDefaults.cardColors(MaterialTheme.colorScheme.surface),
colors = CardDefaults.cardColors(KptTheme.colorScheme.surface),
) {
Column {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp),
.padding(horizontal = KptTheme.spacing.md),
) {
Icon(
painter = painterResource(Res.drawable.feature_merchants_ic_bank),
contentDescription = null,
modifier = Modifier
.align(Alignment.CenterVertically)
.padding(start = 16.dp, end = 16.dp)
.padding(start = KptTheme.spacing.md, end = KptTheme.spacing.md)
.size(39.dp),
)
Column {
Text(
text = savingsWithAssociations.clientName,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
Text(
text = savingsWithAssociations.accountNo,
modifier = Modifier.padding(top = 4.dp),
modifier = Modifier.padding(top = KptTheme.spacing.xs),
style = styleMedium16sp,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
}
}
}
HorizontalDivider(
thickness = 1.dp,
modifier = Modifier.padding(8.dp),
color = MaterialTheme.colorScheme.outlineVariant,
modifier = Modifier.padding(KptTheme.spacing.sm),
color = KptTheme.colorScheme.outlineVariant,
)
}
}

View File

@ -18,11 +18,9 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -30,7 +28,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.notification.generated.resources.Res
import mobile_wallet.feature.notification.generated.resources.feature_notification_error_oops
@ -49,6 +46,7 @@ import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.model.notification.Notification
import org.mifospay.core.ui.EmptyContentScreen
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun NotificationScreen(
@ -89,7 +87,7 @@ internal fun NotificationScreen(
title = stringResource(Res.string.feature_notification_error_oops),
subTitle = stringResource(Res.string.feature_notification_unexpected_error_subtitle),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -124,8 +122,8 @@ private fun NotificationScreenContent(
) {
LazyColumn(
modifier = modifier.fillMaxSize(),
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
items(
items = state.notificationList,
@ -148,7 +146,7 @@ private fun NotificationListItem(
OutlinedCard(
modifier = modifier
.fillMaxWidth(),
shape = RoundedCornerShape(12.dp),
shape = KptTheme.shapes.medium,
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
),

View File

@ -19,7 +19,6 @@ import androidx.compose.material3.FilledTonalIconButton
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -43,6 +42,7 @@ import org.koin.compose.viewmodel.koinViewModel
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
fun RequestScreen(
@ -82,19 +82,19 @@ private fun RequestScreenContent(
modifier = modifier
.fillMaxSize()
.padding(20.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
Text(
modifier = Modifier.padding(top = 10.dp),
modifier = Modifier.padding(top = KptTheme.spacing.sm),
text = stringResource(Res.string.feature_payments_receive),
style = MaterialTheme.typography.titleMedium,
color = MaterialTheme.colorScheme.primary,
style = KptTheme.typography.titleMedium,
color = KptTheme.colorScheme.primary,
)
Column(
modifier = Modifier
.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
Row(
modifier = Modifier.fillMaxWidth(),
@ -102,13 +102,13 @@ private fun RequestScreenContent(
verticalAlignment = Alignment.CenterVertically,
) {
Column(
verticalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
horizontalAlignment = Alignment.Start,
) {
Text(text = stringResource(Res.string.feature_payments_vpa))
Text(
text = state.externalId,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
)
}
@ -127,7 +127,7 @@ private fun RequestScreenContent(
HorizontalDivider(
thickness = 1.dp,
color = MaterialTheme.colorScheme.outlineVariant,
color = KptTheme.colorScheme.outlineVariant,
)
Row(
@ -137,12 +137,12 @@ private fun RequestScreenContent(
) {
Column(
modifier = Modifier,
verticalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
Text(text = stringResource(Res.string.feature_payments_mobile_number))
Text(
text = state.mobileNo,
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
)
}

View File

@ -46,6 +46,7 @@ import org.mifospay.core.ui.ErrorScreenContent
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.profile.components.ProfileDetailsCard
import org.mifospay.feature.profile.components.ProfileImage
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun ProfileScreen(
@ -136,9 +137,9 @@ private fun ProfileScreenContent(
modifier = modifier
.fillMaxSize()
.verticalScroll(rememberScrollState())
.padding(12.dp),
.padding(horizontal = KptTheme.spacing.md),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
ProfileImage(bitmap = clientImage)

View File

@ -15,11 +15,9 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
@ -33,6 +31,7 @@ import mobile_wallet.feature.profile.generated.resources.feature_profile_usernam
import mobile_wallet.feature.profile.generated.resources.feature_profile_vpa
import org.jetbrains.compose.resources.stringResource
import org.mifospay.core.model.client.Client
import template.core.base.designsystem.theme.KptTheme
@Composable
fun ProfileDetailsCard(
@ -43,17 +42,17 @@ fun ProfileDetailsCard(
modifier = modifier
.fillMaxWidth(),
elevation = CardDefaults.cardElevation(),
shape = RoundedCornerShape(15.dp),
shape = KptTheme.shapes.large,
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.primaryContainer,
contentColor = MaterialTheme.colorScheme.onPrimary,
containerColor = KptTheme.colorScheme.primaryContainer,
contentColor = KptTheme.colorScheme.onPrimary,
),
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
.padding(horizontal = KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
ProfileItem(
label = stringResource(Res.string.feature_profile_username),
@ -79,8 +78,8 @@ fun ProfileDetailsCard(
fun ProfileItem(
label: String,
value: String,
labelColor: Color = MaterialTheme.colorScheme.primary,
textColor: Color = MaterialTheme.colorScheme.onSurface,
labelColor: Color = KptTheme.colorScheme.primary,
textColor: Color = KptTheme.colorScheme.onSurface,
modifier: Modifier = Modifier,
) {
Column(
@ -89,13 +88,13 @@ fun ProfileItem(
Text(
text = label,
color = labelColor,
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
Spacer(modifier = Modifier.height(10.dp))
Text(
text = value,
color = textColor,
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
fontWeight = FontWeight(400),
)
Spacer(modifier = Modifier.height(4.dp))

View File

@ -17,7 +17,6 @@ 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
@ -34,6 +33,7 @@ import mobile_wallet.feature.profile.generated.resources.placeholder
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
import org.mifospay.core.designsystem.icon.MifosIcons
import template.core.base.designsystem.theme.KptTheme
import kotlin.io.encoding.Base64
import kotlin.io.encoding.ExperimentalEncodingApi
@ -70,7 +70,7 @@ fun ProfileImage(
modifier = Modifier
.size(150.dp)
.clip(CircleShape)
.border(4.dp, MaterialTheme.colorScheme.primary, CircleShape),
.border(4.dp, KptTheme.colorScheme.primary, CircleShape),
)
}
}
@ -99,7 +99,7 @@ fun EditableProfileImage(
modifier = Modifier
.size(150.dp)
.clip(CircleShape)
.border(4.dp, MaterialTheme.colorScheme.primary, CircleShape),
.border(4.dp, KptTheme.colorScheme.primary, CircleShape),
)
IconButton(
@ -109,7 +109,7 @@ fun EditableProfileImage(
.size(36.dp)
.clip(CircleShape)
.align(Alignment.BottomCenter),
colors = IconButtonDefaults.iconButtonColors(MaterialTheme.colorScheme.surface),
colors = IconButtonDefaults.iconButtonColors(KptTheme.colorScheme.surface),
) {
Icon(
imageVector = MifosIcons.Edit2,

View File

@ -50,6 +50,7 @@ import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.designsystem.component.MifosTextField
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.profile.components.EditableProfileImage
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun EditProfileScreen(
@ -110,8 +111,8 @@ private fun EditProfileScreenContent(
modifier = modifier
.padding(paddingValues)
.fillMaxSize(),
contentPadding = PaddingValues(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
horizontalAlignment = Alignment.CenterHorizontally,
) {
item {

View File

@ -18,7 +18,7 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clipToBounds
import androidx.compose.ui.unit.dp
import template.core.base.designsystem.theme.KptTheme
@Composable
expect fun QrCodeScanner(
@ -45,7 +45,7 @@ fun QrScannerWithPermissions(
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text(
modifier = Modifier.padding(6.dp),
modifier = Modifier.padding(KptTheme.spacing.sm),
text = permissionText,
)
Button(

View File

@ -13,7 +13,6 @@ import androidx.annotation.VisibleForTesting
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue
@ -26,6 +25,7 @@ import org.koin.compose.viewmodel.koinViewModel
import org.mifospay.core.designsystem.component.MifosLoadingWheel
import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.ui.EmptyContentScreen
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun ReceiptScreenRoute(
@ -69,7 +69,7 @@ internal fun ReceiptScreen(
EmptyContentScreen(
title = "Oops!",
subTitle = uiState.message,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}

View File

@ -19,7 +19,6 @@ import androidx.compose.foundation.layout.width
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -49,6 +48,7 @@ import org.mifospay.core.ui.AvatarBox
import org.mifospay.core.ui.DropdownBox
import org.mifospay.core.ui.DropdownBoxItem
import org.mifospay.core.ui.MifosDivider
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun SetAmountDialog(
@ -67,12 +67,12 @@ internal fun SetAmountDialog(
shape = RoundedCornerShape(16.dp),
) {
Column(
modifier = Modifier.padding(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
modifier = Modifier.padding(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
Text(
text = stringResource(Res.string.feature_request_money_set_amount),
style = MaterialTheme.typography.titleMedium,
style = KptTheme.typography.titleMedium,
)
val amountValidator by remember(amount) {
@ -88,7 +88,7 @@ internal fun SetAmountDialog(
"Please enter a valid amount"
}
amount.trim().toDouble().compareTo(0.0) <= 0 -> {
amount.trim().toDouble() <= 0.0 -> {
"Please enter a valid amount"
}
@ -196,7 +196,6 @@ private fun CurrencyDropdownItem(
headlineContent = {
Text(
text = currency.countryName,
// color = MaterialTheme.colorScheme.onSurface,
)
},
leadingContent = {
@ -207,7 +206,7 @@ private fun CurrencyDropdownItem(
trailingContent = {
Text(
text = currency.currencyCode,
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
)
},
modifier = modifier

View File

@ -22,8 +22,6 @@ import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -45,6 +43,7 @@ import org.mifospay.core.designsystem.component.MifosLoadingWheel
import org.mifospay.core.designsystem.component.MifosOutlinedButton
import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun ShowQrScreen(
@ -154,9 +153,9 @@ private fun ShowQrScreenContent(
modifier = modifier
.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
QrDataContent(
@ -197,7 +196,7 @@ private fun QrDataContent(
Box(
modifier = modifier
.size(350.dp, 381.dp)
.background(Color.White, shape = RoundedCornerShape(15.dp)),
.background(Color.White, shape = KptTheme.shapes.large),
contentAlignment = Alignment.Center,
) {
Column(
@ -205,19 +204,22 @@ private fun QrDataContent(
.fillMaxSize()
.align(Alignment.Center),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(20.dp, Alignment.CenterVertically),
verticalArrangement = Arrangement.spacedBy(
KptTheme.spacing.lg,
Alignment.CenterVertically,
),
) {
Text(
text = "Mifos Pay",
style = MaterialTheme.typography.titleLarge,
color = MaterialTheme.colorScheme.primary,
style = KptTheme.typography.titleLarge,
color = KptTheme.colorScheme.primary,
)
Image(
painter = painter,
contentDescription = null,
modifier = Modifier
.padding(bottom = 45.dp)
.padding(bottom = KptTheme.spacing.xxl)
.size(260.dp),
)
}

View File

@ -23,7 +23,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.FabPosition
import androidx.compose.material3.FilledTonalIconButton
@ -32,7 +31,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButtonDefaults
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
@ -67,6 +65,7 @@ import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.savedcards.createOrUpdate.CardAddEditType
import org.mifospay.feature.savedcards.utils.CreditCardUtils.detectCardType
import org.mifospay.feature.savedcards.utils.CreditCardUtils.maskCreditCardNumber
import template.core.base.designsystem.theme.KptTheme
/**
* Known Issue, On deleting card, state isn't updating automatically
@ -205,7 +204,7 @@ internal fun CardsScreen(
title = stringResource(Res.string.feature_savedcards_error_oops),
subTitle = stringResource(Res.string.feature_savedcards_subtitle),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -228,8 +227,8 @@ private fun CardsScreenContent(
) {
LazyColumn(
modifier = modifier.fillMaxSize(),
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
items(
items = state.cards,
@ -261,7 +260,7 @@ private fun SavedCardItem(
) {
OutlinedCard(
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(8.dp),
shape = KptTheme.shapes.small,
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
),
@ -295,15 +294,15 @@ private fun SavedCardItem(
trailingContent = {
Row(
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
FilledTonalIconButton(
onClick = {
onClickEdit(savedCard.id)
},
colors = IconButtonDefaults.filledTonalIconButtonColors(
containerColor = MaterialTheme.colorScheme.surfaceContainerHighest,
contentColor = MaterialTheme.colorScheme.onSurfaceVariant,
containerColor = KptTheme.colorScheme.surfaceContainerHighest,
contentColor = KptTheme.colorScheme.onSurfaceVariant,
),
) {
Icon(
@ -317,8 +316,8 @@ private fun SavedCardItem(
onClickDelete(savedCard.id)
},
colors = IconButtonDefaults.filledTonalIconButtonColors(
containerColor = MaterialTheme.colorScheme.errorContainer,
contentColor = MaterialTheme.colorScheme.error,
containerColor = KptTheme.colorScheme.errorContainer,
contentColor = KptTheme.colorScheme.error,
),
) {
Icon(

View File

@ -34,7 +34,6 @@ import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -56,6 +55,7 @@ import org.mifospay.feature.savedcards.createOrUpdate.AECardState
import org.mifospay.feature.savedcards.utils.CardMaskStyle
import org.mifospay.feature.savedcards.utils.CardType
import org.mifospay.feature.savedcards.utils.creditCardColors
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun CreditCard(
@ -66,7 +66,7 @@ internal fun CreditCard(
) {
Card(
modifier = modifier.fillMaxWidth().aspectRatio(bankCardAspectRatio),
elevation = CardDefaults.cardElevation(defaultElevation = 16.dp),
elevation = CardDefaults.cardElevation(defaultElevation = KptTheme.elevation.level5),
) {
Box {
CreditCardBackground(baseColor = baseColor)
@ -78,7 +78,7 @@ internal fun CreditCard(
// Positioned to corner top left
SpaceWrapper(
modifier = Modifier.align(Alignment.TopStart),
space = 32.dp,
space = KptTheme.spacing.xl,
top = true,
left = true,
) {
@ -90,7 +90,7 @@ internal fun CreditCard(
// Positioned to corner bottom left
SpaceWrapper(
modifier = Modifier.align(Alignment.BottomStart),
space = 32.dp,
space = KptTheme.spacing.xl,
bottom = true,
left = true,
) {
@ -99,7 +99,7 @@ internal fun CreditCard(
label = "expires",
text = card.expiryDateFormatted,
)
Spacer(modifier = Modifier.width(16.dp))
Spacer(modifier = Modifier.width(KptTheme.spacing.md))
CreditCardLabelAndText(
label = "cvv",
text = card.maskedCVV,
@ -109,7 +109,7 @@ internal fun CreditCard(
// Positioned to corner bottom right
SpaceWrapper(
modifier = Modifier.align(Alignment.BottomEnd),
space = 32.dp,
space = KptTheme.spacing.xl,
bottom = true,
right = true,
) {
@ -122,7 +122,8 @@ internal fun CreditCard(
Image(
painter = painterResource(card.cardType.cardImage),
contentDescription = "Card Image",
modifier = Modifier.size(CardConfig.logoSize).padding(top = 10.dp),
modifier = Modifier.size(CardConfig.logoSize)
.padding(top = KptTheme.spacing.sm),
colorFilter = CardConfig.logoTint?.let { ColorFilter.tint(it) },
)
}
@ -136,8 +137,8 @@ private fun AnimatedCardNumberInput(
cardNumber: String,
cardType: CardType = CardType.detectCardType(cardNumber),
maskStyle: CardMaskStyle = CardMaskStyle.ALL_EXCEPT_LAST_FOUR,
textColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
dotColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
textColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
dotColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
modifier: Modifier = Modifier,
) {
val groups = remember(cardNumber, cardType) {
@ -169,7 +170,7 @@ private fun AnimatedCardNumberInput(
}
Box(
modifier = modifier.fillMaxSize().padding(horizontal = 32.dp),
modifier = modifier.fillMaxSize().padding(horizontal = KptTheme.spacing.xl),
contentAlignment = Alignment.Center,
) {
Row(
@ -203,8 +204,8 @@ private fun AnimatedCVVInput(
cvv: String,
cardType: CardType = CardType.UNKNOWN,
isVisible: Boolean = false,
textColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
dotColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
textColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
dotColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
modifier: Modifier = Modifier,
) {
val paddedCVV = remember(cvv, cardType) {
@ -221,7 +222,7 @@ private fun AnimatedCVVInput(
fontWeight = FontWeight.W300,
fontSize = 12.sp,
letterSpacing = 1.sp,
color = MaterialTheme.colorScheme.surfaceContainerLowest,
color = KptTheme.colorScheme.surfaceContainerLowest,
),
)
@ -350,8 +351,8 @@ private fun CreditCardBackground(baseColor: Color) {
private fun CreditCardLabelAndText(
label: String,
text: String,
labelColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
textColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
labelColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
textColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
) {
Column(
modifier = Modifier.wrapContentSize(),
@ -415,7 +416,7 @@ internal fun CreditCard(
) {
Card(
modifier = modifier.fillMaxWidth().aspectRatio(bankCardAspectRatio),
elevation = CardDefaults.cardElevation(defaultElevation = 16.dp),
elevation = CardDefaults.cardElevation(defaultElevation = KptTheme.elevation.level5),
onClick = onClick,
) {
Box {
@ -428,7 +429,7 @@ internal fun CreditCard(
// Positioned to corner top left
SpaceWrapper(
modifier = Modifier.align(Alignment.TopStart),
space = 32.dp,
space = KptTheme.spacing.xl,
top = true,
left = true,
) {
@ -440,7 +441,7 @@ internal fun CreditCard(
// Positioned to corner bottom left
SpaceWrapper(
modifier = Modifier.align(Alignment.BottomStart),
space = 32.dp,
space = KptTheme.spacing.xl,
bottom = true,
left = true,
) {
@ -459,7 +460,7 @@ internal fun CreditCard(
// Positioned to corner bottom right
SpaceWrapper(
modifier = Modifier.align(Alignment.BottomEnd),
space = 32.dp,
space = KptTheme.spacing.xl,
bottom = true,
right = true,
) {
@ -472,7 +473,7 @@ internal fun CreditCard(
Image(
painter = painterResource(cardType.cardImage),
contentDescription = "Card Image",
modifier = Modifier.size(CardConfig.logoSize).padding(top = 10.dp),
modifier = Modifier.size(CardConfig.logoSize).padding(top = KptTheme.spacing.sm),
colorFilter = CardConfig.logoTint?.let { ColorFilter.tint(it) },
)
}
@ -486,8 +487,8 @@ private fun DisplayCardNumberInput(
cardNumber: String,
cardType: CardType = CardType.detectCardType(cardNumber),
maskStyle: CardMaskStyle = CardMaskStyle.ALL_EXCEPT_LAST_FOUR,
textColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
dotColor: Color = MaterialTheme.colorScheme.surfaceContainerLowest,
textColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
dotColor: Color = KptTheme.colorScheme.surfaceContainerLowest,
modifier: Modifier = Modifier,
) {
val groups = remember(cardNumber, cardType) {
@ -523,7 +524,7 @@ private fun DisplayCardNumberInput(
}
Box(
modifier = modifier.fillMaxSize().padding(horizontal = 32.dp),
modifier = modifier.fillMaxSize().padding(horizontal = KptTheme.spacing.xl),
contentAlignment = Alignment.Center,
) {
Row(

View File

@ -25,9 +25,7 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
@ -68,6 +66,7 @@ import org.mifospay.core.ui.MifosPasswordField
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.savedcards.components.CreditCard
import org.mifospay.feature.savedcards.components.getCardNumberTransformation
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun AddEditCardScreen(
@ -164,8 +163,8 @@ private fun AddEditCardScreenContent(
modifier = modifier
.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
CreditCard(
@ -209,9 +208,6 @@ private fun AddEditCardScreenContent(
capitalization = KeyboardCapitalization.Characters,
keyboardType = KeyboardType.Text,
),
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
@ -236,9 +232,6 @@ private fun AddEditCardScreenContent(
modifier = Modifier
.fillMaxWidth()
.onFocusChanged { isFocused = it.isFocused },
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
@ -248,7 +241,7 @@ private fun AddEditCardScreenContent(
Row(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(16.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
MifosTextField(
value = state.expiryDateFormatted,
@ -260,9 +253,6 @@ private fun AddEditCardScreenContent(
onAction(AECardAction.ExpiryDateChanged(newValue))
}
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
MifosPasswordField(
@ -292,7 +282,7 @@ private fun AddEditCardScreenContent(
},
modifier = Modifier
.fillMaxWidth()
.padding(top = 16.dp),
.padding(horizontal = KptTheme.spacing.md),
onClick = { onAction(AECardAction.SaveCard) },
)
}
@ -311,7 +301,7 @@ fun CreditCardColorSelector(
.fillMaxWidth()
.horizontalScroll(rememberScrollState()),
verticalAlignment = Alignment.CenterVertically,
horizontalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
cardColors.forEach {
ColorSelector(
@ -329,13 +319,13 @@ fun ColorSelector(
isSelected: Boolean,
onColorSelected: () -> Unit,
) {
val borderColor = if (isSelected) MaterialTheme.colorScheme.onSurface else Color.Transparent
val borderColor = if (isSelected) KptTheme.colorScheme.onSurface else Color.Transparent
val borderWidth = if (isSelected) 2.dp else 0.dp
Box(
modifier = Modifier
.size(48.dp)
.clip(RoundedCornerShape(2.dp))
.clip(KptTheme.shapes.extraSmall)
.border(borderWidth, borderColor)
.background(color)
.clickable { onColorSelected() },

View File

@ -24,7 +24,6 @@ import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -54,6 +53,7 @@ import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.savedcards.components.CreditCard
import org.mifospay.feature.savedcards.utils.CardMaskStyle
import org.mifospay.feature.savedcards.utils.CreditCardUtils.maskCreditCardNumber
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun CardDetailScreen(
@ -101,7 +101,7 @@ internal fun CardDetailScreen(
is ViewState.Loading -> {
MfLoadingWheel(
contentDesc = stringResource(Res.string.feature_savedcards_loading),
backgroundColor = MaterialTheme.colorScheme.surface,
backgroundColor = KptTheme.colorScheme.surface,
)
}
@ -110,7 +110,7 @@ internal fun CardDetailScreen(
title = stringResource(Res.string.feature_savedcards_error_oops),
subTitle = stringResource(Res.string.feature_savedcards_subtitle),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -134,8 +134,8 @@ private fun CardDetailScreenContent(
LazyColumn(
modifier = modifier.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
item {
var isCardNumberVisible by remember { mutableStateOf(false) }
@ -172,7 +172,7 @@ private fun CardDetailScreenContent(
item {
CardDetail(
savedCard = state.savedCard,
containerColor = MaterialTheme.colorScheme.surface,
containerColor = KptTheme.colorScheme.surface,
)
}
}
@ -182,7 +182,7 @@ private fun CardDetailScreenContent(
private fun CardDetail(
savedCard: SavedCard,
modifier: Modifier = Modifier,
containerColor: Color = MaterialTheme.colorScheme.surface,
containerColor: Color = KptTheme.colorScheme.surface,
) {
ElevatedCard(
modifier = modifier.fillMaxWidth(),
@ -193,24 +193,24 @@ private fun CardDetail(
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
verticalArrangement = Arrangement.spacedBy(8.dp),
.padding(KptTheme.spacing.sm),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
CreditCardLabelAndText(
label = "Card Holder",
text = savedCard.fullName,
)
MifosDivider(color = MaterialTheme.colorScheme.outlineVariant)
MifosDivider(color = KptTheme.colorScheme.outlineVariant)
CreditCardLabelAndText(
label = "Card Number",
text = savedCard.cardNumber.maskCreditCardNumber(),
)
MifosDivider(color = MaterialTheme.colorScheme.outlineVariant)
MifosDivider(color = KptTheme.colorScheme.outlineVariant)
CreditCardLabelAndText(
label = "Expiry Date",
text = savedCard.formattedExpiryDate,
)
MifosDivider(color = MaterialTheme.colorScheme.outlineVariant)
MifosDivider(color = KptTheme.colorScheme.outlineVariant)
CreditCardLabelAndText(
label = "CVV",
text = savedCard.maskedCvv,
@ -223,8 +223,8 @@ private fun CardDetail(
private fun CreditCardLabelAndText(
label: String,
text: String,
labelColor: Color = MaterialTheme.colorScheme.primary,
textColor: Color = MaterialTheme.colorScheme.onSurface,
labelColor: Color = KptTheme.colorScheme.primary,
textColor: Color = KptTheme.colorScheme.onSurface,
) {
Column(
modifier = Modifier
@ -233,7 +233,7 @@ private fun CreditCardLabelAndText(
) {
Text(
text = label.uppercase(),
style = MaterialTheme.typography.labelSmall,
style = KptTheme.typography.labelSmall,
color = labelColor,
)
Spacer(modifier = Modifier.height(4.dp))

View File

@ -30,7 +30,6 @@ import androidx.compose.foundation.lazy.LazyListScope
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Close
@ -40,7 +39,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
@ -82,11 +80,13 @@ import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.designsystem.component.MifosTextField
import org.mifospay.core.designsystem.component.MifosTopBar
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.designsystem.theme.toRoundedCornerShape
import org.mifospay.core.model.search.AccountResult
import org.mifospay.core.ui.AvatarBox
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.MifosDivider
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
fun SendMoneyScreen(
@ -185,13 +185,13 @@ private fun SendMoneyScreen(
.fillMaxWidth()
.padding(paddingValues),
state = lazyListState,
contentPadding = PaddingValues(bottom = 12.dp),
contentPadding = PaddingValues(bottom = KptTheme.spacing.md),
) {
stickyHeader {
SendMoneyCard(
state = state,
onAction = onAction,
modifier = Modifier.padding(bottom = 8.dp),
modifier = Modifier.padding(bottom = KptTheme.spacing.sm),
)
}
@ -215,15 +215,18 @@ private fun SendMoneyBottomBar(
) {
Surface(
modifier = modifier.fillMaxWidth(),
shape = RoundedCornerShape(topStart = 8.dp, topEnd = 8.dp),
color = MaterialTheme.colorScheme.surface,
shape = KptTheme.shapes.toRoundedCornerShape(
topStart = KptTheme.spacing.sm,
topEnd = KptTheme.spacing.sm,
),
color = KptTheme.colorScheme.surface,
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(KptTheme.spacing.md),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(12.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
AnimatedVisibility(
visible = showDetails && selectedAccount != null,
@ -268,11 +271,11 @@ private fun SelectedAccountCard(
Column(
modifier = modifier.fillMaxWidth(),
horizontalAlignment = Alignment.Start,
verticalArrangement = Arrangement.spacedBy(8.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
Text(
text = stringResource(Res.string.feature_send_money_to_account),
style = MaterialTheme.typography.labelLarge,
style = KptTheme.typography.labelLarge,
)
OutlinedCard(
@ -280,7 +283,7 @@ private fun SelectedAccountCard(
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
),
border = BorderStroke(1.dp, MaterialTheme.colorScheme.primary),
border = BorderStroke(1.dp, KptTheme.colorScheme.primary),
) {
ListItem(
headlineContent = {
@ -298,7 +301,7 @@ private fun SelectedAccountCard(
},
trailingContent = {
Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
verticalAlignment = Alignment.CenterVertically,
) {
AccountBadge(
@ -307,7 +310,7 @@ private fun SelectedAccountCard(
AccountBadge(
text = account.entityType,
borderColor = MaterialTheme.colorScheme.secondary,
borderColor = KptTheme.colorScheme.secondary,
)
IconButton(
@ -332,7 +335,7 @@ private fun SelectedAccountCard(
private fun AccountBadge(
text: String,
modifier: Modifier = Modifier,
borderColor: Color = MaterialTheme.colorScheme.primary,
borderColor: Color = KptTheme.colorScheme.primary,
) {
OutlinedCard(
modifier = modifier,
@ -340,12 +343,12 @@ private fun AccountBadge(
containerColor = Color.Transparent,
),
border = BorderStroke(1.dp, borderColor),
shape = RoundedCornerShape(2.dp),
shape = KptTheme.shapes.extraSmall,
) {
Text(
text = text,
style = MaterialTheme.typography.labelSmall,
modifier = Modifier.padding(4.dp),
style = KptTheme.typography.labelSmall,
modifier = Modifier.padding(KptTheme.spacing.xs),
)
}
}
@ -360,14 +363,17 @@ private fun SendMoneyCard(
modifier = modifier
.fillMaxWidth(),
colors = CardDefaults.cardColors(
containerColor = MaterialTheme.colorScheme.surface,
containerColor = KptTheme.colorScheme.surface,
),
shape = KptTheme.shapes.toRoundedCornerShape(
bottomStart = KptTheme.spacing.md,
bottomEnd = KptTheme.spacing.md,
),
shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp),
) {
Column(
modifier = modifier.fillMaxWidth().padding(16.dp),
modifier = modifier.fillMaxWidth().padding(KptTheme.spacing.md),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
MifosTextField(
label = stringResource(Res.string.feature_send_money_amount),
@ -379,9 +385,6 @@ private fun SendMoneyCard(
onValueChange = remember(onAction) {
{ onAction(SendMoneyAction.AmountChanged(it)) }
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
MifosTextField(
@ -390,9 +393,6 @@ private fun SendMoneyCard(
onValueChange = remember(onAction) {
{ onAction(SendMoneyAction.AccountNumberChanged(it)) }
},
// textStyle = TextStyle(
// color = MaterialTheme.colorScheme.onSurface,
// ),
)
}
}
@ -421,7 +421,7 @@ private fun LazyListScope.accountListContent(
title = stringResource(Res.string.feature_send_money_oops),
subTitle = stringResource(Res.string.feature_send_money_something_went_wrong),
modifier = Modifier.fillParentMaxSize(),
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
}
@ -476,7 +476,7 @@ private fun AccountCard(
leadingContent = {
AvatarBox(
icon = MifosIcons.Bank,
backgroundColor = MaterialTheme.colorScheme.tertiary,
backgroundColor = KptTheme.colorScheme.tertiary,
)
},
colors = ListItemDefaults.colors(

View File

@ -20,7 +20,6 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -28,7 +27,6 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.settings.generated.resources.Res
import mobile_wallet.feature.settings.generated.resources.feature_settings_change_passcode
@ -52,6 +50,7 @@ import org.mifospay.core.designsystem.component.MifosLoadingDialog
import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun SettingsScreenRoute(
@ -109,7 +108,7 @@ private fun SettingsScreenContent(
.fillMaxSize()
.padding(contentPadding)
.verticalScroll(rememberScrollState()),
verticalArrangement = Arrangement.spacedBy(8.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
SettingsCardItem(
title = stringResource(Res.string.feature_settings_notification_settings),
@ -154,7 +153,7 @@ private fun SettingsScreenContent(
SettingsCardItem(
title = stringResource(Res.string.feature_settings_disable_account),
icon = MifosIcons.OutlinedLock,
color = MaterialTheme.colorScheme.error,
color = KptTheme.colorScheme.error,
onClick = {
onAction(SettingsAction.DisableAccount)
},
@ -168,7 +167,7 @@ private fun SettingsCardItem(
title: String,
icon: ImageVector,
modifier: Modifier = Modifier,
color: Color = MaterialTheme.colorScheme.onSurface,
color: Color = KptTheme.colorScheme.onSurface,
onClick: () -> Unit,
) {
ListItem(

View File

@ -28,7 +28,6 @@ import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.FabPosition
@ -37,7 +36,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
@ -66,6 +64,7 @@ import org.mifospay.core.designsystem.component.MifosLoadingDialog
import org.mifospay.core.designsystem.component.MifosLoadingWheel
import org.mifospay.core.designsystem.component.MifosScaffold
import org.mifospay.core.designsystem.icon.MifosIcons
import org.mifospay.core.designsystem.theme.toRoundedCornerShape
import org.mifospay.core.model.standinginstruction.StandingInstruction
import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.RevealDirection
@ -74,6 +73,7 @@ import org.mifospay.core.ui.rememberRevealState
import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.standing.instruction.components.FrequencyChip
import org.mifospay.feature.standing.instruction.createOrUpdate.SIAddEditType
import template.core.base.designsystem.theme.KptTheme
@Composable
fun StandingInstructionsScreen(
@ -188,7 +188,7 @@ internal fun StandingInstructionScreen(
title = stringResource(Res.string.feature_standing_instruction_error_oops),
subTitle = stringResource(Res.string.feature_standing_instruction_error_fetching_si_list),
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -226,8 +226,8 @@ private fun StandingInstructionScreenContent(
LazyColumn(
modifier = modifier.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(16.dp),
verticalArrangement = Arrangement.spacedBy(16.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
) {
items(
items = state.list,
@ -264,16 +264,16 @@ private fun SIItem(
RevealSwipe(
modifier = modifier,
state = state,
shape = RoundedCornerShape(8.dp),
backgroundCardStartColor = MaterialTheme.colorScheme.tertiary,
backgroundCardEndColor = MaterialTheme.colorScheme.secondary,
shape = KptTheme.shapes.small,
backgroundCardStartColor = KptTheme.colorScheme.tertiary,
backgroundCardEndColor = KptTheme.colorScheme.secondary,
backgroundStartActionLabel = null,
backgroundEndActionLabel = "Edit",
card = { shape, content ->
Card(
modifier = Modifier.matchParentSize(),
colors = CardDefaults.cardColors(
contentColor = MaterialTheme.colorScheme.onSecondary,
contentColor = KptTheme.colorScheme.onSecondary,
containerColor = Color.Transparent,
),
shape = shape,
@ -285,7 +285,7 @@ private fun SIItem(
modifier = Modifier
.fillMaxWidth()
.align(Alignment.Center),
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm, Alignment.CenterHorizontally),
verticalAlignment = Alignment.CenterVertically,
) {
IconButton(
@ -310,30 +310,30 @@ private fun SIItem(
}
},
onContentClick = { item.id?.let { onClick(it) } },
) {
) { shape ->
val priorityColor = when (item.priority?.id) {
1L -> MaterialTheme.colorScheme.error.copy(
1L -> KptTheme.colorScheme.error.copy(
red = 1f,
green = 0.27f,
blue = 0.27f,
)
2L -> MaterialTheme.colorScheme.primaryContainer.copy(
2L -> KptTheme.colorScheme.primaryContainer.copy(
red = 1f,
green = 0.53f,
blue = 0f,
)
3L -> MaterialTheme.colorScheme.primaryContainer.copy(
3L -> KptTheme.colorScheme.primaryContainer.copy(
red = 1f,
green = 0.73f,
blue = 0.2f,
)
4L -> MaterialTheme.colorScheme.secondaryContainer.copy(
4L -> KptTheme.colorScheme.secondaryContainer.copy(
red = 0.6f,
green = 0.8f,
blue = 0f,
)
else -> MaterialTheme.colorScheme.outlineVariant.copy(
else -> KptTheme.colorScheme.outlineVariant.copy(
red = 0.5f,
green = 0.5f,
blue = 0.5f,
@ -344,7 +344,7 @@ private fun SIItem(
modifier = modifier
.fillMaxWidth()
.height(IntrinsicSize.Min)
.clip(it),
.clip(shape),
) {
Box(
modifier = Modifier
@ -352,17 +352,20 @@ private fun SIItem(
.fillMaxHeight()
.background(
color = priorityColor,
shape = RoundedCornerShape(topStart = 8.dp, bottomStart = 8.dp),
shape = KptTheme.shapes.toRoundedCornerShape(
topEnd = KptTheme.spacing.sm,
bottomEnd = KptTheme.spacing.sm,
),
)
.align(Alignment.CenterStart),
)
OutlinedCard(
modifier = modifier.fillMaxWidth(),
shape = it,
shape = shape,
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
contentColor = MaterialTheme.colorScheme.onSurface,
contentColor = KptTheme.colorScheme.onSurface,
),
) {
ListItem(
@ -382,7 +385,7 @@ private fun SIItem(
},
trailingContent = {
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
verticalAlignment = Alignment.CenterVertically,
) {
FrequencyChip(
@ -398,7 +401,7 @@ private fun SIItem(
Text(
text = amount,
style = MaterialTheme.typography.titleMedium,
style = KptTheme.typography.titleMedium,
fontWeight = FontWeight.SemiBold,
)
}

View File

@ -11,14 +11,13 @@ package org.mifospay.feature.standing.instruction.components
import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun FrequencyChip(
@ -31,22 +30,22 @@ internal fun FrequencyChip(
Surface(
modifier = modifier,
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
color = Color.Transparent,
border = BorderStroke(
width = 1.dp,
color = MaterialTheme.colorScheme.outline,
color = KptTheme.colorScheme.outline,
),
) {
Text(
text = displayText,
modifier = Modifier.padding(4.dp),
modifier = Modifier.padding(KptTheme.spacing.xs),
color = if (isInvalid) {
MaterialTheme.colorScheme.error
KptTheme.colorScheme.error
} else {
MaterialTheme.colorScheme.onBackground
KptTheme.colorScheme.onBackground
},
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
)
}
}

View File

@ -10,13 +10,11 @@
package org.mifospay.feature.standing.instruction.components
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import template.core.base.designsystem.theme.KptTheme
@Composable
fun InstructionTypeChip(
@ -27,31 +25,31 @@ fun InstructionTypeChip(
val (backgroundColor, contentColor) = when (typeEnum) {
StandingInstructionType.FIXED ->
MaterialTheme.colorScheme.primaryContainer to
MaterialTheme.colorScheme.onPrimaryContainer
KptTheme.colorScheme.primaryContainer to
KptTheme.colorScheme.onPrimaryContainer
StandingInstructionType.DUES ->
MaterialTheme.colorScheme.tertiaryContainer to
MaterialTheme.colorScheme.onTertiaryContainer
KptTheme.colorScheme.tertiaryContainer to
KptTheme.colorScheme.onTertiaryContainer
else -> MaterialTheme.colorScheme.surfaceVariant to MaterialTheme.colorScheme.onSurfaceVariant
else -> KptTheme.colorScheme.surfaceVariant to KptTheme.colorScheme.onSurfaceVariant
}
Surface(
modifier = modifier,
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
color = backgroundColor,
contentColor = contentColor,
) {
Text(
text = typeEnum?.name ?: "Not Available",
modifier = Modifier.padding(4.dp),
modifier = Modifier.padding(KptTheme.spacing.xs),
color = if (typeEnum == null) {
MaterialTheme.colorScheme.error
KptTheme.colorScheme.error
} else {
MaterialTheme.colorScheme.onBackground
KptTheme.colorScheme.onBackground
},
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
)
}
}

View File

@ -10,14 +10,12 @@
package org.mifospay.feature.standing.instruction.components
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import org.mifospay.core.model.standinginstruction.StandingInstruction
import template.core.base.designsystem.theme.KptTheme
@Composable
fun PriorityChip(
@ -25,23 +23,23 @@ fun PriorityChip(
modifier: Modifier = Modifier,
) {
val (backgroundColor, contentColor) = when (priority?.id) {
1L -> MaterialTheme.colorScheme.error to MaterialTheme.colorScheme.surfaceContainerLowest
2L -> MaterialTheme.colorScheme.errorContainer to MaterialTheme.colorScheme.surfaceContainerLowest
3L -> MaterialTheme.colorScheme.secondary to MaterialTheme.colorScheme.surfaceContainerLowest
4L -> MaterialTheme.colorScheme.tertiary to MaterialTheme.colorScheme.surfaceContainerLowest
else -> MaterialTheme.colorScheme.outline to MaterialTheme.colorScheme.surfaceContainerLowest
1L -> KptTheme.colorScheme.error to KptTheme.colorScheme.surfaceContainerLowest
2L -> KptTheme.colorScheme.errorContainer to KptTheme.colorScheme.surfaceContainerLowest
3L -> KptTheme.colorScheme.secondary to KptTheme.colorScheme.surfaceContainerLowest
4L -> KptTheme.colorScheme.tertiary to KptTheme.colorScheme.surfaceContainerLowest
else -> KptTheme.colorScheme.outline to KptTheme.colorScheme.surfaceContainerLowest
}
Surface(
modifier = modifier,
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
color = backgroundColor,
contentColor = contentColor,
) {
Text(
text = priority?.value ?: "",
modifier = Modifier.padding(4.dp),
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(KptTheme.spacing.xs),
style = KptTheme.typography.bodySmall,
maxLines = 1,
)
}

View File

@ -22,7 +22,6 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.DatePicker
@ -33,7 +32,6 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.ListItem
import androidx.compose.material3.ListItemDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedCard
import androidx.compose.material3.SelectableDates
import androidx.compose.material3.SnackbarHost
@ -52,7 +50,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import kotlinx.coroutines.launch
import mobile_wallet.feature.standing_instruction.generated.resources.Res
@ -78,6 +75,7 @@ import org.mifospay.core.ui.EmptyContentScreen
import org.mifospay.core.ui.ExposedDropdownBox
import org.mifospay.core.ui.MifosDivider
import org.mifospay.core.ui.utils.EventsEffect
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun AddEditSIScreen(
@ -179,7 +177,7 @@ internal fun AddEditSIScreen(
title = stringResource(Res.string.feature_standing_instruction_error_oops),
subTitle = state.viewState.message,
modifier = Modifier,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -211,8 +209,8 @@ private fun AddEditSIScreenContent(
) {
LazyColumn(
modifier = modifier.fillMaxSize(),
contentPadding = PaddingValues(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
state = lazyListState,
) {
if (isAddMode) {
@ -221,7 +219,7 @@ private fun AddEditSIScreenContent(
colors = CardDefaults.outlinedCardColors(
containerColor = Color.Transparent,
),
shape = RoundedCornerShape(4.dp),
shape = KptTheme.shapes.extraSmall,
) {
ListItem(
headlineContent = {
@ -874,7 +872,7 @@ inline fun RowBlock(
Row(
modifier = Modifier
.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(12.dp),
horizontalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
verticalAlignment = Alignment.CenterVertically,
) {
content()

View File

@ -23,7 +23,6 @@ import androidx.compose.foundation.lazy.LazyListState
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
@ -32,7 +31,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import mobile_wallet.feature.standing_instruction.generated.resources.Res
import mobile_wallet.feature.standing_instruction.generated.resources.feature_standing_instruction_error_oops
@ -49,6 +47,7 @@ import org.mifospay.core.ui.utils.EventsEffect
import org.mifospay.feature.standing.instruction.components.FrequencyChip
import org.mifospay.feature.standing.instruction.components.InstructionTypeChip
import org.mifospay.feature.standing.instruction.components.PriorityChip
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun SIDetailsScreen(
@ -101,7 +100,7 @@ internal fun SIDetailsScreen(
EmptyContentScreen(
title = stringResource(Res.string.feature_standing_instruction_error_oops),
subTitle = state.viewState.message,
iconTint = MaterialTheme.colorScheme.error,
iconTint = KptTheme.colorScheme.error,
)
}
@ -125,8 +124,8 @@ private fun SIDetailsContent(
LazyColumn(
modifier = modifier.fillMaxSize(),
state = lazyListState,
contentPadding = PaddingValues(12.dp),
verticalArrangement = Arrangement.spacedBy(12.dp),
contentPadding = PaddingValues(KptTheme.spacing.md),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.md),
horizontalAlignment = Alignment.Start,
) {
item {
@ -145,19 +144,19 @@ private fun SIDetailsCard(
) {
Column(
modifier = modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(8.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.sm),
) {
ElevatedCard(
modifier = Modifier
.fillMaxWidth(),
colors = CardDefaults.elevatedCardColors(
containerColor = MaterialTheme.colorScheme.surface,
containerColor = KptTheme.colorScheme.surface,
),
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
.padding(KptTheme.spacing.sm),
) {
RowBlock {
Text(
@ -295,14 +294,14 @@ private fun SIDetailsCard(
modifier = Modifier
.fillMaxWidth(),
colors = CardDefaults.elevatedCardColors(
containerColor = MaterialTheme.colorScheme.surface,
contentColor = MaterialTheme.colorScheme.onSurface,
containerColor = KptTheme.colorScheme.surface,
contentColor = KptTheme.colorScheme.onSurface,
),
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
.padding(KptTheme.spacing.sm),
) {
RowBlock {
Text(
@ -354,14 +353,14 @@ private fun SIDetailsCard(
modifier = Modifier
.fillMaxWidth(),
colors = CardDefaults.elevatedCardColors(
containerColor = MaterialTheme.colorScheme.surface,
contentColor = MaterialTheme.colorScheme.onSurface,
containerColor = KptTheme.colorScheme.surface,
contentColor = KptTheme.colorScheme.onSurface,
),
) {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(8.dp),
.padding(KptTheme.spacing.sm),
) {
RowBlock {
Text(
@ -418,12 +417,12 @@ private inline fun RowBlock(
) {
Column(
modifier = Modifier.fillMaxWidth(),
verticalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(KptTheme.spacing.xs),
) {
Row(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 8.dp),
.padding(horizontal = KptTheme.spacing.sm),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically,
) {
@ -439,8 +438,8 @@ private inline fun RowBlock(
@Composable
fun colorForMissing(value: String?): Color {
return if (value == null) {
MaterialTheme.colorScheme.error
KptTheme.colorScheme.error
} else {
MaterialTheme.colorScheme.onBackground
KptTheme.colorScheme.onBackground
}
}

View File

@ -21,7 +21,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.koin.compose.viewmodel.koinViewModel
@ -30,6 +29,7 @@ import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.ui.VerifyStepHeader
import org.mifospay.feature.upi.setup.viewmodel.DebitCardUiState
import org.mifospay.feature.upi.setup.viewmodel.DebitCardViewModel
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun DebitCardScreen(
@ -67,17 +67,17 @@ internal fun DebitCardScreenWithHeaderAndContent(
Card(
modifier = modifier
.fillMaxWidth()
.padding(20.dp),
.padding(KptTheme.spacing.lg),
elevation = CardDefaults.cardElevation(
defaultElevation = 1.dp,
defaultElevation = KptTheme.elevation.level1,
),
) {
Column(
modifier = Modifier.padding(
top = 15.dp,
bottom = 15.dp,
start = 10.dp,
end = 10.dp,
top = KptTheme.spacing.md,
bottom = KptTheme.spacing.md,
start = KptTheme.spacing.sm,
end = KptTheme.spacing.sm,
),
) {
VerifyStepHeader("Debit Card Details ", verificationStatus)
@ -85,7 +85,7 @@ internal fun DebitCardScreenWithHeaderAndContent(
Column(
modifier = Modifier
.fillMaxWidth()
.padding(start = 12.dp),
.padding(start = KptTheme.spacing.md),
) {
// handle debit card ui state
Box(

View File

@ -15,7 +15,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.OutlinedTextFieldDefaults
import androidx.compose.material3.Text
@ -37,6 +36,7 @@ import androidx.compose.ui.unit.dp
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.ui.ExpiryDateInput
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun DebitCardScreenContent(
@ -55,7 +55,7 @@ internal fun DebitCardScreenContent(
label = {
Text(
text = "Debit Card Number",
style = TextStyle(color = MaterialTheme.colorScheme.onSurface),
style = TextStyle(color = KptTheme.colorScheme.onSurface),
)
},
value = cardNumber,
@ -73,9 +73,9 @@ internal fun DebitCardScreenContent(
),
visualTransformation = ::formatCardNumber,
colors = OutlinedTextFieldDefaults.colors(
focusedBorderColor = MaterialTheme.colorScheme.outline,
unfocusedBorderColor = MaterialTheme.colorScheme.outlineVariant,
cursorColor = MaterialTheme.colorScheme.onSurface,
focusedBorderColor = KptTheme.colorScheme.outline,
unfocusedBorderColor = KptTheme.colorScheme.outlineVariant,
cursorColor = KptTheme.colorScheme.onSurface,
),
)

View File

@ -15,12 +15,10 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import mobile_wallet.feature.upi_setup.generated.resources.Res
import mobile_wallet.feature.upi_setup.generated.resources.feature_upi_setup_enter_otp
@ -29,6 +27,7 @@ import org.jetbrains.compose.ui.tooling.preview.Preview
import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.ui.OtpTextField
import org.mifospay.core.ui.VerifyStepHeader
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun OtpScreen(
@ -42,13 +41,13 @@ internal fun OtpScreen(
modifier = modifier
.fillMaxWidth()
.padding(
top = 15.dp,
bottom = 15.dp,
start = 10.dp,
end = 10.dp,
top = KptTheme.spacing.md,
bottom = KptTheme.spacing.md,
start = KptTheme.spacing.sm,
end = KptTheme.spacing.sm,
),
elevation = CardDefaults.cardElevation(
defaultElevation = 1.dp,
defaultElevation = KptTheme.elevation.level1,
),
) {
Column(
@ -73,15 +72,15 @@ private fun OtpScreenContent(
Column(modifier) {
Text(
text = stringResource(Res.string.feature_upi_setup_enter_otp),
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
fontSize = 18.sp,
style = MaterialTheme.typography.headlineMedium,
style = KptTheme.typography.headlineMedium,
)
OtpTextField(
onOtpTextCorrectlyEntered = {
onOtpTextCorrectlyEntered()
},
modifier = Modifier.padding(top = 20.dp),
modifier = Modifier.padding(top = KptTheme.spacing.lg),
realOtp = realOtp,
)
}

View File

@ -22,7 +22,6 @@ import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.Card
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
@ -49,6 +48,7 @@ import org.jetbrains.compose.resources.stringResource
import org.jetbrains.compose.ui.tooling.preview.Preview
import org.mifospay.core.designsystem.theme.MifosTheme
import org.mifospay.core.ui.VerifyStepHeader
import template.core.base.designsystem.theme.KptTheme
@Composable
internal fun UpiPinScreen(
@ -61,13 +61,13 @@ internal fun UpiPinScreen(
modifier = modifier
.fillMaxWidth()
.padding(
top = 15.dp,
bottom = 15.dp,
start = 10.dp,
end = 10.dp,
top = KptTheme.spacing.md,
bottom = KptTheme.spacing.md,
start = KptTheme.spacing.sm,
end = KptTheme.spacing.sm,
),
elevation = CardDefaults.cardElevation(
defaultElevation = 1.dp,
defaultElevation = KptTheme.elevation.level1,
),
) {
Column(
@ -102,9 +102,9 @@ private fun UpiPinScreenContent(
} else {
stringResource(Res.string.feature_upi_setup_reenter_upi)
},
color = MaterialTheme.colorScheme.onSurface,
color = KptTheme.colorScheme.onSurface,
fontSize = 18.sp,
style = MaterialTheme.typography.headlineMedium,
style = KptTheme.typography.headlineMedium,
)
if (steps1.intValue == 0) {
@ -143,7 +143,7 @@ private fun UpiPinScreenContent(
},
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(KptTheme.spacing.md),
)
} else {
BasicTextField(
@ -187,7 +187,7 @@ private fun UpiPinScreenContent(
},
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(KptTheme.spacing.md),
)
}
}
@ -215,11 +215,11 @@ private fun UpiPinCharView(
.width(40.dp)
.wrapContentHeight(align = Alignment.CenterVertically),
text = char,
style = MaterialTheme.typography.headlineSmall,
style = KptTheme.typography.headlineSmall,
color = if (isFocused) {
MaterialTheme.colorScheme.outline
KptTheme.colorScheme.outline
} else {
MaterialTheme.colorScheme.outlineVariant
KptTheme.colorScheme.outlineVariant
},
textAlign = TextAlign.Center,
)