Skip to content

Commit

Permalink
Used CompositionLocalProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
revanthkumarJ committed Dec 27, 2024
1 parent bbce160 commit cb2024d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.darkColorScheme
import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.ui.graphics.Color

private val LightThemeColors = lightColorScheme(
Expand Down Expand Up @@ -50,8 +51,14 @@ fun MifosMobileTheme(
else -> LightThemeColors
}

MaterialTheme(
colorScheme = colors,
content = content,
)
val backgroundTheme = if (useDarkTheme) BackgroundDark else BackgroundLight

CompositionLocalProvider(
LocalBackgroundTheme provides BackgroundTheme(backgroundTheme),
) {
MaterialTheme(
colorScheme = colors,
content = content,
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
package org.mifos.mobile.feature.about.ui

import android.content.Context
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.items
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
Expand All @@ -40,7 +38,6 @@ internal fun AboutUsScreen(
LazyColumn(
modifier = modifier
.fillMaxSize()
.background(MaterialTheme.colorScheme.background)
.padding(16.dp),
) {
item {
Expand Down

0 comments on commit cb2024d

Please sign in to comment.