Update Compose, AGP and other dependencies

This commit is contained in:
Shinokuni 2024-09-22 14:53:15 +02:00
parent 74719480df
commit 60f15a58ab
5 changed files with 273 additions and 292 deletions

View File

@ -8,13 +8,9 @@ import androidx.activity.ComponentActivity
import androidx.activity.SystemBarStyle import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge 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.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.graphics.toArgb
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import androidx.lifecycle.lifecycleScope import androidx.lifecycle.lifecycleScope
import androidx.preference.PreferenceManager import androidx.preference.PreferenceManager
@ -78,16 +74,8 @@ class MainActivity : ComponentActivity(), KoinComponent {
ReadropsTheme( ReadropsTheme(
useDarkTheme = useDarkTheme useDarkTheme = useDarkTheme
) { ) {
val navigationBarElevation = NavigationBarDefaults.Elevation
enableEdgeToEdge( enableEdgeToEdge(
statusBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT), statusBarStyle = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT),
navigationBarStyle = SystemBarStyle.light(
MaterialTheme.colorScheme.surfaceColorAtElevation(navigationBarElevation)
.toArgb(),
MaterialTheme.colorScheme.surfaceColorAtElevation(navigationBarElevation)
.toArgb()
)
) )
Navigator( Navigator(

View File

@ -31,8 +31,7 @@ import androidx.compose.material3.SnackbarResult
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar import androidx.compose.material3.TopAppBar
import androidx.compose.material3.TopAppBarDefaults import androidx.compose.material3.TopAppBarDefaults
import androidx.compose.material3.pulltorefresh.PullToRefreshContainer import androidx.compose.material3.pulltorefresh.PullToRefreshBox
import androidx.compose.material3.pulltorefresh.rememberPullToRefreshState
import androidx.compose.material3.rememberDrawerState import androidx.compose.material3.rememberDrawerState
import androidx.compose.material3.rememberTopAppBarState import androidx.compose.material3.rememberTopAppBarState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
@ -40,7 +39,6 @@ import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.snapshotFlow import androidx.compose.runtime.snapshotFlow
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
@ -96,7 +94,6 @@ object TimelineTab : Tab {
val items = state.itemState.collectAsLazyPagingItems() val items = state.itemState.collectAsLazyPagingItems()
val lazyListState = rememberLazyListState() val lazyListState = rememberLazyListState()
val pullToRefreshState = rememberPullToRefreshState()
val snackbarHostState = remember { SnackbarHostState() } val snackbarHostState = remember { SnackbarHostState() }
val topAppBarState = rememberTopAppBarState() val topAppBarState = rememberTopAppBarState()
val topAppBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(topAppBarState) 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) { LaunchedEffect(state.scrollToTop) {
if (state.scrollToTop) { if (state.scrollToTop) {
lazyListState.scrollToItem(0) 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( ModalNavigationDrawer(
drawerState = drawerState, drawerState = drawerState,
drawerContent = { drawerContent = {
@ -346,7 +273,6 @@ object TimelineTab : Tab {
modifier = Modifier modifier = Modifier
.padding(paddingValues) .padding(paddingValues)
.fillMaxSize() .fillMaxSize()
.nestedScroll(pullToRefreshState.nestedScrollConnection)
.nestedScroll(topAppBarScrollBehavior.nestedScrollConnection) .nestedScroll(topAppBarScrollBehavior.nestedScrollConnection)
) { ) {
when { when {
@ -368,86 +294,135 @@ object TimelineTab : Tab {
} }
else -> { else -> {
if (items.itemCount > 0) { PullToRefreshBox(
MarkItemsRead( isRefreshing = state.isRefreshing,
lazyListState = lazyListState, onRefresh = { screenModel.refreshTimeline(context) },
items = items, ) {
markReadOnScroll = state.markReadOnScroll, if (items.itemCount > 0) {
screenModel = screenModel MarkItemsRead(
) lazyListState = lazyListState,
items = items,
LazyColumn( markReadOnScroll = state.markReadOnScroll,
state = lazyListState, screenModel = screenModel
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) { LazyColumn(
TimelineItem( state = lazyListState,
itemWithFeed = itemWithFeed, contentPadding = PaddingValues(
onClick = { vertical = if (state.itemSize == TimelineItemSize.COMPACT) {
screenModel.setItemRead(itemWithFeed.item) 0.dp
navigator.push(ItemScreen(itemWithFeed.item.id)) } else {
}, MaterialTheme.spacing.shortSpacing
onFavorite = { }
screenModel.updateStarState(itemWithFeed.item) ),
}, verticalArrangement = Arrangement.spacedBy(
onShare = { if (state.itemSize == TimelineItemSize.COMPACT) {
screenModel.shareItem( 0.dp
itemWithFeed.item, } else
context MaterialTheme.spacing.shortSpacing
) )
}, ) {
onSetReadState = { items(
screenModel.updateItemReadState(itemWithFeed.item) count = items.itemCount,
}, key = items.itemKey { it.item.id },
size = state.itemSize ) { 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 -> {}
}
} }
} }

View File

@ -2,67 +2,74 @@ package com.readrops.app.util.theme
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
val md_theme_light_primary = Color(0xFF0062A2) val primaryLight = Color(0xFF0062A2)
val md_theme_light_onPrimary = Color(0xFFFFFFFF) val onPrimaryLight = Color(0xFFFFFFFF)
val md_theme_light_primaryContainer = Color(0xFFD1E4FF) val primaryContainerLight = Color(0xFFD1E4FF)
val md_theme_light_onPrimaryContainer = Color(0xFF001D35) val onPrimaryContainerLight = Color(0xFF001D35)
val md_theme_light_secondary = Color(0xFFA43D00) val secondaryLight = Color(0xFFA43D00)
val md_theme_light_onSecondary = Color(0xFFFFFFFF) val onSecondaryLight = Color(0xFFFFFFFF)
val md_theme_light_secondaryContainer = Color(0xFFFFDBCD) val secondaryContainerLight = Color(0xFFFFDBCD)
val md_theme_light_onSecondaryContainer = Color(0xFF360F00) val onSecondaryContainerLight = Color(0xFF360F00)
val md_theme_light_tertiary = Color(0xFF006D3D) val tertiaryLight = Color(0xFF006D3D)
val md_theme_light_onTertiary = Color(0xFFFFFFFF) val onTertiaryLight = Color(0xFFFFFFFF)
val md_theme_light_tertiaryContainer = Color(0xFF97F7B7) val tertiaryContainerLight = Color(0xFF97F7B7)
val md_theme_light_onTertiaryContainer = Color(0xFF00210F) val onTertiaryContainerLight = Color(0xFF00210F)
val md_theme_light_error = Color(0xFFBA1A1A) val errorLight = Color(0xFFBA1A1A)
val md_theme_light_errorContainer = Color(0xFFFFDAD6) val onErrorLight = Color(0xFFFFFFFF)
val md_theme_light_onError = Color(0xFFFFFFFF) val errorContainerLight = Color(0xFFFFDAD6)
val md_theme_light_onErrorContainer = Color(0xFF410002) val onErrorContainerLight = Color(0xFF410002)
val md_theme_light_background = Color(0xFFF8FDFF) val backgroundLight = Color(0xFFF8FDFF)
val md_theme_light_onBackground = Color(0xFF001F25) val onBackgroundLight = Color(0xFF001F25)
val md_theme_light_surface = Color(0xFFF8FDFF) val surfaceLight = Color(0xFFF8FDFF)
val md_theme_light_onSurface = Color(0xFF001F25) val onSurfaceLight = Color(0xFF001F25)
val md_theme_light_surfaceVariant = Color(0xFFDFE2EB) val surfaceVariantLight = Color(0xFFDFE2EB)
val md_theme_light_onSurfaceVariant = Color(0xFF42474E) val onSurfaceVariantLight = Color(0xFF42474E)
val md_theme_light_outline = Color(0xFF73777F) val outlineLight = Color(0xFF73777F)
val md_theme_light_inverseOnSurface = Color(0xFFD6F6FF) val outlineVariantLight = Color(0xFFC3C7CF)
val md_theme_light_inverseSurface = Color(0xFF00363F) val scrimLight = Color(0xFF000000)
val md_theme_light_inversePrimary = Color(0xFF9DCAFF) val inverseSurfaceLight = Color(0xFF00363F)
val md_theme_light_shadow = Color(0xFF000000) val inverseOnSurfaceLight = Color(0xFFD6F6FF)
val md_theme_light_surfaceTint = Color(0xFF0062A2) val inversePrimaryLight = Color(0xFF9DCAFF)
val md_theme_light_outlineVariant = Color(0xFFC3C7CF) val surfaceDimLight = Color(0xFFD8DAE0)
val md_theme_light_scrim = Color(0xFF000000) 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 primaryDark = Color(0xFF9DCAFF)
val md_theme_dark_onPrimary = Color(0xFF003257) val onPrimaryDark = Color(0xFF003257)
val md_theme_dark_primaryContainer = Color(0xFF00497C) val primaryContainerDark = Color(0xFF00497C)
val md_theme_dark_onPrimaryContainer = Color(0xFFD1E4FF) val onPrimaryContainerDark = Color(0xFFD1E4FF)
val md_theme_dark_secondary = Color(0xFFFFB597) val secondaryDark = Color(0xFFFFB597)
val md_theme_dark_onSecondary = Color(0xFF581D00) val onSecondaryDark = Color(0xFF581D00)
val md_theme_dark_secondaryContainer = Color(0xFF7D2D00) val secondaryContainerDark = Color(0xFF7D2D00)
val md_theme_dark_onSecondaryContainer = Color(0xFFFFDBCD) val onSecondaryContainerDark = Color(0xFFFFDBCD)
val md_theme_dark_tertiary = Color(0xFF7BDA9C) val tertiaryDark = Color(0xFF7BDA9C)
val md_theme_dark_onTertiary = Color(0xFF00391D) val onTertiaryDark = Color(0xFF00391D)
val md_theme_dark_tertiaryContainer = Color(0xFF00522C) val tertiaryContainerDark = Color(0xFF00522C)
val md_theme_dark_onTertiaryContainer = Color(0xFF97F7B7) val onTertiaryContainerDark = Color(0xFF97F7B7)
val md_theme_dark_error = Color(0xFFFFB4AB) val errorDark = Color(0xFFFFB4AB)
val md_theme_dark_errorContainer = Color(0xFF93000A) val onErrorDark = Color(0xFF690005)
val md_theme_dark_onError = Color(0xFF690005) val errorContainerDark = Color(0xFF93000A)
val md_theme_dark_onErrorContainer = Color(0xFFFFDAD6) val onErrorContainerDark = Color(0xFFFFDAD6)
val md_theme_dark_background = Color(0xFF001F25) val backgroundDark = Color(0xFF001F25)
val md_theme_dark_onBackground = Color(0xFFA6EEFF) val onBackgroundDark = Color(0xFFA6EEFF)
val md_theme_dark_surface = Color(0xFF001F25) val surfaceDark = Color(0xFF001F25)
val md_theme_dark_onSurface = Color(0xFFA6EEFF) val onSurfaceDark = Color(0xFFA6EEFF)
val md_theme_dark_surfaceVariant = Color(0xFF42474E) val surfaceVariantDark = Color(0xFF42474E)
val md_theme_dark_onSurfaceVariant = Color(0xFFC3C7CF) val onSurfaceVariantDark = Color(0xFFC3C7CF)
val md_theme_dark_outline = Color(0xFF8D9199) val outlineDark = Color(0xFF8D9199)
val md_theme_dark_inverseOnSurface = Color(0xFF001F25) val outlineVariantDark = Color(0xFF42474E)
val md_theme_dark_inverseSurface = Color(0xFFA6EEFF) val scrimDark = Color(0xFF000000)
val md_theme_dark_inversePrimary = Color(0xFF0062A2) val inverseSurfaceDark = Color(0xFFA6EEFF)
val md_theme_dark_shadow = Color(0xFF000000) val inverseOnSurfaceDark = Color(0xFF001F25)
val md_theme_dark_surfaceTint = Color(0xFF9DCAFF) val inversePrimaryDark = Color(0xFF0062A2)
val md_theme_dark_outlineVariant = Color(0xFF42474E) val surfaceDimDark = Color(0xFF101418)
val md_theme_dark_scrim = Color(0xFF000000) val surfaceBrightDark = Color(0xFF36393E)
val surfaceContainerLowestDark = Color(0xFF0B0E13)
val surfaceContainerLowDark = Color(0xFF191C20)
val seed = Color(0xFF0072BC) val surfaceContainerDark = Color(0xFF1D2024)
val surfaceContainerHighDark = Color(0xFF272A2F)
val surfaceContainerHighestDark = Color(0xFF32353A)

View File

@ -7,69 +7,80 @@ import androidx.compose.material3.lightColorScheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
private val LightColors = lightColorScheme( private val lightScheme = lightColorScheme(
primary = md_theme_light_primary, primary = primaryLight,
onPrimary = md_theme_light_onPrimary, onPrimary = onPrimaryLight,
primaryContainer = md_theme_light_primaryContainer, primaryContainer = primaryContainerLight,
onPrimaryContainer = md_theme_light_onPrimaryContainer, onPrimaryContainer = onPrimaryContainerLight,
secondary = md_theme_light_secondary, secondary = secondaryLight,
onSecondary = md_theme_light_onSecondary, onSecondary = onSecondaryLight,
secondaryContainer = md_theme_light_secondaryContainer, secondaryContainer = secondaryContainerLight,
onSecondaryContainer = md_theme_light_onSecondaryContainer, onSecondaryContainer = onSecondaryContainerLight,
tertiary = md_theme_light_tertiary, tertiary = tertiaryLight,
onTertiary = md_theme_light_onTertiary, onTertiary = onTertiaryLight,
tertiaryContainer = md_theme_light_tertiaryContainer, tertiaryContainer = tertiaryContainerLight,
onTertiaryContainer = md_theme_light_onTertiaryContainer, onTertiaryContainer = onTertiaryContainerLight,
error = md_theme_light_error, error = errorLight,
errorContainer = md_theme_light_errorContainer, onError = onErrorLight,
onError = md_theme_light_onError, errorContainer = errorContainerLight,
onErrorContainer = md_theme_light_onErrorContainer, onErrorContainer = onErrorContainerLight,
background = md_theme_light_background, background = backgroundLight,
onBackground = md_theme_light_onBackground, onBackground = onBackgroundLight,
surface = md_theme_light_surface, surface = surfaceLight,
onSurface = md_theme_light_onSurface, onSurface = onSurfaceLight,
surfaceVariant = md_theme_light_surfaceVariant, surfaceVariant = surfaceVariantLight,
onSurfaceVariant = md_theme_light_onSurfaceVariant, onSurfaceVariant = onSurfaceVariantLight,
outline = md_theme_light_outline, outline = outlineLight,
inverseOnSurface = md_theme_light_inverseOnSurface, outlineVariant = outlineVariantLight,
inverseSurface = md_theme_light_inverseSurface, scrim = scrimLight,
inversePrimary = md_theme_light_inversePrimary, inverseSurface = inverseSurfaceLight,
surfaceTint = md_theme_light_surfaceTint, inverseOnSurface = inverseOnSurfaceLight,
outlineVariant = md_theme_light_outlineVariant, inversePrimary = inversePrimaryLight,
scrim = md_theme_light_scrim, surfaceDim = surfaceDimLight,
surfaceBright = surfaceBrightLight,
surfaceContainerLowest = surfaceContainerLowestLight,
surfaceContainerLow = surfaceContainerLowLight,
surfaceContainer = surfaceContainerLight,
surfaceContainerHigh = surfaceContainerHighLight,
surfaceContainerHighest = surfaceContainerHighestLight,
) )
private val darkScheme = darkColorScheme(
private val DarkColors = darkColorScheme( primary = primaryDark,
primary = md_theme_dark_primary, onPrimary = onPrimaryDark,
onPrimary = md_theme_dark_onPrimary, primaryContainer = primaryContainerDark,
primaryContainer = md_theme_dark_primaryContainer, onPrimaryContainer = onPrimaryContainerDark,
onPrimaryContainer = md_theme_dark_onPrimaryContainer, secondary = secondaryDark,
secondary = md_theme_dark_secondary, onSecondary = onSecondaryDark,
onSecondary = md_theme_dark_onSecondary, secondaryContainer = secondaryContainerDark,
secondaryContainer = md_theme_dark_secondaryContainer, onSecondaryContainer = onSecondaryContainerDark,
onSecondaryContainer = md_theme_dark_onSecondaryContainer, tertiary = tertiaryDark,
tertiary = md_theme_dark_tertiary, onTertiary = onTertiaryDark,
onTertiary = md_theme_dark_onTertiary, tertiaryContainer = tertiaryContainerDark,
tertiaryContainer = md_theme_dark_tertiaryContainer, onTertiaryContainer = onTertiaryContainerDark,
onTertiaryContainer = md_theme_dark_onTertiaryContainer, error = errorDark,
error = md_theme_dark_error, onError = onErrorDark,
errorContainer = md_theme_dark_errorContainer, errorContainer = errorContainerDark,
onError = md_theme_dark_onError, onErrorContainer = onErrorContainerDark,
onErrorContainer = md_theme_dark_onErrorContainer, background = backgroundDark,
background = md_theme_dark_background, onBackground = onBackgroundDark,
onBackground = md_theme_dark_onBackground, surface = surfaceDark,
surface = md_theme_dark_surface, onSurface = onSurfaceDark,
onSurface = md_theme_dark_onSurface, surfaceVariant = surfaceVariantDark,
surfaceVariant = md_theme_dark_surfaceVariant, onSurfaceVariant = onSurfaceVariantDark,
onSurfaceVariant = md_theme_dark_onSurfaceVariant, outline = outlineDark,
outline = md_theme_dark_outline, outlineVariant = outlineVariantDark,
inverseOnSurface = md_theme_dark_inverseOnSurface, scrim = scrimDark,
inverseSurface = md_theme_dark_inverseSurface, inverseSurface = inverseSurfaceDark,
inversePrimary = md_theme_dark_inversePrimary, inverseOnSurface = inverseOnSurfaceDark,
surfaceTint = md_theme_dark_surfaceTint, inversePrimary = inversePrimaryDark,
outlineVariant = md_theme_dark_outlineVariant, surfaceDim = surfaceDimDark,
scrim = md_theme_dark_scrim, surfaceBright = surfaceBrightDark,
surfaceContainerLowest = surfaceContainerLowestDark,
surfaceContainerLow = surfaceContainerLowDark,
surfaceContainer = surfaceContainerDark,
surfaceContainerHigh = surfaceContainerHighDark,
surfaceContainerHighest = surfaceContainerHighestDark,
) )
@Composable @Composable
@ -78,9 +89,9 @@ fun ReadropsTheme(
content: @Composable () -> Unit content: @Composable () -> Unit
) { ) {
val colors = if (!useDarkTheme) { val colors = if (!useDarkTheme) {
LightColors lightScheme
} else { } else {
DarkColors darkScheme
} }
MaterialTheme( MaterialTheme(

View File

@ -1,16 +1,16 @@
[versions] [versions]
kotlin = "2.0.0" kotlin = "2.0.0"
ksp = "2.0.0-1.0.24" ksp = "2.0.0-1.0.24"
android_agp = "8.5.1" android_agp = "8.5.2"
compose_bom = "2024.06.00" compose_bom = "2024.09.02"
voyager = "1.1.0-beta02" voyager = "1.1.0-beta02"
lifecycle = "2.8.4" lifecycle = "2.8.6"
coil = "2.7.0" coil = "2.7.0"
coroutines = "1.8.1" coroutines = "1.8.1"
room = "2.6.1" room = "2.6.1"
koin-bom = "3.5.6" koin-bom = "3.5.6"
paging = "3.3.1" paging = "3.3.2"
okhttp = "4.12.0" okhttp = "4.12.0"
retrofit = "2.11.0" retrofit = "2.11.0"
about_libraries = "11.2.2" 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 = { module = "androidx.compose.ui:ui-tooling" }
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }
# specify material3 version is required for gradle to find the dependency # specify material3 version is required for gradle to find the dependency
compose-material3 = { module = "androidx.compose.material3:material3", version = "1.2.1" } compose-material3 = { module = "androidx.compose.material3:material3", version = "1.3.0" }
compose-activity = "androidx.activity:activity-compose:1.9.0" compose-activity = "androidx.activity:activity-compose:1.9.2"
compose-permissions = "com.google.accompanist:accompanist-permissions:0.34.0" compose-permissions = "com.google.accompanist:accompanist-permissions:0.34.0"
voyager-navigator = { module = "cafe.adriel.voyager:voyager-navigator", version.ref = "voyager" } 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" konsumexml = "com.gitlab.mvysny.konsume-xml:konsume-xml:1.1"
kotlinxmlbuilder = "org.redundent:kotlin-xml-builder:1.7.3" #TODO update this 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" jsoup = "org.jsoup:jsoup:1.18.1"
moshi = "com.squareup.moshi:moshi:1.15.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" appcompat = "androidx.appcompat:appcompat:1.7.0"
material = "com.google.android.material:material:1.12.0" material = "com.google.android.material:material:1.12.0"
palette = "androidx.palette:palette-ktx:1.0.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" encrypted-preferences = "androidx.security:security-crypto:1.1.0-alpha06"
datastore = "androidx.datastore:datastore-preferences:1.1.1" datastore = "androidx.datastore:datastore-preferences:1.1.1"
browser = "androidx.browser:browser:1.8.0" browser = "androidx.browser:browser:1.8.0"
@ -102,7 +102,7 @@ preferences = "androidx.preference:preference-ktx:1.2.1"
# test # test
junit4 = "junit:junit:4.13.2" junit4 = "junit:junit:4.13.2"
ext-junit = "androidx.test.ext:junit:1.2.1" 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" ext-rules = "androidx.test:rules:1.6.1"
expressocore = "androidx.test.espresso:espresso-core:3.6.1" expressocore = "androidx.test.espresso:espresso-core:3.6.1"