Switch compose to Material3 Expressive theme
Signed-off-by: Aayush Gupta <aayushgupta219@gmail.com>
This commit is contained in:
@@ -9,7 +9,8 @@ import androidx.compose.foundation.layout.Box
|
|||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.requiredSize
|
import androidx.compose.foundation.layout.requiredSize
|
||||||
import androidx.compose.material3.CircularProgressIndicator
|
import androidx.compose.material3.ContainedLoadingIndicator
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
@@ -22,6 +23,7 @@ import com.aurora.store.R
|
|||||||
* @param modifier The modifier to be applied to the composable
|
* @param modifier The modifier to be applied to the composable
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
|
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||||
fun AppProgressComposable(modifier: Modifier = Modifier) {
|
fun AppProgressComposable(modifier: Modifier = Modifier) {
|
||||||
Box(
|
Box(
|
||||||
modifier = modifier
|
modifier = modifier
|
||||||
@@ -29,7 +31,7 @@ fun AppProgressComposable(modifier: Modifier = Modifier) {
|
|||||||
.padding(dimensionResource(R.dimen.padding_small)),
|
.padding(dimensionResource(R.dimen.padding_small)),
|
||||||
contentAlignment = Alignment.Center
|
contentAlignment = Alignment.Center
|
||||||
) {
|
) {
|
||||||
CircularProgressIndicator(
|
ContainedLoadingIndicator(
|
||||||
modifier = Modifier.requiredSize(dimensionResource(R.dimen.icon_size_small))
|
modifier = Modifier.requiredSize(dimensionResource(R.dimen.icon_size_small))
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,8 +7,9 @@ package com.aurora.store.compose.theme
|
|||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
|
import androidx.compose.material3.ExperimentalMaterial3ExpressiveApi
|
||||||
|
import androidx.compose.material3.MaterialExpressiveTheme
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
import androidx.compose.material3.Typography
|
|
||||||
import androidx.compose.material3.darkColorScheme
|
import androidx.compose.material3.darkColorScheme
|
||||||
import androidx.compose.material3.dynamicDarkColorScheme
|
import androidx.compose.material3.dynamicDarkColorScheme
|
||||||
import androidx.compose.material3.dynamicLightColorScheme
|
import androidx.compose.material3.dynamicLightColorScheme
|
||||||
@@ -23,6 +24,7 @@ import com.aurora.store.util.Preferences
|
|||||||
* App theme for Aurora Store based on [MaterialTheme]
|
* App theme for Aurora Store based on [MaterialTheme]
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
|
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
|
||||||
fun AuroraTheme(content: @Composable () -> Unit) {
|
fun AuroraTheme(content: @Composable () -> Unit) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val themeStyle = Preferences.getInteger(context, Preferences.PREFERENCE_THEME_STYLE)
|
val themeStyle = Preferences.getInteger(context, Preferences.PREFERENCE_THEME_STYLE)
|
||||||
@@ -46,5 +48,5 @@ fun AuroraTheme(content: @Composable () -> Unit) {
|
|||||||
else -> if (isSystemInDarkTheme()) darkScheme else lightScheme
|
else -> if (isSystemInDarkTheme()) darkScheme else lightScheme
|
||||||
}
|
}
|
||||||
|
|
||||||
MaterialTheme(colorScheme = colorScheme, typography = Typography(), content = content)
|
MaterialExpressiveTheme(colorScheme = colorScheme, content = content)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user