Update Compose, AGP and other dependencies
This commit is contained in:
parent
74719480df
commit
60f15a58ab
@ -8,13 +8,9 @@ import androidx.activity.ComponentActivity
|
||||
import androidx.activity.SystemBarStyle
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.NavigationBarDefaults
|
||||
import androidx.compose.material3.surfaceColorAtElevation
|
||||
import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.ui.graphics.toArgb
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.preference.PreferenceManager
|
||||
@ -78,16 +74,8 @@ class MainActivity : ComponentActivity(), KoinComponent {
|
||||
ReadropsTheme(
|
||||
useDarkTheme = useDarkTheme
|
||||
) {
|
||||
val navigationBarElevation = NavigationBarDefaults.Elevation
|
||||
|
||||
enableEdgeToEdge(
|
||||
statusBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT),
|
||||
navigationBarStyle = SystemBarStyle.light(
|
||||
MaterialTheme.colorScheme.surfaceColorAtElevation(navigationBarElevation)
|
||||
.toArgb(),
|
||||
MaterialTheme.colorScheme.surfaceColorAtElevation(navigationBarElevation)
|
||||
.toArgb()
|
||||
)
|
||||
)
|
||||
|
||||
Navigator(
|
||||
|
@ -31,8 +31,7 @@ import androidx.compose.material3.SnackbarResult
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TopAppBar
|
||||
import androidx.compose.material3.TopAppBarDefaults
|
||||
import androidx.compose.material3.pulltorefresh.PullToRefreshContainer
|
||||
import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState
|
||||
import androidx.compose.material3.pulltorefresh.PullToRefreshBox
|
||||
import androidx.compose.material3.rememberDrawerState
|
||||
import androidx.compose.material3.rememberTopAppBarState
|
||||
import androidx.compose.runtime.Composable
|
||||
@ -40,7 +39,6 @@ import androidx.compose.runtime.LaunchedEffect
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.remember
|
||||
import androidx.compose.runtime.snapshotFlow
|
||||
import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.input.nestedscroll.nestedScroll
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
@ -96,7 +94,6 @@ object TimelineTab : Tab {
|
||||
val items = state.itemState.collectAsLazyPagingItems()
|
||||
|
||||
val lazyListState = rememberLazyListState()
|
||||
val pullToRefreshState = rememberPullToRefreshState()
|
||||
val snackbarHostState = remember { SnackbarHostState() }
|
||||
val topAppBarState = rememberTopAppBarState()
|
||||
val topAppBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(topAppBarState)
|
||||
@ -113,22 +110,6 @@ object TimelineTab : Tab {
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(state.isRefreshing) {
|
||||
if (state.isRefreshing) {
|
||||
pullToRefreshState.startRefresh()
|
||||
} else {
|
||||
pullToRefreshState.endRefresh()
|
||||
}
|
||||
}
|
||||
|
||||
// Material3 pull to refresh doesn't have a onRefresh callback,
|
||||
// so we need to listen to the internal state change to trigger the refresh
|
||||
LaunchedEffect(pullToRefreshState.isRefreshing) {
|
||||
if (pullToRefreshState.isRefreshing && !state.isRefreshing) {
|
||||
screenModel.refreshTimeline(context)
|
||||
}
|
||||
}
|
||||
|
||||
LaunchedEffect(state.scrollToTop) {
|
||||
if (state.scrollToTop) {
|
||||
lazyListState.scrollToItem(0)
|
||||
@ -190,60 +171,6 @@ object TimelineTab : Tab {
|
||||
}
|
||||
}
|
||||
|
||||
when (val dialog = state.dialog) {
|
||||
is DialogState.ConfirmDialog -> {
|
||||
TwoChoicesDialog(
|
||||
title = stringResource(R.string.mark_all_articles_read),
|
||||
text = stringResource(R.string.mark_all_articles_read_question),
|
||||
icon = painterResource(id = R.drawable.ic_rss_feed_grey),
|
||||
confirmText = stringResource(id = R.string.validate),
|
||||
dismissText = stringResource(id = R.string.cancel),
|
||||
onDismiss = { screenModel.closeDialog() },
|
||||
onConfirm = {
|
||||
screenModel.closeDialog()
|
||||
screenModel.setAllItemsRead()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
is DialogState.FilterSheet -> {
|
||||
FilterBottomSheet(
|
||||
filters = state.filters,
|
||||
onSetShowReadItems = {
|
||||
screenModel.setShowReadItemsState(!state.filters.showReadItems)
|
||||
},
|
||||
onSetOrderField = {
|
||||
screenModel.setOrderFieldState(
|
||||
if (state.filters.orderField == OrderField.ID) {
|
||||
OrderField.DATE
|
||||
} else {
|
||||
OrderField.ID
|
||||
}
|
||||
)
|
||||
},
|
||||
onSetOrderType = {
|
||||
screenModel.setOrderTypeState(
|
||||
if (state.filters.orderType == OrderType.DESC) {
|
||||
OrderType.ASC
|
||||
} else {
|
||||
OrderType.DESC
|
||||
}
|
||||
)
|
||||
},
|
||||
onDismiss = { screenModel.closeDialog() }
|
||||
)
|
||||
}
|
||||
|
||||
is DialogState.ErrorList -> {
|
||||
ErrorListDialog(
|
||||
errorResult = dialog.errorResult,
|
||||
onDismiss = { screenModel.closeDialog(dialog) }
|
||||
)
|
||||
}
|
||||
|
||||
null -> {}
|
||||
}
|
||||
|
||||
ModalNavigationDrawer(
|
||||
drawerState = drawerState,
|
||||
drawerContent = {
|
||||
@ -346,7 +273,6 @@ object TimelineTab : Tab {
|
||||
modifier = Modifier
|
||||
.padding(paddingValues)
|
||||
.fillMaxSize()
|
||||
.nestedScroll(pullToRefreshState.nestedScrollConnection)
|
||||
.nestedScroll(topAppBarScrollBehavior.nestedScrollConnection)
|
||||
) {
|
||||
when {
|
||||
@ -368,86 +294,135 @@ object TimelineTab : Tab {
|
||||
}
|
||||
|
||||
else -> {
|
||||
if (items.itemCount > 0) {
|
||||
MarkItemsRead(
|
||||
lazyListState = lazyListState,
|
||||
items = items,
|
||||
markReadOnScroll = state.markReadOnScroll,
|
||||
screenModel = screenModel
|
||||
)
|
||||
|
||||
LazyColumn(
|
||||
state = lazyListState,
|
||||
contentPadding = PaddingValues(
|
||||
vertical = if (state.itemSize == TimelineItemSize.COMPACT) {
|
||||
0.dp
|
||||
} else {
|
||||
MaterialTheme.spacing.shortSpacing
|
||||
}
|
||||
),
|
||||
verticalArrangement = Arrangement.spacedBy(
|
||||
if (state.itemSize == TimelineItemSize.COMPACT) {
|
||||
0.dp
|
||||
} else
|
||||
MaterialTheme.spacing.shortSpacing
|
||||
PullToRefreshBox(
|
||||
isRefreshing = state.isRefreshing,
|
||||
onRefresh = { screenModel.refreshTimeline(context) },
|
||||
) {
|
||||
if (items.itemCount > 0) {
|
||||
MarkItemsRead(
|
||||
lazyListState = lazyListState,
|
||||
items = items,
|
||||
markReadOnScroll = state.markReadOnScroll,
|
||||
screenModel = screenModel
|
||||
)
|
||||
) {
|
||||
items(
|
||||
count = items.itemCount,
|
||||
key = items.itemKey { it.item.id },
|
||||
) { itemCount ->
|
||||
val itemWithFeed = items[itemCount]
|
||||
|
||||
if (itemWithFeed != null) {
|
||||
TimelineItem(
|
||||
itemWithFeed = itemWithFeed,
|
||||
onClick = {
|
||||
screenModel.setItemRead(itemWithFeed.item)
|
||||
navigator.push(ItemScreen(itemWithFeed.item.id))
|
||||
},
|
||||
onFavorite = {
|
||||
screenModel.updateStarState(itemWithFeed.item)
|
||||
},
|
||||
onShare = {
|
||||
screenModel.shareItem(
|
||||
itemWithFeed.item,
|
||||
context
|
||||
)
|
||||
},
|
||||
onSetReadState = {
|
||||
screenModel.updateItemReadState(itemWithFeed.item)
|
||||
},
|
||||
size = state.itemSize
|
||||
)
|
||||
LazyColumn(
|
||||
state = lazyListState,
|
||||
contentPadding = PaddingValues(
|
||||
vertical = if (state.itemSize == TimelineItemSize.COMPACT) {
|
||||
0.dp
|
||||
} else {
|
||||
MaterialTheme.spacing.shortSpacing
|
||||
}
|
||||
),
|
||||
verticalArrangement = Arrangement.spacedBy(
|
||||
if (state.itemSize == TimelineItemSize.COMPACT) {
|
||||
0.dp
|
||||
} else
|
||||
MaterialTheme.spacing.shortSpacing
|
||||
)
|
||||
) {
|
||||
items(
|
||||
count = items.itemCount,
|
||||
key = items.itemKey { it.item.id },
|
||||
) { itemCount ->
|
||||
val itemWithFeed = items[itemCount]
|
||||
|
||||
if (itemWithFeed != null) {
|
||||
TimelineItem(
|
||||
itemWithFeed = itemWithFeed,
|
||||
onClick = {
|
||||
screenModel.setItemRead(itemWithFeed.item)
|
||||
navigator.push(ItemScreen(itemWithFeed.item.id))
|
||||
},
|
||||
onFavorite = {
|
||||
screenModel.updateStarState(itemWithFeed.item)
|
||||
},
|
||||
onShare = {
|
||||
screenModel.shareItem(
|
||||
itemWithFeed.item,
|
||||
context
|
||||
)
|
||||
},
|
||||
onSetReadState = {
|
||||
screenModel.updateItemReadState(itemWithFeed.item)
|
||||
},
|
||||
size = state.itemSize
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// Empty lazyColumn to let the pull to refresh be usable
|
||||
// when no items are displayed
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {}
|
||||
|
||||
Placeholder(
|
||||
text = stringResource(R.string.no_article),
|
||||
painter = painterResource(R.drawable.ic_timeline),
|
||||
)
|
||||
}
|
||||
|
||||
PullToRefreshContainer(
|
||||
state = pullToRefreshState,
|
||||
modifier = Modifier.align(Alignment.TopCenter)
|
||||
)
|
||||
} else {
|
||||
// Empty lazyColumn to let the pull to refresh be usable
|
||||
// when the no item placeholder is displayed
|
||||
LazyColumn(
|
||||
modifier = Modifier.fillMaxSize()
|
||||
) {}
|
||||
|
||||
PullToRefreshContainer(
|
||||
state = pullToRefreshState,
|
||||
modifier = Modifier.align(Alignment.TopCenter)
|
||||
)
|
||||
|
||||
Placeholder(
|
||||
text = stringResource(R.string.no_article),
|
||||
painter = painterResource(R.drawable.ic_timeline),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
when (val dialog = state.dialog) {
|
||||
is DialogState.ConfirmDialog -> {
|
||||
TwoChoicesDialog(
|
||||
title = stringResource(R.string.mark_all_articles_read),
|
||||
text = stringResource(R.string.mark_all_articles_read_question),
|
||||
icon = painterResource(id = R.drawable.ic_rss_feed_grey),
|
||||
confirmText = stringResource(id = R.string.validate),
|
||||
dismissText = stringResource(id = R.string.cancel),
|
||||
onDismiss = { screenModel.closeDialog() },
|
||||
onConfirm = {
|
||||
screenModel.closeDialog()
|
||||
screenModel.setAllItemsRead()
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
is DialogState.FilterSheet -> {
|
||||
FilterBottomSheet(
|
||||
filters = state.filters,
|
||||
onSetShowReadItems = {
|
||||
screenModel.setShowReadItemsState(!state.filters.showReadItems)
|
||||
},
|
||||
onSetOrderField = {
|
||||
screenModel.setOrderFieldState(
|
||||
if (state.filters.orderField == OrderField.ID) {
|
||||
OrderField.DATE
|
||||
} else {
|
||||
OrderField.ID
|
||||
}
|
||||
)
|
||||
},
|
||||
onSetOrderType = {
|
||||
screenModel.setOrderTypeState(
|
||||
if (state.filters.orderType == OrderType.DESC) {
|
||||
OrderType.ASC
|
||||
} else {
|
||||
OrderType.DESC
|
||||
}
|
||||
)
|
||||
},
|
||||
onDismiss = { screenModel.closeDialog() }
|
||||
)
|
||||
}
|
||||
|
||||
is DialogState.ErrorList -> {
|
||||
ErrorListDialog(
|
||||
errorResult = dialog.errorResult,
|
||||
onDismiss = { screenModel.closeDialog(dialog) }
|
||||
)
|
||||
}
|
||||
|
||||
null -> {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2,67 +2,74 @@ package com.readrops.app.util.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
val md_theme_light_primary = Color(0xFF0062A2)
|
||||
val md_theme_light_onPrimary = Color(0xFFFFFFFF)
|
||||
val md_theme_light_primaryContainer = Color(0xFFD1E4FF)
|
||||
val md_theme_light_onPrimaryContainer = Color(0xFF001D35)
|
||||
val md_theme_light_secondary = Color(0xFFA43D00)
|
||||
val md_theme_light_onSecondary = Color(0xFFFFFFFF)
|
||||
val md_theme_light_secondaryContainer = Color(0xFFFFDBCD)
|
||||
val md_theme_light_onSecondaryContainer = Color(0xFF360F00)
|
||||
val md_theme_light_tertiary = Color(0xFF006D3D)
|
||||
val md_theme_light_onTertiary = Color(0xFFFFFFFF)
|
||||
val md_theme_light_tertiaryContainer = Color(0xFF97F7B7)
|
||||
val md_theme_light_onTertiaryContainer = Color(0xFF00210F)
|
||||
val md_theme_light_error = Color(0xFFBA1A1A)
|
||||
val md_theme_light_errorContainer = Color(0xFFFFDAD6)
|
||||
val md_theme_light_onError = Color(0xFFFFFFFF)
|
||||
val md_theme_light_onErrorContainer = Color(0xFF410002)
|
||||
val md_theme_light_background = Color(0xFFF8FDFF)
|
||||
val md_theme_light_onBackground = Color(0xFF001F25)
|
||||
val md_theme_light_surface = Color(0xFFF8FDFF)
|
||||
val md_theme_light_onSurface = Color(0xFF001F25)
|
||||
val md_theme_light_surfaceVariant = Color(0xFFDFE2EB)
|
||||
val md_theme_light_onSurfaceVariant = Color(0xFF42474E)
|
||||
val md_theme_light_outline = Color(0xFF73777F)
|
||||
val md_theme_light_inverseOnSurface = Color(0xFFD6F6FF)
|
||||
val md_theme_light_inverseSurface = Color(0xFF00363F)
|
||||
val md_theme_light_inversePrimary = Color(0xFF9DCAFF)
|
||||
val md_theme_light_shadow = Color(0xFF000000)
|
||||
val md_theme_light_surfaceTint = Color(0xFF0062A2)
|
||||
val md_theme_light_outlineVariant = Color(0xFFC3C7CF)
|
||||
val md_theme_light_scrim = Color(0xFF000000)
|
||||
val primaryLight = Color(0xFF0062A2)
|
||||
val onPrimaryLight = Color(0xFFFFFFFF)
|
||||
val primaryContainerLight = Color(0xFFD1E4FF)
|
||||
val onPrimaryContainerLight = Color(0xFF001D35)
|
||||
val secondaryLight = Color(0xFFA43D00)
|
||||
val onSecondaryLight = Color(0xFFFFFFFF)
|
||||
val secondaryContainerLight = Color(0xFFFFDBCD)
|
||||
val onSecondaryContainerLight = Color(0xFF360F00)
|
||||
val tertiaryLight = Color(0xFF006D3D)
|
||||
val onTertiaryLight = Color(0xFFFFFFFF)
|
||||
val tertiaryContainerLight = Color(0xFF97F7B7)
|
||||
val onTertiaryContainerLight = Color(0xFF00210F)
|
||||
val errorLight = Color(0xFFBA1A1A)
|
||||
val onErrorLight = Color(0xFFFFFFFF)
|
||||
val errorContainerLight = Color(0xFFFFDAD6)
|
||||
val onErrorContainerLight = Color(0xFF410002)
|
||||
val backgroundLight = Color(0xFFF8FDFF)
|
||||
val onBackgroundLight = Color(0xFF001F25)
|
||||
val surfaceLight = Color(0xFFF8FDFF)
|
||||
val onSurfaceLight = Color(0xFF001F25)
|
||||
val surfaceVariantLight = Color(0xFFDFE2EB)
|
||||
val onSurfaceVariantLight = Color(0xFF42474E)
|
||||
val outlineLight = Color(0xFF73777F)
|
||||
val outlineVariantLight = Color(0xFFC3C7CF)
|
||||
val scrimLight = Color(0xFF000000)
|
||||
val inverseSurfaceLight = Color(0xFF00363F)
|
||||
val inverseOnSurfaceLight = Color(0xFFD6F6FF)
|
||||
val inversePrimaryLight = Color(0xFF9DCAFF)
|
||||
val surfaceDimLight = Color(0xFFD8DAE0)
|
||||
val surfaceBrightLight = Color(0xFFF8F9FF)
|
||||
val surfaceContainerLowestLight = Color(0xFFFFFFFF)
|
||||
val surfaceContainerLowLight = Color(0xFFF2F3F9)
|
||||
val surfaceContainerLight = Color(0xFFECEEF4)
|
||||
val surfaceContainerHighLight = Color(0xFFE6E8EE)
|
||||
val surfaceContainerHighestLight = Color(0xFFE1E2E8)
|
||||
|
||||
val md_theme_dark_primary = Color(0xFF9DCAFF)
|
||||
val md_theme_dark_onPrimary = Color(0xFF003257)
|
||||
val md_theme_dark_primaryContainer = Color(0xFF00497C)
|
||||
val md_theme_dark_onPrimaryContainer = Color(0xFFD1E4FF)
|
||||
val md_theme_dark_secondary = Color(0xFFFFB597)
|
||||
val md_theme_dark_onSecondary = Color(0xFF581D00)
|
||||
val md_theme_dark_secondaryContainer = Color(0xFF7D2D00)
|
||||
val md_theme_dark_onSecondaryContainer = Color(0xFFFFDBCD)
|
||||
val md_theme_dark_tertiary = Color(0xFF7BDA9C)
|
||||
val md_theme_dark_onTertiary = Color(0xFF00391D)
|
||||
val md_theme_dark_tertiaryContainer = Color(0xFF00522C)
|
||||
val md_theme_dark_onTertiaryContainer = Color(0xFF97F7B7)
|
||||
val md_theme_dark_error = Color(0xFFFFB4AB)
|
||||
val md_theme_dark_errorContainer = Color(0xFF93000A)
|
||||
val md_theme_dark_onError = Color(0xFF690005)
|
||||
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6)
|
||||
val md_theme_dark_background = Color(0xFF001F25)
|
||||
val md_theme_dark_onBackground = Color(0xFFA6EEFF)
|
||||
val md_theme_dark_surface = Color(0xFF001F25)
|
||||
val md_theme_dark_onSurface = Color(0xFFA6EEFF)
|
||||
val md_theme_dark_surfaceVariant = Color(0xFF42474E)
|
||||
val md_theme_dark_onSurfaceVariant = Color(0xFFC3C7CF)
|
||||
val md_theme_dark_outline = Color(0xFF8D9199)
|
||||
val md_theme_dark_inverseOnSurface = Color(0xFF001F25)
|
||||
val md_theme_dark_inverseSurface = Color(0xFFA6EEFF)
|
||||
val md_theme_dark_inversePrimary = Color(0xFF0062A2)
|
||||
val md_theme_dark_shadow = Color(0xFF000000)
|
||||
val md_theme_dark_surfaceTint = Color(0xFF9DCAFF)
|
||||
val md_theme_dark_outlineVariant = Color(0xFF42474E)
|
||||
val md_theme_dark_scrim = Color(0xFF000000)
|
||||
|
||||
|
||||
val seed = Color(0xFF0072BC)
|
||||
val primaryDark = Color(0xFF9DCAFF)
|
||||
val onPrimaryDark = Color(0xFF003257)
|
||||
val primaryContainerDark = Color(0xFF00497C)
|
||||
val onPrimaryContainerDark = Color(0xFFD1E4FF)
|
||||
val secondaryDark = Color(0xFFFFB597)
|
||||
val onSecondaryDark = Color(0xFF581D00)
|
||||
val secondaryContainerDark = Color(0xFF7D2D00)
|
||||
val onSecondaryContainerDark = Color(0xFFFFDBCD)
|
||||
val tertiaryDark = Color(0xFF7BDA9C)
|
||||
val onTertiaryDark = Color(0xFF00391D)
|
||||
val tertiaryContainerDark = Color(0xFF00522C)
|
||||
val onTertiaryContainerDark = Color(0xFF97F7B7)
|
||||
val errorDark = Color(0xFFFFB4AB)
|
||||
val onErrorDark = Color(0xFF690005)
|
||||
val errorContainerDark = Color(0xFF93000A)
|
||||
val onErrorContainerDark = Color(0xFFFFDAD6)
|
||||
val backgroundDark = Color(0xFF001F25)
|
||||
val onBackgroundDark = Color(0xFFA6EEFF)
|
||||
val surfaceDark = Color(0xFF001F25)
|
||||
val onSurfaceDark = Color(0xFFA6EEFF)
|
||||
val surfaceVariantDark = Color(0xFF42474E)
|
||||
val onSurfaceVariantDark = Color(0xFFC3C7CF)
|
||||
val outlineDark = Color(0xFF8D9199)
|
||||
val outlineVariantDark = Color(0xFF42474E)
|
||||
val scrimDark = Color(0xFF000000)
|
||||
val inverseSurfaceDark = Color(0xFFA6EEFF)
|
||||
val inverseOnSurfaceDark = Color(0xFF001F25)
|
||||
val inversePrimaryDark = Color(0xFF0062A2)
|
||||
val surfaceDimDark = Color(0xFF101418)
|
||||
val surfaceBrightDark = Color(0xFF36393E)
|
||||
val surfaceContainerLowestDark = Color(0xFF0B0E13)
|
||||
val surfaceContainerLowDark = Color(0xFF191C20)
|
||||
val surfaceContainerDark = Color(0xFF1D2024)
|
||||
val surfaceContainerHighDark = Color(0xFF272A2F)
|
||||
val surfaceContainerHighestDark = Color(0xFF32353A)
|
@ -7,69 +7,80 @@ import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
|
||||
|
||||
private val LightColors = lightColorScheme(
|
||||
primary = md_theme_light_primary,
|
||||
onPrimary = md_theme_light_onPrimary,
|
||||
primaryContainer = md_theme_light_primaryContainer,
|
||||
onPrimaryContainer = md_theme_light_onPrimaryContainer,
|
||||
secondary = md_theme_light_secondary,
|
||||
onSecondary = md_theme_light_onSecondary,
|
||||
secondaryContainer = md_theme_light_secondaryContainer,
|
||||
onSecondaryContainer = md_theme_light_onSecondaryContainer,
|
||||
tertiary = md_theme_light_tertiary,
|
||||
onTertiary = md_theme_light_onTertiary,
|
||||
tertiaryContainer = md_theme_light_tertiaryContainer,
|
||||
onTertiaryContainer = md_theme_light_onTertiaryContainer,
|
||||
error = md_theme_light_error,
|
||||
errorContainer = md_theme_light_errorContainer,
|
||||
onError = md_theme_light_onError,
|
||||
onErrorContainer = md_theme_light_onErrorContainer,
|
||||
background = md_theme_light_background,
|
||||
onBackground = md_theme_light_onBackground,
|
||||
surface = md_theme_light_surface,
|
||||
onSurface = md_theme_light_onSurface,
|
||||
surfaceVariant = md_theme_light_surfaceVariant,
|
||||
onSurfaceVariant = md_theme_light_onSurfaceVariant,
|
||||
outline = md_theme_light_outline,
|
||||
inverseOnSurface = md_theme_light_inverseOnSurface,
|
||||
inverseSurface = md_theme_light_inverseSurface,
|
||||
inversePrimary = md_theme_light_inversePrimary,
|
||||
surfaceTint = md_theme_light_surfaceTint,
|
||||
outlineVariant = md_theme_light_outlineVariant,
|
||||
scrim = md_theme_light_scrim,
|
||||
private val lightScheme = lightColorScheme(
|
||||
primary = primaryLight,
|
||||
onPrimary = onPrimaryLight,
|
||||
primaryContainer = primaryContainerLight,
|
||||
onPrimaryContainer = onPrimaryContainerLight,
|
||||
secondary = secondaryLight,
|
||||
onSecondary = onSecondaryLight,
|
||||
secondaryContainer = secondaryContainerLight,
|
||||
onSecondaryContainer = onSecondaryContainerLight,
|
||||
tertiary = tertiaryLight,
|
||||
onTertiary = onTertiaryLight,
|
||||
tertiaryContainer = tertiaryContainerLight,
|
||||
onTertiaryContainer = onTertiaryContainerLight,
|
||||
error = errorLight,
|
||||
onError = onErrorLight,
|
||||
errorContainer = errorContainerLight,
|
||||
onErrorContainer = onErrorContainerLight,
|
||||
background = backgroundLight,
|
||||
onBackground = onBackgroundLight,
|
||||
surface = surfaceLight,
|
||||
onSurface = onSurfaceLight,
|
||||
surfaceVariant = surfaceVariantLight,
|
||||
onSurfaceVariant = onSurfaceVariantLight,
|
||||
outline = outlineLight,
|
||||
outlineVariant = outlineVariantLight,
|
||||
scrim = scrimLight,
|
||||
inverseSurface = inverseSurfaceLight,
|
||||
inverseOnSurface = inverseOnSurfaceLight,
|
||||
inversePrimary = inversePrimaryLight,
|
||||
surfaceDim = surfaceDimLight,
|
||||
surfaceBright = surfaceBrightLight,
|
||||
surfaceContainerLowest = surfaceContainerLowestLight,
|
||||
surfaceContainerLow = surfaceContainerLowLight,
|
||||
surfaceContainer = surfaceContainerLight,
|
||||
surfaceContainerHigh = surfaceContainerHighLight,
|
||||
surfaceContainerHighest = surfaceContainerHighestLight,
|
||||
)
|
||||
|
||||
|
||||
private val DarkColors = darkColorScheme(
|
||||
primary = md_theme_dark_primary,
|
||||
onPrimary = md_theme_dark_onPrimary,
|
||||
primaryContainer = md_theme_dark_primaryContainer,
|
||||
onPrimaryContainer = md_theme_dark_onPrimaryContainer,
|
||||
secondary = md_theme_dark_secondary,
|
||||
onSecondary = md_theme_dark_onSecondary,
|
||||
secondaryContainer = md_theme_dark_secondaryContainer,
|
||||
onSecondaryContainer = md_theme_dark_onSecondaryContainer,
|
||||
tertiary = md_theme_dark_tertiary,
|
||||
onTertiary = md_theme_dark_onTertiary,
|
||||
tertiaryContainer = md_theme_dark_tertiaryContainer,
|
||||
onTertiaryContainer = md_theme_dark_onTertiaryContainer,
|
||||
error = md_theme_dark_error,
|
||||
errorContainer = md_theme_dark_errorContainer,
|
||||
onError = md_theme_dark_onError,
|
||||
onErrorContainer = md_theme_dark_onErrorContainer,
|
||||
background = md_theme_dark_background,
|
||||
onBackground = md_theme_dark_onBackground,
|
||||
surface = md_theme_dark_surface,
|
||||
onSurface = md_theme_dark_onSurface,
|
||||
surfaceVariant = md_theme_dark_surfaceVariant,
|
||||
onSurfaceVariant = md_theme_dark_onSurfaceVariant,
|
||||
outline = md_theme_dark_outline,
|
||||
inverseOnSurface = md_theme_dark_inverseOnSurface,
|
||||
inverseSurface = md_theme_dark_inverseSurface,
|
||||
inversePrimary = md_theme_dark_inversePrimary,
|
||||
surfaceTint = md_theme_dark_surfaceTint,
|
||||
outlineVariant = md_theme_dark_outlineVariant,
|
||||
scrim = md_theme_dark_scrim,
|
||||
private val darkScheme = darkColorScheme(
|
||||
primary = primaryDark,
|
||||
onPrimary = onPrimaryDark,
|
||||
primaryContainer = primaryContainerDark,
|
||||
onPrimaryContainer = onPrimaryContainerDark,
|
||||
secondary = secondaryDark,
|
||||
onSecondary = onSecondaryDark,
|
||||
secondaryContainer = secondaryContainerDark,
|
||||
onSecondaryContainer = onSecondaryContainerDark,
|
||||
tertiary = tertiaryDark,
|
||||
onTertiary = onTertiaryDark,
|
||||
tertiaryContainer = tertiaryContainerDark,
|
||||
onTertiaryContainer = onTertiaryContainerDark,
|
||||
error = errorDark,
|
||||
onError = onErrorDark,
|
||||
errorContainer = errorContainerDark,
|
||||
onErrorContainer = onErrorContainerDark,
|
||||
background = backgroundDark,
|
||||
onBackground = onBackgroundDark,
|
||||
surface = surfaceDark,
|
||||
onSurface = onSurfaceDark,
|
||||
surfaceVariant = surfaceVariantDark,
|
||||
onSurfaceVariant = onSurfaceVariantDark,
|
||||
outline = outlineDark,
|
||||
outlineVariant = outlineVariantDark,
|
||||
scrim = scrimDark,
|
||||
inverseSurface = inverseSurfaceDark,
|
||||
inverseOnSurface = inverseOnSurfaceDark,
|
||||
inversePrimary = inversePrimaryDark,
|
||||
surfaceDim = surfaceDimDark,
|
||||
surfaceBright = surfaceBrightDark,
|
||||
surfaceContainerLowest = surfaceContainerLowestDark,
|
||||
surfaceContainerLow = surfaceContainerLowDark,
|
||||
surfaceContainer = surfaceContainerDark,
|
||||
surfaceContainerHigh = surfaceContainerHighDark,
|
||||
surfaceContainerHighest = surfaceContainerHighestDark,
|
||||
)
|
||||
|
||||
@Composable
|
||||
@ -78,9 +89,9 @@ fun ReadropsTheme(
|
||||
content: @Composable () -> Unit
|
||||
) {
|
||||
val colors = if (!useDarkTheme) {
|
||||
LightColors
|
||||
lightScheme
|
||||
} else {
|
||||
DarkColors
|
||||
darkScheme
|
||||
}
|
||||
|
||||
MaterialTheme(
|
||||
|
@ -1,16 +1,16 @@
|
||||
[versions]
|
||||
kotlin = "2.0.0"
|
||||
ksp = "2.0.0-1.0.24"
|
||||
android_agp = "8.5.1"
|
||||
compose_bom = "2024.06.00"
|
||||
android_agp = "8.5.2"
|
||||
compose_bom = "2024.09.02"
|
||||
|
||||
voyager = "1.1.0-beta02"
|
||||
lifecycle = "2.8.4"
|
||||
lifecycle = "2.8.6"
|
||||
coil = "2.7.0"
|
||||
coroutines = "1.8.1"
|
||||
room = "2.6.1"
|
||||
koin-bom = "3.5.6"
|
||||
paging = "3.3.1"
|
||||
paging = "3.3.2"
|
||||
okhttp = "4.12.0"
|
||||
retrofit = "2.11.0"
|
||||
about_libraries = "11.2.2"
|
||||
@ -32,8 +32,8 @@ compose-ui = { module = "androidx.compose.ui:ui" }
|
||||
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
|
||||
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
|
||||
# specify material3 version is required for gradle to find the dependency
|
||||
compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" }
|
||||
compose-activity = "androidx.activity:activity-compose:1.9.0"
|
||||
compose-material3 = { module = "androidx.compose.material3:material3", version = "1.3.0" }
|
||||
compose-activity = "androidx.activity:activity-compose:1.9.2"
|
||||
compose-permissions = "com.google.accompanist:accompanist-permissions:0.34.0"
|
||||
|
||||
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" }
|
||||
@ -82,7 +82,7 @@ aboutlibraries-composem3 = { module = "com.mikepenz:aboutlibraries-compose-m3",
|
||||
konsumexml = "com.gitlab.mvysny.konsume-xml:konsume-xml:1.1"
|
||||
kotlinxmlbuilder = "org.redundent:kotlin-xml-builder:1.7.3" #TODO update this
|
||||
|
||||
jdk-desugar = "com.android.tools:desugar_jdk_libs_nio:2.0.4"
|
||||
jdk-desugar = "com.android.tools:desugar_jdk_libs_nio:2.1.2"
|
||||
|
||||
jsoup = "org.jsoup:jsoup:1.18.1"
|
||||
moshi = "com.squareup.moshi:moshi:1.15.1"
|
||||
@ -92,7 +92,7 @@ corektx = "androidx.core:core-ktx:1.13.1"
|
||||
appcompat = "androidx.appcompat:appcompat:1.7.0"
|
||||
material = "com.google.android.material:material:1.12.0"
|
||||
palette = "androidx.palette:palette-ktx:1.0.0"
|
||||
workmanager = "androidx.work:work-runtime-ktx:2.9.0"
|
||||
workmanager = "androidx.work:work-runtime-ktx:2.9.1"
|
||||
encrypted-preferences = "androidx.security:security-crypto:1.1.0-alpha06"
|
||||
datastore = "androidx.datastore:datastore-preferences:1.1.1"
|
||||
browser = "androidx.browser:browser:1.8.0"
|
||||
@ -102,7 +102,7 @@ preferences = "androidx.preference:preference-ktx:1.2.1"
|
||||
# test
|
||||
junit4 = "junit:junit:4.13.2"
|
||||
ext-junit = "androidx.test.ext:junit:1.2.1"
|
||||
ext-runner = "androidx.test:runner:1.6.1"
|
||||
ext-runner = "androidx.test:runner:1.6.2"
|
||||
ext-rules = "androidx.test:rules:1.6.1"
|
||||
expressocore = "androidx.test.espresso:espresso-core:3.6.1"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user