From c9482b900f1d057b56f1a0411c20baeacae34da0 Mon Sep 17 00:00:00 2001 From: HLCaptain Date: Fri, 7 Jul 2023 22:13:18 +0200 Subject: [PATCH] Bumped version number. Refactors, added labels on animations, upgraded dependencies. Made some return types explicit. --- app/build.gradle.kts | 6 ++-- .../java/illyan/jay/data/firestore/Mapping.kt | 2 -- .../jay/data/sensor/SensorDataSource.kt | 2 +- .../main/java/illyan/jay/ui/about/About.kt | 3 +- .../illyan/jay/ui/about/AboutViewModel.kt | 2 +- .../java/illyan/jay/ui/freedrive/FreeDrive.kt | 7 ++-- app/src/main/java/illyan/jay/ui/home/Home.kt | 9 +++-- .../java/illyan/jay/ui/home/HomeViewModel.kt | 4 +-- .../java/illyan/jay/ui/libraries/Libraries.kt | 3 +- .../java/illyan/jay/ui/library/Library.kt | 3 +- .../main/java/illyan/jay/ui/login/Login.kt | 3 +- app/src/main/java/illyan/jay/ui/menu/Menu.kt | 5 ++- .../java/illyan/jay/ui/poi/model/Place.kt | 2 +- .../java/illyan/jay/ui/profile/Profile.kt | 5 ++- .../main/java/illyan/jay/ui/search/Search.kt | 10 ++++-- .../java/illyan/jay/ui/session/Session.kt | 17 ++++++---- .../java/illyan/jay/ui/sessions/Sessions.kt | 6 ++-- .../jay/ui/sessions/SessionsViewModel.kt | 4 +-- .../jay/ui/settings/data/DataSettings.kt | 5 ++- .../ui/settings/data/DataSettingsViewModel.kt | 2 +- .../jay/ui/settings/user/UserSettings.kt | 33 ++++++++++++------- .../ui/settings/user/UserSettingsViewModel.kt | 2 +- .../main/java/illyan/jay/ui/theme/Theme.kt | 8 ++--- .../illyan/jay/ui/theme/ThemeViewModel.kt | 2 +- app/src/main/java/illyan/jay/util/Util.kt | 3 -- gradle/libs.versions.toml | 10 +++--- 26 files changed, 96 insertions(+), 62 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index c281e6d5..a8748911 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -39,8 +39,8 @@ android { applicationId = "illyan.jay" minSdk = 21 targetSdk = 34 - versionCode = 15 - versionName = "0.3.4-alpha" + versionCode = 16 + versionName = "0.3.5-alpha" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { @@ -241,4 +241,4 @@ kapt { hilt { enableAggregatingTask = true -} \ No newline at end of file +} diff --git a/app/src/main/java/illyan/jay/data/firestore/Mapping.kt b/app/src/main/java/illyan/jay/data/firestore/Mapping.kt index 37e0408f..1ace1363 100644 --- a/app/src/main/java/illyan/jay/data/firestore/Mapping.kt +++ b/app/src/main/java/illyan/jay/data/firestore/Mapping.kt @@ -108,7 +108,6 @@ fun DomainPreferences.toFirestoreModel() = FirestoreUserPreferences( lastUpdateToAnalytics = lastUpdateToAnalytics?.toTimestamp(), ) -@OptIn(ExperimentalSerializationApi::class) fun List.toPath( sessionUUID: String, ownerUUID: String @@ -143,7 +142,6 @@ fun List.toPath( return path } -@OptIn(ExperimentalSerializationApi::class) private fun testCompressions(domainLocations: List) { // Size comparison between raw location data path and compressed data structures. diff --git a/app/src/main/java/illyan/jay/data/sensor/SensorDataSource.kt b/app/src/main/java/illyan/jay/data/sensor/SensorDataSource.kt index 655700bd..5ed80bea 100644 --- a/app/src/main/java/illyan/jay/data/sensor/SensorDataSource.kt +++ b/app/src/main/java/illyan/jay/data/sensor/SensorDataSource.kt @@ -107,5 +107,5 @@ class SensorDataSource @Inject constructor( fun removeLocationUpdates(callback: LocationCallback) = fusedLocationProviderClient.removeLocationUpdates(callback) - fun getSensors(type: Int = Sensor.TYPE_ALL) = sensorManager.getSensorList(type) + fun getSensors(type: Int = Sensor.TYPE_ALL): List = sensorManager.getSensorList(type) } diff --git a/app/src/main/java/illyan/jay/ui/about/About.kt b/app/src/main/java/illyan/jay/ui/about/About.kt index e0c4e4fb..2d2b0c8c 100644 --- a/app/src/main/java/illyan/jay/ui/about/About.kt +++ b/app/src/main/java/illyan/jay/ui/about/About.kt @@ -311,7 +311,8 @@ fun AboutAdScreen( targetValue = if (isAdLoaded) 1f else 0f, animationSpec = spring( stiffness = Spring.StiffnessLow - ) + ), + label = "Ad Fade In" ) AndroidView( modifier = Modifier diff --git a/app/src/main/java/illyan/jay/ui/about/AboutViewModel.kt b/app/src/main/java/illyan/jay/ui/about/AboutViewModel.kt index 71d0e868..a2b2f206 100644 --- a/app/src/main/java/illyan/jay/ui/about/AboutViewModel.kt +++ b/app/src/main/java/illyan/jay/ui/about/AboutViewModel.kt @@ -34,7 +34,7 @@ import javax.inject.Inject @HiltViewModel class AboutViewModel @Inject constructor( private val settingsInteractor: SettingsInteractor, - private val remoteConfig: FirebaseRemoteConfig, + remoteConfig: FirebaseRemoteConfig, ) : ViewModel() { val showAds = settingsInteractor.userPreferences.map { diff --git a/app/src/main/java/illyan/jay/ui/freedrive/FreeDrive.kt b/app/src/main/java/illyan/jay/ui/freedrive/FreeDrive.kt index b1cd6a72..a5b53830 100644 --- a/app/src/main/java/illyan/jay/ui/freedrive/FreeDrive.kt +++ b/app/src/main/java/illyan/jay/ui/freedrive/FreeDrive.kt @@ -69,7 +69,7 @@ import illyan.jay.ui.theme.JayTheme import illyan.jay.ui.theme.statefulColorScheme import illyan.jay.util.plus -private const val paddingRatio = 0.25f +private const val PaddingRatio = 0.25f val DefaultScreenOnSheetPadding = PaddingValues( start = MenuItemPadding * 2, @@ -82,7 +82,7 @@ fun calculatePaddingOffset(): PaddingValues { val layoutHeight = absoluteBottom.value - absoluteTop.value val freeSpace = layoutHeight - cameraPadding.value.calculateBottomPadding() return PaddingValues( - bottom = freeSpace * paddingRatio + bottom = freeSpace * PaddingRatio ) } @@ -174,7 +174,8 @@ fun FreeDriveScreenWithPermission( ) { Crossfade( modifier = Modifier.animateContentSize(), - targetState = isServiceRunning + targetState = isServiceRunning, + label = "Free drive button" ) { Text( modifier = Modifier.animateContentSize(), diff --git a/app/src/main/java/illyan/jay/ui/home/Home.kt b/app/src/main/java/illyan/jay/ui/home/Home.kt index a6a47074..4617276a 100644 --- a/app/src/main/java/illyan/jay/ui/home/Home.kt +++ b/app/src/main/java/illyan/jay/ui/home/Home.kt @@ -1010,7 +1010,8 @@ private fun SheetNavHost( animationSpec = SpringSpec( dampingRatio = Spring.DampingRatioNoBouncy, stiffness = Spring.StiffnessMedium - ) + ), + label = "Sheet fade in/out" ) val density = LocalDensity.current.density DestinationsNavHost( @@ -1072,14 +1073,16 @@ private fun SearchNavHost( animationSpec = SpringSpec( dampingRatio = Spring.DampingRatioNoBouncy, stiffness = Spring.StiffnessVeryLow - ) + ), + label = "Search screen fade in/out" ) val searchFraction by animateFloatAsState( targetValue = if (isSearching) { fullScreenFraction } else { 0f - } + }, + label = "Search screen expand/collapse" ) DestinationsNavHost( navGraph = NavGraphs.search, diff --git a/app/src/main/java/illyan/jay/ui/home/HomeViewModel.kt b/app/src/main/java/illyan/jay/ui/home/HomeViewModel.kt index 485f81d0..440d8ee4 100644 --- a/app/src/main/java/illyan/jay/ui/home/HomeViewModel.kt +++ b/app/src/main/java/illyan/jay/ui/home/HomeViewModel.kt @@ -45,9 +45,9 @@ import javax.inject.Inject @HiltViewModel class HomeViewModel @Inject constructor( private val mapboxInteractor: MapboxInteractor, - private val authInteractor: AuthInteractor, private val sessionInteractor: SessionInteractor, - private val performance: FirebasePerformance, + authInteractor: AuthInteractor, + performance: FirebasePerformance, @CoroutineDispatcherIO private val dispatcherIO: CoroutineDispatcher, ) : ViewModel() { diff --git a/app/src/main/java/illyan/jay/ui/libraries/Libraries.kt b/app/src/main/java/illyan/jay/ui/libraries/Libraries.kt index b3a8bcc5..e65401fe 100644 --- a/app/src/main/java/illyan/jay/ui/libraries/Libraries.kt +++ b/app/src/main/java/illyan/jay/ui/libraries/Libraries.kt @@ -196,7 +196,8 @@ fun LibraryItem( color = AlertDialogDefaults.titleContentColor, ) Crossfade( - targetState = library.repositoryUrl to library.moreInfoUrl + targetState = library.repositoryUrl to library.moreInfoUrl, + label = "Library URLs" ) { repositoryAndMoreInfoUrls -> val shownText = repositoryAndMoreInfoUrls.run { // Show Repo URL, then More Info URL, then null diff --git a/app/src/main/java/illyan/jay/ui/library/Library.kt b/app/src/main/java/illyan/jay/ui/library/Library.kt index e8e9d70b..ff0acb23 100644 --- a/app/src/main/java/illyan/jay/ui/library/Library.kt +++ b/app/src/main/java/illyan/jay/ui/library/Library.kt @@ -160,7 +160,8 @@ fun LibraryScreen( } Crossfade( modifier = Modifier.animateContentSize(), - targetState = library.license?.url + targetState = library.license?.url, + label = "License" ) { if (it != null) { MenuButton( diff --git a/app/src/main/java/illyan/jay/ui/login/Login.kt b/app/src/main/java/illyan/jay/ui/login/Login.kt index 51099b7d..253bcf2d 100644 --- a/app/src/main/java/illyan/jay/ui/login/Login.kt +++ b/app/src/main/java/illyan/jay/ui/login/Login.kt @@ -80,7 +80,8 @@ fun LoginDialogContent( ) { Crossfade( modifier = modifier, - targetState = isUserSigningIn + targetState = isUserSigningIn, + label = "Login Dialog Content" ) { if (it) { JayDialogContent( diff --git a/app/src/main/java/illyan/jay/ui/menu/Menu.kt b/app/src/main/java/illyan/jay/ui/menu/Menu.kt index 617ab746..f566ea11 100644 --- a/app/src/main/java/illyan/jay/ui/menu/Menu.kt +++ b/app/src/main/java/illyan/jay/ui/menu/Menu.kt @@ -231,7 +231,10 @@ fun MenuItemCard( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(4.dp) ) { - Crossfade(targetState = icon) { + Crossfade( + targetState = icon, + label = "Menu item icon", + ) { if (it != null) { Icon( modifier = Modifier.padding( diff --git a/app/src/main/java/illyan/jay/ui/poi/model/Place.kt b/app/src/main/java/illyan/jay/ui/poi/model/Place.kt index cf2f45a0..ef74611b 100644 --- a/app/src/main/java/illyan/jay/ui/poi/model/Place.kt +++ b/app/src/main/java/illyan/jay/ui/poi/model/Place.kt @@ -31,4 +31,4 @@ data class Place( val latitude: Double ) : Parcelable -fun Place.toPoint() = Point.fromLngLat(longitude, latitude) +fun Place.toPoint(): Point = Point.fromLngLat(longitude, latitude) diff --git a/app/src/main/java/illyan/jay/ui/profile/Profile.kt b/app/src/main/java/illyan/jay/ui/profile/Profile.kt index 5cd1957a..63afdb95 100644 --- a/app/src/main/java/illyan/jay/ui/profile/Profile.kt +++ b/app/src/main/java/illyan/jay/ui/profile/Profile.kt @@ -546,7 +546,10 @@ fun UserInfo( text = infoName, style = nameStyle ) - Crossfade(targetState = show) { + Crossfade( + targetState = show, + label = "User info" + ) { Text( text = if (it) info else stringResource(R.string.hidden_field_string), style = style diff --git a/app/src/main/java/illyan/jay/ui/search/Search.kt b/app/src/main/java/illyan/jay/ui/search/Search.kt index ea6150c1..5390d81f 100644 --- a/app/src/main/java/illyan/jay/ui/search/Search.kt +++ b/app/src/main/java/illyan/jay/ui/search/Search.kt @@ -266,7 +266,10 @@ fun LazyListScope.suggestionItems( list = items, emptyListPlaceholder = { AnimatedVisibility(visible = isLoadingSuggestions || items.isNotEmpty()) { - Crossfade(targetState = isLoadingSuggestions) { + Crossfade( + targetState = isLoadingSuggestions, + label = "Suggestion initial loading animation", + ) { if (it) { SearchCard( shape = RoundedCornerShape(SearchItemsCornerRadius), @@ -387,7 +390,10 @@ fun FavoriteButton( modifier = modifier.padding(horizontal = 4.dp), onClick = onToggleFavorite ) { - Crossfade(targetState = isFavorite) { + Crossfade( + targetState = isFavorite, + label = "Favorite button animation", + ) { Icon( modifier = Modifier.size(32.dp), imageVector = if (it) { diff --git a/app/src/main/java/illyan/jay/ui/session/Session.kt b/app/src/main/java/illyan/jay/ui/session/Session.kt index c1d26821..636ba776 100644 --- a/app/src/main/java/illyan/jay/ui/session/Session.kt +++ b/app/src/main/java/illyan/jay/ui/session/Session.kt @@ -45,6 +45,7 @@ import androidx.compose.runtime.DisposableEffect import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.derivedStateOf import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableFloatStateOf import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.remember import androidx.compose.runtime.saveable.rememberSaveable @@ -224,8 +225,8 @@ fun SessionScreen( viewModel.load(sessionUUID) } val gradientFilter by viewModel.gradientFilter.collectAsStateWithLifecycle() - var previousOffset by rememberSaveable { mutableStateOf(null) } - var currentOffset by rememberSaveable { mutableStateOf(sheetState.requireOffset()) } + var previousOffset by rememberSaveable { mutableFloatStateOf(0f) } + var currentOffset by rememberSaveable { mutableFloatStateOf(sheetState.requireOffset()) } var noMoreOffsetChanges by rememberSaveable { mutableStateOf(false) } LaunchedEffect(sheetState.requireOffset()) { previousOffset = currentOffset @@ -236,7 +237,7 @@ fun SessionScreen( val sheetHeightNotSet by remember { derivedStateOf { val isAnimationRunning = sheetState.progress != 1f - val almostReachedTargetHeight = abs(currentOffset - (previousOffset ?: 0f)) < 2f + val almostReachedTargetHeight = abs(currentOffset - previousOffset) < 2f isAnimationRunning || !almostReachedTargetHeight || !noMoreOffsetChanges } } @@ -384,7 +385,8 @@ fun SessionDetailsScreen( ) { Crossfade( modifier = Modifier.animateContentSize(), - targetState = session?.startLocationName + targetState = session?.startLocationName, + label = "Start location appear animation", ) { Text( text = it ?: stringResource(R.string.unknown), @@ -398,7 +400,8 @@ fun SessionDetailsScreen( ) Crossfade( modifier = Modifier.animateContentSize(), - targetState = (session?.endDateTime == null) to session?.endLocationName + targetState = (session?.endDateTime == null) to session?.endLocationName, + label = "End location appear animation", ) { if (it.first) { Icon( @@ -503,7 +506,7 @@ fun SessionDetailsScreen( divider = {}, selectedTabIndex = selectedTabIndex, indicator = { - TabRowDefaults.Indicator( + TabRowDefaults.SecondaryIndicator( Modifier .tabIndicatorOffset(it[selectedTabIndex]) .padding(horizontal = MenuItemPadding) @@ -579,4 +582,4 @@ private fun SessionDetailsScreenPreview( } } -fun LatLng.toMapboxPoint() = Point.fromLngLat(longitude, latitude) +fun LatLng.toMapboxPoint(): Point = Point.fromLngLat(longitude, latitude) diff --git a/app/src/main/java/illyan/jay/ui/sessions/Sessions.kt b/app/src/main/java/illyan/jay/ui/sessions/Sessions.kt index 151db156..2182b9fd 100644 --- a/app/src/main/java/illyan/jay/ui/sessions/Sessions.kt +++ b/app/src/main/java/illyan/jay/ui/sessions/Sessions.kt @@ -677,7 +677,8 @@ fun SessionCard( ) { Crossfade( modifier = Modifier.animateContentSize(), - targetState = session?.startLocationName + targetState = session?.startLocationName, + label = "Start location name", ) { Text( text = it ?: stringResource(R.string.unknown), @@ -691,7 +692,8 @@ fun SessionCard( ) Crossfade( modifier = Modifier.animateContentSize(), - targetState = (session?.endDateTime == null) to session?.endLocationName + targetState = (session?.endDateTime == null) to session?.endLocationName, + label = "End location name", ) { if (it.first) { Icon( diff --git a/app/src/main/java/illyan/jay/ui/sessions/SessionsViewModel.kt b/app/src/main/java/illyan/jay/ui/sessions/SessionsViewModel.kt index bab59647..05774bef 100644 --- a/app/src/main/java/illyan/jay/ui/sessions/SessionsViewModel.kt +++ b/app/src/main/java/illyan/jay/ui/sessions/SessionsViewModel.kt @@ -54,8 +54,8 @@ import kotlin.coroutines.cancellation.CancellationException class SessionsViewModel @Inject constructor( private val sessionInteractor: SessionInteractor, private val locationInteractor: LocationInteractor, - private val authInteractor: AuthInteractor, - private val appSettingsDataSource: AppSettingsDataSource, + authInteractor: AuthInteractor, + appSettingsDataSource: AppSettingsDataSource, @CoroutineDispatcherIO private val dispatcherIO: CoroutineDispatcher ) : ViewModel() { private val sessionStateFlows = mutableMapOf>() diff --git a/app/src/main/java/illyan/jay/ui/settings/data/DataSettings.kt b/app/src/main/java/illyan/jay/ui/settings/data/DataSettings.kt index 0c86e170..d3ba6bb8 100644 --- a/app/src/main/java/illyan/jay/ui/settings/data/DataSettings.kt +++ b/app/src/main/java/illyan/jay/ui/settings/data/DataSettings.kt @@ -180,7 +180,10 @@ fun DataSettingsButtons( verticalAlignment = Alignment.Bottom ) { val byteString = stringResource(R.string.bytes) - Crossfade(targetState = cachedDataSizeInBytes) { + Crossfade( + targetState = cachedDataSizeInBytes, + label = "Cached data size" + ) { when (it != null) { true -> { Row( diff --git a/app/src/main/java/illyan/jay/ui/settings/data/DataSettingsViewModel.kt b/app/src/main/java/illyan/jay/ui/settings/data/DataSettingsViewModel.kt index 72f3a836..4f6487ef 100644 --- a/app/src/main/java/illyan/jay/ui/settings/data/DataSettingsViewModel.kt +++ b/app/src/main/java/illyan/jay/ui/settings/data/DataSettingsViewModel.kt @@ -30,8 +30,8 @@ import javax.inject.Inject @HiltViewModel class DataSettingsViewModel @Inject constructor( - private val authInteractor: AuthInteractor, private val userInteractor: UserInteractor, + authInteractor: AuthInteractor, @CoroutineDispatcherIO private val dispatcherIO: CoroutineDispatcher ) : ViewModel() { diff --git a/app/src/main/java/illyan/jay/ui/settings/user/UserSettings.kt b/app/src/main/java/illyan/jay/ui/settings/user/UserSettings.kt index b693bada..7c8700e6 100644 --- a/app/src/main/java/illyan/jay/ui/settings/user/UserSettings.kt +++ b/app/src/main/java/illyan/jay/ui/settings/user/UserSettings.kt @@ -155,7 +155,8 @@ fun UserSettingsDialogContent( ) { Crossfade( modifier = modifier.animateContentSize(), - targetState = showAnalyticsRequestDialog + targetState = showAnalyticsRequestDialog, + label = "User Settings Dialog Content", ) { if (it) { AnalyticsRequestDialogContent( @@ -284,7 +285,10 @@ fun UserSettingsTitle( horizontalArrangement = Arrangement.End, verticalAlignment = Alignment.Top ) { - Crossfade(targetState = preferences != null) { + Crossfade( + targetState = preferences != null, + label = "User Settings Title", + ) { if (it && preferences != null) { Column( horizontalAlignment = Alignment.End @@ -304,7 +308,10 @@ fun UserSettingsTitle( private fun SyncPreferencesLabel( arePreferencesSynced: Boolean, ) { - Crossfade(targetState = arePreferencesSynced) { + Crossfade( + targetState = arePreferencesSynced, + label = "Sync Preferences Label", + ) { Row( verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(2.dp) @@ -484,7 +491,8 @@ fun SettingLabel( settingIndicator = { Crossfade( modifier = Modifier.animateContentSize(), - targetState = settingText + targetState = settingText, + label = "Setting label text loading indicator", ) { if (it != null) { Text( @@ -534,7 +542,8 @@ fun UserSettingsScreen( ) { Crossfade( modifier = modifier, - targetState = preferences != null + targetState = preferences != null, + label = "User Settings Screen" ) { if (it && preferences != null) { LazyColumn { @@ -565,15 +574,15 @@ fun UserSettingsScreen( selectValue = onThemeChange, selectedValue = preferences.theme, values = Theme.values().toList(), - getValueName = { - when (it) { + getValueName = { theme -> + when (theme) { Theme.System -> stringResource(R.string.system) Theme.Light -> stringResource(R.string.light) Theme.Dark -> stringResource(R.string.dark) } }, - getValueLeadingIcon = { - when (it) { + getValueLeadingIcon = { theme -> + when (theme) { Theme.System -> Icons.Rounded.Settings Theme.Light -> Icons.Rounded.LightMode Theme.Dark -> Icons.Rounded.DarkMode @@ -623,7 +632,8 @@ fun BooleanSetting( ) { Crossfade( modifier = Modifier.animateContentSize(), - targetState = value + targetState = value, + label = "Boolean setting text" ) { enabled -> Text( text = if (enabled) enabledText else disabledText, @@ -667,7 +677,8 @@ fun DropdownSetting( ) { Crossfade( modifier = Modifier.animateContentSize(), - targetState = selectedValue + targetState = selectedValue, + label = "Dropdown setting text", ) { state -> state?.let { Text( diff --git a/app/src/main/java/illyan/jay/ui/settings/user/UserSettingsViewModel.kt b/app/src/main/java/illyan/jay/ui/settings/user/UserSettingsViewModel.kt index 15f694b5..0698e8b5 100644 --- a/app/src/main/java/illyan/jay/ui/settings/user/UserSettingsViewModel.kt +++ b/app/src/main/java/illyan/jay/ui/settings/user/UserSettingsViewModel.kt @@ -39,7 +39,7 @@ import javax.inject.Inject @HiltViewModel class UserSettingsViewModel @Inject constructor( private val settingsInteractor: SettingsInteractor, - private val authInteractor: AuthInteractor + authInteractor: AuthInteractor ) : ViewModel() { private val _showAnalyticsRequestDialog = MutableStateFlow(false) diff --git a/app/src/main/java/illyan/jay/ui/theme/Theme.kt b/app/src/main/java/illyan/jay/ui/theme/Theme.kt index 9dc85fae..a7b0412f 100644 --- a/app/src/main/java/illyan/jay/ui/theme/Theme.kt +++ b/app/src/main/java/illyan/jay/ui/theme/Theme.kt @@ -203,9 +203,9 @@ fun animateColorScheme( return rememberedStatefulColorScheme } -private const val lightMapStyleUrl = "mapbox://styles/illyan/cl3kgeewz004k15ldn7x091r2" -private const val darkMapStyleUrl = "mapbox://styles/illyan/cl3kg2wpq001414muhgrpj15u" -private val _mapStyleUrl = MutableStateFlow(lightMapStyleUrl) +private const val LightMapStyleUrl = "mapbox://styles/illyan/cl3kgeewz004k15ldn7x091r2" +private const val DarkMapStyleUrl = "mapbox://styles/illyan/cl3kg2wpq001414muhgrpj15u" +private val _mapStyleUrl = MutableStateFlow(LightMapStyleUrl) val mapStyleUrl = _mapStyleUrl.asStateFlow() private lateinit var darkMapMarkers: MapMarkers @@ -288,7 +288,7 @@ fun JayTheme( color = Color.Transparent, darkIcons = !isDark ) - _mapStyleUrl.update { if (isDark) darkMapStyleUrl else lightMapStyleUrl } + _mapStyleUrl.update { if (isDark) DarkMapStyleUrl else LightMapStyleUrl } _mapMarkers.update { if (isDark) darkMapMarkers else lightMapMarkers } } } diff --git a/app/src/main/java/illyan/jay/ui/theme/ThemeViewModel.kt b/app/src/main/java/illyan/jay/ui/theme/ThemeViewModel.kt index 483fa20b..020a1b27 100644 --- a/app/src/main/java/illyan/jay/ui/theme/ThemeViewModel.kt +++ b/app/src/main/java/illyan/jay/ui/theme/ThemeViewModel.kt @@ -30,7 +30,7 @@ import javax.inject.Inject @HiltViewModel class ThemeViewModel @Inject constructor( - private val settingsInteractor: SettingsInteractor + settingsInteractor: SettingsInteractor ) : ViewModel() { val theme = settingsInteractor.userPreferences.map { it?.theme } .stateIn(viewModelScope, SharingStarted.Eagerly, null) diff --git a/app/src/main/java/illyan/jay/util/Util.kt b/app/src/main/java/illyan/jay/util/Util.kt index adf3009b..7c59f602 100644 --- a/app/src/main/java/illyan/jay/util/Util.kt +++ b/app/src/main/java/illyan/jay/util/Util.kt @@ -16,8 +16,6 @@ * If not, see . */ // ktlint-disable filename -@file:OptIn(ExperimentalMaterialApi::class) - package illyan.jay.util import android.os.SystemClock @@ -25,7 +23,6 @@ import androidx.compose.foundation.layout.PaddingValues import androidx.compose.foundation.layout.calculateEndPadding import androidx.compose.foundation.layout.calculateStartPadding import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material3.MaterialTheme import androidx.compose.ui.Modifier import androidx.compose.ui.composed diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5d947a50..d5bed818 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,12 +5,12 @@ compose-compiler = "1.4.8" kotlin = "1.8.22" ksp = "1.8.22-1.0.11" agp = "8.1.0-rc01" -accompanist = "0.31.2-alpha" +accompanist = "0.31.5-beta" room = "2.5.2" jetbrains-kotlinx-serialization = "1.5.1" jetbrains-kotlinx-collections-immutable = "0.3.5" -jetbrains-kotlinx-coroutines = "1.7.1" +jetbrains-kotlinx-coroutines = "1.7.2" androidx-core = "1.10.1" androidx-collection = "1.2.0" @@ -30,10 +30,10 @@ hilt-navigation-compose = "1.0.0" zstd-jni = "1.5.5-2" hlcaptain-compose-scrollbar = "0.0.3-alpha" -saket-swipe = "1.1.1" +saket-swipe = "1.2.0" timber = "5.0.1" compose-destinations = "1.9.42-beta" -coil-compose = "2.3.0" +coil-compose = "2.4.0" mapbox-maps = "10.13.0-beta.1" mapbox-search = "1.0.0-rc.3" @@ -43,7 +43,7 @@ google-secrets = "2.0.1" google-gms-services = "4.3.15" google-gms-play-services-location = "21.0.1" google-gms-play-services-auth = "20.6.0" -google-gms-play-services-ads = "22.1.0" +google-gms-play-services-ads = "22.2.0" google-maps-utils = "3.4.0" google-material = "1.9.0"