Skip to content

Fix dark mode image visibility issue #2328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,34 @@ import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.sp

val aboutItemTextStyle = TextStyle(
val aboutItemTextStyleLight = TextStyle(
color = Color.Black,
textAlign = TextAlign.Center,
fontSize = 16.sp,
fontWeight = FontWeight.Normal,
)

val aboutItemTextStyleBold = TextStyle(
val aboutItemTextStyleDark = TextStyle(
color = Color.White,
textAlign = TextAlign.Center,
fontSize = 16.sp,
fontWeight = FontWeight.Normal,
)

val aboutItemTextStyleBoldLight = TextStyle(
color = Color.Black,
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.SemiBold,
)

val aboutItemTextStyleBoldDark = TextStyle(
color = Color.White,
textAlign = TextAlign.Center,
fontSize = 24.sp,
fontWeight = FontWeight.SemiBold,
)

val identifierTextStyleDark = TextStyle(
color = Color.Black,
textAlign = TextAlign.Start,
Expand Down
18 changes: 13 additions & 5 deletions feature/about/src/main/java/com/mifos/feature/about/AboutScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ package com.mifos.feature.about

import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
Expand Down Expand Up @@ -48,8 +50,10 @@ import com.mifos.core.designsystem.icon.MifosIcons
import com.mifos.core.designsystem.theme.Black
import com.mifos.core.designsystem.theme.BluePrimary
import com.mifos.core.designsystem.theme.White
import com.mifos.core.designsystem.theme.aboutItemTextStyle
import com.mifos.core.designsystem.theme.aboutItemTextStyleBold
import com.mifos.core.designsystem.theme.aboutItemTextStyleBoldDark
import com.mifos.core.designsystem.theme.aboutItemTextStyleLight
import com.mifos.core.designsystem.theme.aboutItemTextStyleBoldLight
import com.mifos.core.designsystem.theme.aboutItemTextStyleDark

@Composable
internal fun AboutScreen(
Expand Down Expand Up @@ -127,7 +131,11 @@ private fun AboutScreenContent(
aboutOptions: List<AboutItem>,
onOptionClick: (AboutItems) -> Unit,
) {
Column {
Column(
modifier = Modifier.fillMaxWidth(),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.spacedBy(16.dp),
) {
Image(
modifier = Modifier.size(100.dp),
painter = painterResource(id = R.drawable.feature_about_ic_launcher),
Expand All @@ -138,14 +146,14 @@ private fun AboutScreenContent(
.fillMaxWidth()
.padding(16.dp),
text = stringResource(id = R.string.feature_about_mifos_x_droid),
style = aboutItemTextStyleBold,
style = if (isSystemInDarkTheme()) aboutItemTextStyleBoldDark else aboutItemTextStyleBoldLight,
)
Text(
modifier = Modifier
.fillMaxWidth()
.padding(start = 16.dp, end = 16.dp),
text = stringResource(id = R.string.feature_about_app),
style = aboutItemTextStyle,
style = if (isSystemInDarkTheme()) aboutItemTextStyleDark else aboutItemTextStyleLight,
)
Text(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import androidx.compose.material3.DropdownMenu
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
Expand Down Expand Up @@ -438,7 +439,7 @@ private fun MifosClientDetailsScreen(
fontWeight = FontWeight.Medium,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
}
Expand Down Expand Up @@ -755,6 +756,7 @@ private fun MifosSavingsAccountExpendableCard(
modifier = Modifier.rotate(rotateState),
imageVector = Icons.Default.KeyboardArrowDown,
contentDescription = null,
tint = MaterialTheme.colorScheme.onSurface
)
}
}
Expand Down Expand Up @@ -976,7 +978,7 @@ private fun MifosClientDetailsText(icon: ImageVector, field: String, value: Stri
modifier = Modifier.size(18.dp),
imageVector = icon,
contentDescription = null,
tint = DarkGray,
tint = MaterialTheme.colorScheme.secondary,
)
Text(
modifier = Modifier
Expand All @@ -988,7 +990,7 @@ private fun MifosClientDetailsText(icon: ImageVector, field: String, value: Stri
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
Text(
Expand All @@ -999,7 +1001,7 @@ private fun MifosClientDetailsText(icon: ImageVector, field: String, value: Stri
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = DarkGray,
color = MaterialTheme.colorScheme.primary,
textAlign = TextAlign.Start,
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ import com.mifos.core.designsystem.component.MifosMenuDropDownItem
import com.mifos.core.designsystem.component.MifosScaffold
import com.mifos.core.designsystem.component.MifosSweetError
import com.mifos.core.designsystem.icon.MifosIcons
import com.mifos.core.designsystem.theme.Black
import com.mifos.core.designsystem.theme.BluePrimary
import com.mifos.core.designsystem.theme.BluePrimaryDark
import com.mifos.core.designsystem.theme.BlueSecondary
Expand All @@ -87,6 +86,7 @@ import com.mifos.core.objects.accounts.savings.SavingsAccount
import com.mifos.core.objects.client.Client
import com.mifos.core.objects.group.Group
import com.mifos.feature.groups.R
import androidx.compose.material3.MaterialTheme

@Composable
internal fun GroupDetailsScreen(
Expand Down Expand Up @@ -287,7 +287,7 @@ fun GroupDetailsContent(
fontSize = 24.sp,
fontWeight = FontWeight.SemiBold,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Center,
)
}
Expand Down Expand Up @@ -327,7 +327,7 @@ fun GroupDetailsContent(
fontWeight = FontWeight.Medium,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
HorizontalDivider(modifier = Modifier.padding(start = 16.dp, end = 16.dp))
Expand Down Expand Up @@ -366,7 +366,7 @@ fun MifosCenterDetailsText(
modifier = Modifier.size(18.dp),
imageVector = icon,
contentDescription = null,
tint = DarkGray,
tint = MaterialTheme.colorScheme.secondary,
)
Text(
modifier = Modifier
Expand All @@ -378,7 +378,7 @@ fun MifosCenterDetailsText(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
Text(
Expand All @@ -389,7 +389,7 @@ fun MifosCenterDetailsText(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = DarkGray,
color = MaterialTheme.colorScheme.secondary,
textAlign = TextAlign.Start,
)
}
Expand Down Expand Up @@ -439,7 +439,7 @@ fun MifosLoanAccountExpendableCard(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
IconButton(
Expand Down Expand Up @@ -542,7 +542,7 @@ fun MifosLoanAccountsLazyColumn(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
}
Expand All @@ -565,7 +565,7 @@ fun MifosLoanAccountsLazyColumn(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
}
Expand Down Expand Up @@ -619,7 +619,7 @@ private fun MifosSavingsAccountExpendableCard(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
IconButton(
Expand Down Expand Up @@ -721,7 +721,7 @@ private fun MifosSavingsAccountsLazyColumn(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
}
Expand All @@ -744,7 +744,7 @@ private fun MifosSavingsAccountsLazyColumn(
fontWeight = FontWeight.Normal,
fontStyle = FontStyle.Normal,
),
color = Black,
color = MaterialTheme.colorScheme.onSurface,
textAlign = TextAlign.Start,
)
}
Expand Down