Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/designsystem/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ kotlin {
api(libs.window.size)
api(projects.coreBase.designsystem)
implementation(libs.fluentui.system.icons)
api(projects.coreBase.designsystem)
}

nativeMain.dependencies {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,24 @@ data class AppSpacing(
val extraExtraLarge: Dp = 48.dp,
val half: Dp = 500.dp,
val full: Dp = 1000.dp,
// custom spacings
val negativeDp7: Dp = (-7).dp,
val dp1: Dp = 1.dp,
val dp2: Dp = 2.dp,
val dp5: Dp = 5.dp,
val dp6: Dp = 6.dp,
val dp10: Dp = 10.dp,
val dp18: Dp = 18.dp,
val dp24: Dp = 24.dp,
val dp30: Dp = 30.dp,
val dp40: Dp = 40.dp,
val dp44: Dp = 44.dp,
val dp46: Dp = 46.dp,
val dp50: Dp = 50.dp,
val dp52: Dp = 52.dp,
val dp80: Dp = 80.dp,
val dp160: Dp = 160.dp,
val dp164: Dp = 164.dp,
val dp300: Dp = 300.dp,
val negativeDp7: Dp = (-7).dp,
)

/**
Expand Down Expand Up @@ -157,14 +166,17 @@ data class AppPadding(
val extraLargeIncreased: Dp = 32.dp,
val extraExtraLarge: Dp = 48.dp,
val full: Dp = 1000.dp,
// custom paddings
val dp1: Dp = 1.dp,
val dp2: Dp = 2.dp,
val dp5: Dp = 5.dp,
val dp6: Dp = 6.dp,
val dp10: Dp = 10.dp,
val dp14: Dp = 14.dp,
val dp15: Dp = 15.dp,
val dp18: Dp = 18.dp,
val dp24: Dp = 24.dp,
val dp30: Dp = 30.dp,
val dp40: Dp = 40.dp,
val dp56: Dp = 56.dp,
val dp75: Dp = 75.dp,
val dp100: Dp = 100.dp,
Expand Down Expand Up @@ -225,11 +237,12 @@ data class AppShapes(
val topBar: Shape = RoundedCornerShape(bottomStart = 16.dp, bottomEnd = 16.dp),
val topMedium: Shape = RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp),
val bottomMedium: Shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp),
// custom shapes
val topCornerDp8: Shape = RoundedCornerShape(topStart = 8.dp, topEnd = 8.dp),
val topCornerDp16: Shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
val bottomCornerDp12: Shape = RoundedCornerShape(bottomStart = 12.dp, bottomEnd = 12.dp),
val dp2: Shape = RoundedCornerShape(2.dp),
val dp10: Shape = RoundedCornerShape(10.dp),
val dp22: Shape = RoundedCornerShape(22.dp),
val dp25: Shape = RoundedCornerShape(25.dp),
val dp100: Shape = RoundedCornerShape(100.dp),
)
Expand Down Expand Up @@ -270,12 +283,12 @@ data class AppShapes(
@Immutable
data class AppElevation(
val none: Dp = 0.dp,
val dp1: Dp = 1.dp,
val appBar: Dp = 5.dp,
val elevation: Dp = 25.dp,
// custom elevation
val dp1: Dp = 1.dp,
val dp6: Dp = 6.dp,
val dp2: Dp = 2.dp,
val dp4: Dp = 4.dp,
val dp6: Dp = 6.dp,
)

/**
Expand Down Expand Up @@ -347,10 +360,6 @@ data class AppSizes(
val logoSizeTopAppBar: Dp = 28.dp,
val topAppBarHeight: Dp = 85.dp,
val bottomAppBarHeight: Dp = 70.dp,
val tableCellWidthSmall: Dp = 65.dp,
val tableCellWidthMedium: Dp = 100.dp,
val tableCellWidthLarge: Dp = 150.dp,
// custom sizes
val iconDp39: Dp = 39.dp,
val iconDp100: Dp = 100.dp,
val checkboxDp18: Dp = 18.dp,
Expand Down Expand Up @@ -392,6 +401,20 @@ data class AppSizes(
val backgroundDp100: Dp = 100.dp,
val buttonHeightDp48: Dp = 48.dp,
val stepIndicatorDp40: Dp = 40.dp,
val dp5: Dp = 5.dp,
val dp18: Dp = 18.dp,
val dp20: Dp = 20.dp,
val dp30: Dp = 30.dp,
val dp42: Dp = 42.dp,
val dp48: Dp = 48.dp,
val dp72: Dp = 72.dp,
val dp80: Dp = 80.dp,
val dp100: Dp = 100.dp,
val dp120: Dp = 120.dp,
val dp128: Dp = 128.dp,
val tableCellWidthSmall: Dp = 65.dp,
val tableCellWidthMedium: Dp = 100.dp,
val tableCellWidthLarge: Dp = 150.dp,
)

@Immutable
Expand All @@ -402,9 +425,6 @@ data class AppStrokes(
val dp2: Dp = 2.dp,
val dp4: Dp = 4.dp,
val dp5: Dp = 5.dp,
val tableCellWidthSmall: Dp = 65.dp,
val tableCellWidthMedium: Dp = 100.dp,
val tableCellWidthLarge: Dp = 150.dp,
)

/**
Expand Down Expand Up @@ -498,6 +518,7 @@ internal fun DesignTokenTheme(
shapes: AppShapes = AppShapes(),
elevation: AppElevation = AppElevation(),
sizes: AppSizes = AppSizes(),
strokes: AppStrokes = AppStrokes(),
content: @Composable () -> Unit,
) {
CompositionLocalProvider(
Expand All @@ -506,6 +527,7 @@ internal fun DesignTokenTheme(
LocalShapes provides shapes,
LocalElevation provides elevation,
LocalSizes provides sizes,
LocalStrokes provides strokes,
content = content,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,23 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.material3.CardDefaults
import androidx.compose.material3.ElevatedCard
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import com.mifos.core.designsystem.component.MifosScaffold
import com.mifos.core.designsystem.theme.DesignToken
import com.mifos.core.designsystem.theme.MifosTheme
import com.mifos.core.designsystem.theme.aboutItemTextStyle
import com.mifos.core.designsystem.theme.aboutItemTextStyleBold
import com.mifos.core.ui.util.DevicePreview
import com.mifos.core.ui.util.ShareUtils
import org.jetbrains.compose.resources.painterResource
import org.jetbrains.compose.resources.stringResource
import template.core.base.designsystem.theme.KptTheme

@Composable
internal fun AboutScreen(
Expand All @@ -63,7 +63,7 @@ internal fun AboutScreen(
item {
Box(modifier = Modifier.fillMaxWidth()) {
Image(
modifier = Modifier.size(100.dp).align(Alignment.Center),
modifier = Modifier.size(DesignToken.sizes.dp100).align(Alignment.Center),
painter = painterResource(Res.drawable.feature_about_ic_launcher),
contentDescription = "App icon",
)
Expand All @@ -72,26 +72,26 @@ internal fun AboutScreen(
Text(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp),
.padding(KptTheme.spacing.md),
text = stringResource(Res.string.feature_about_mifos_x_droid),
style = aboutItemTextStyleBold,
)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp),
.padding(horizontal = KptTheme.spacing.md),
text = stringResource(Res.string.feature_about_app),
style = aboutItemTextStyle,
)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(16.dp)
.padding(KptTheme.spacing.md)
.clickable {
ShareUtils.openUrl("https://github.com/openMF/android-client/graphs/contributors")
},
text = stringResource(Res.string.feature_about_mifos),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
textAlign = TextAlign.Center,
)
}
Expand All @@ -117,12 +117,12 @@ private fun AboutCardItem(
onOptionClick: (AboutItems) -> Unit,
) {
ElevatedCard(
modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp),
elevation = CardDefaults.elevatedCardElevation(0.dp),
modifier = Modifier.padding(horizontal = KptTheme.spacing.md, vertical = KptTheme.spacing.sm),
elevation = CardDefaults.elevatedCardElevation(KptTheme.elevation.level0),
onClick = { onOptionClick(about.id) },
) {
Row(
modifier = Modifier.padding(16.dp),
modifier = Modifier.padding(KptTheme.spacing.md),
verticalAlignment = Alignment.CenterVertically,
) {
about.icon?.let {
Expand All @@ -135,17 +135,17 @@ private fun AboutCardItem(
Text(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
.padding(horizontal = KptTheme.spacing.md),
text = stringResource(about.title),
style = MaterialTheme.typography.titleMedium,
style = KptTheme.typography.titleMedium,
)
about.subtitle?.let {
Text(
modifier = Modifier
.fillMaxWidth()
.padding(horizontal = 16.dp),
.padding(horizontal = KptTheme.spacing.md),
text = stringResource(it),
style = MaterialTheme.typography.bodyMedium,
style = KptTheme.typography.bodyMedium,
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import androidx.compose.foundation.verticalScroll
import androidx.compose.material3.DatePicker
import androidx.compose.material3.DatePickerDialog
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SelectableDates
import androidx.compose.material3.Text
import androidx.compose.material3.TextButton
Expand All @@ -42,7 +41,6 @@ import androidx.compose.runtime.mutableStateOf
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 com.mifos.core.common.utils.ApiDateFormatter
import com.mifos.core.common.utils.Constants
Expand All @@ -52,6 +50,7 @@ import com.mifos.core.designsystem.component.MifosButton
import com.mifos.core.designsystem.component.MifosDatePickerTextField
import com.mifos.core.designsystem.component.MifosScaffold
import com.mifos.core.designsystem.component.MifosSweetError
import com.mifos.core.designsystem.theme.DesignToken
import com.mifos.core.model.objects.clients.ActivatePayload
import com.mifos.core.ui.components.MifosAlertDialog
import com.mifos.core.ui.components.MifosProgressIndicator
Expand All @@ -60,6 +59,7 @@ import org.jetbrains.compose.ui.tooling.preview.Preview
import org.jetbrains.compose.ui.tooling.preview.PreviewParameter
import org.jetbrains.compose.ui.tooling.preview.PreviewParameterProvider
import org.koin.compose.viewmodel.koinViewModel
import template.core.base.designsystem.theme.KptTheme
import kotlin.time.Clock
import kotlin.time.ExperimentalTime

Expand Down Expand Up @@ -189,7 +189,7 @@ private fun ActivateContent(
},
)

Spacer(modifier = Modifier.height(16.dp))
Spacer(modifier = Modifier.height(KptTheme.spacing.md))

MifosButton(
onClick = {
Expand All @@ -203,13 +203,13 @@ private fun ActivateContent(
},
modifier = Modifier
.fillMaxWidth()
.heightIn(44.dp)
.padding(start = 16.dp, end = 16.dp),
.heightIn(DesignToken.spacing.dp44)
.padding(horizontal = KptTheme.spacing.md),
contentPadding = PaddingValues(),
) {
Text(
text = stringResource(Res.string.feature_activate),
style = MaterialTheme.typography.bodySmall,
style = KptTheme.typography.bodySmall,
)
}
}
Expand Down
Loading