This is how the screen looks in dark mode If you couldn't see anything selected, here is the image with a selected box
I don't know whats causing the problem. And I thinking If I explain you my app structure a bit, that might help.
So, first about nav. My Root Nav Graph have two graphs in it. One is auth and the other is dashboardGraph. Both the screens in the auth graph shows exactly what is intented.
DashBoardGraph has no nested graphs, but there are 4 screens. The Four screens are dashboradScreen, overviewScreen, AddScreen, EditScreen. Every screen except overviewScreen has a scaffold. But only the dashbooard screen and the overview screen is showing the correct colors. As you can see in images, the rest of the screen has that dark overlay and they dont use my colors, these screens with faulty overlay are using their own colors.
This is the code of the same screen that is shown in the image. https://zerobin.org/?cbe65c434e92cc66#8dgULYDGu5tNjcaAYd1h5Cvhsu85CznYbDNefUDKTKEC
I did use my theme in main activity wrapping set content within it. And I have tried disabling animated content and visibility but the results are same. I have also tried clean build, rebuild, and invalidated caches.
And this is the code of the screen.
@Composable
fun AddHabitScreen(
state: AddHabitState,
event: (AddHabitEvent) -> Unit,
timerDialogEvent : (TimerDialogEvents) -> Unit,
timerDialogState : TimerDialogState,
backToDashboard : () -> Unit
){
Scaffold(floatingActionButton = {
FabButtonsRow(
onClickSave = {
event(AddHabitEvent.SaveHabit)
backToDashboard()
},
onClickCancel = {
backToDashboard()
}
)},
floatingActionButtonPosition = FabPosition.Center,
content = { paddingValues ->
val columnScrollState = rememberScrollState()
Column(modifier = Modifier
.fillMaxSize()
.padding(paddingValues)) {
ElevatedCard(
modifier = Modifier
.fillMaxWidth()
.height(60.dp),
shape = RoundedCornerShape(30.dp),
elevation = CardDefaults
.cardElevation(defaultElevation = 5.dp)
) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = "Create New Habit",
fontFamily = AppTypography.headlineMedium.fontFamily,
fontSize = AppTypography.headlineMedium.fontSize,
fontWeight = AppTypography.headlineMedium.fontWeight,
letterSpacing = AppTypography.headlineMedium.letterSpacing,
lineHeight = AppTypography.headlineMedium.lineHeight
)
}
}
OutlinedTextField(
value = state.name,
onValueChange = {
event(AddHabitEvent.NameChanged(it))
},
modifier = Modifier.fillMaxWidth(),
textStyle = TextStyle(
fontSize = AppTypography.titleMedium.fontSize,
fontWeight = AppTypography.titleMedium.fontWeight,
letterSpacing = AppTypography.titleMedium.letterSpacing,
lineHeight = AppTypography.titleMedium.lineHeight
),
maxLines = 1,
label = {
Text(text = "Title")
},
trailingIcon = {
Icon(imageVector = Icons.Outlined.Close,
contentDescription = "clear_text",
modifier = Modifier.clickable(
onClick = { event(AddHabitEvent.ClearNameText) }
))
}
)
OutlinedTextField(
value = state.description,
onValueChange = {
event(AddHabitEvent.DescriptionChanged(it))
},
modifier = Modifier
.fillMaxWidth()
.height(150.dp),
textStyle = TextStyle(
fontFamily = AppTypography.titleMedium.fontFamily,
fontSize = AppTypography.titleMedium.fontSize,
fontWeight = AppTypography.titleMedium.fontWeight,
letterSpacing = AppTypography.titleMedium.letterSpacing,
lineHeight = AppTypography.titleMedium.lineHeight
),
label = {
Text(
text = "Description",
fontFamily = AppTypography.titleMedium.fontFamily,
fontSize = AppTypography.titleMedium.fontSize,
fontWeight = AppTypography.titleMedium.fontWeight,
letterSpacing = AppTypography.titleMedium.letterSpacing,
lineHeight = AppTypography.titleMedium.lineHeight
)
}
)