Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
TimPushkin committed May 17, 2024
1 parent 4ce6f0e commit 4c17a65
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 33 deletions.
8 changes: 4 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ dependencies {
ksp libs.google.dagger.hiltCompiler

implementation platform(libs.androidx.compose.bom)
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.material3:material3'
implementation 'androidx.compose.ui:ui-tooling-preview'
debugImplementation 'androidx.compose.ui:ui-tooling'
implementation libs.androidx.compose.material3
implementation libs.androidx.compose.ui
implementation libs.androidx.compose.ui.tooling.preview
debugImplementation libs.androidx.compose.ui.tooling

implementation libs.androidx.core.ktx
implementation libs.androidx.activity.compose
Expand Down
31 changes: 20 additions & 11 deletions app/src/main/java/ru/spbu/depnav/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.activity.SystemBarStyle
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.runtime.CompositionLocalProvider
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.lifecycle.compose.collectAsStateWithLifecycle
Expand All @@ -46,19 +47,27 @@ class MainActivity : ComponentActivity() {
super.onCreate(savedInstanceState)

setContent {
val themeMode by prefs.themeModeFlow.collectAsStateWithLifecycle()
val darkTheme = when (themeMode) {
ThemeMode.LIGHT -> false
ThemeMode.DARK -> true
ThemeMode.SYSTEM -> isSystemInDarkTheme()
}
CompositionLocalProvider(
// Fix for https://issuetracker.google.com/issues/336842920 -- should be removed as
// soon as Compose UI 1.7.0 becomes stable
androidx.lifecycle.compose.LocalLifecycleOwner provides
androidx.compose.ui.platform.LocalLifecycleOwner.current
) {
val themeMode by prefs.themeModeFlow.collectAsStateWithLifecycle()
val darkTheme = when (themeMode) {
ThemeMode.LIGHT -> false
ThemeMode.DARK -> true
ThemeMode.SYSTEM -> isSystemInDarkTheme()
}

LaunchedEffect(darkTheme) {
val style = SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT) { darkTheme }
enableEdgeToEdge(style, style)
}
LaunchedEffect(darkTheme) {
val style =
SystemBarStyle.auto(Color.TRANSPARENT, Color.TRANSPARENT) { darkTheme }
enableEdgeToEdge(style, style)
}

DepNavTheme(darkTheme = darkTheme) { MapScreen(prefs) }
DepNavTheme(darkTheme = darkTheme) { MapScreen(prefs) }
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.Info
import androidx.compose.material.icons.rounded.Settings
import androidx.compose.material3.Divider
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.ModalDrawerSheet
Expand Down Expand Up @@ -65,7 +65,7 @@ fun MainMenuSheet(

MapItems(selectedMapId, availableMaps, onMapSelected)

Divider(
HorizontalDivider(
modifier = Modifier.padding(
horizontal = ITEM_HORIZONTAL_PADDING,
vertical = DIVIDER_VERTICAL_PADDING
Expand Down
7 changes: 3 additions & 4 deletions app/src/main/java/ru/spbu/depnav/ui/component/MapSearchBar.kt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.rounded.ArrowBack
import androidx.compose.material.icons.automirrored.rounded.ArrowBack
import androidx.compose.material.icons.rounded.Clear
import androidx.compose.material.icons.rounded.Menu
import androidx.compose.material3.ExperimentalMaterial3Api
Expand All @@ -47,7 +47,6 @@ import androidx.compose.material3.Text
import androidx.compose.material3.minimumInteractiveComponentSize
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalLayoutDirection
Expand Down Expand Up @@ -78,7 +77,7 @@ private val ACTIVATION_EXIT_SPEC = tween<Float>(
"LongMethod", // No point in further shrinking
"LongParameterList" // Considered OK for a composable
)
@OptIn(ExperimentalMaterial3Api::class, ExperimentalComposeUiApi::class)
@OptIn(ExperimentalMaterial3Api::class)
fun MapSearchBar(
query: String,
onQueryChange: (String) -> Unit,
Expand Down Expand Up @@ -181,7 +180,7 @@ private fun AnimatedLeadingIcon(
if (active) {
IconButton(onClick = onNavigateBackClick) {
Icon(
Icons.Rounded.ArrowBack,
Icons.AutoMirrored.Rounded.ArrowBack,
contentDescription = stringResource(R.string.label_navigate_back)
)
}
Expand Down
24 changes: 14 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]

kotlin = "1.9.21"
kspPlugin = "1.9.21-1.0.15"
composeCompiler = "1.5.6"
hilt = "2.49"
lifecycle = "2.6.2"
kotlin = "1.9.24"
kspPlugin = "1.9.24-1.0.20"
composeCompiler = "1.5.14"
hilt = "2.51.1"
lifecycle = "2.8.0"
room = "2.6.1"


Expand All @@ -21,11 +21,15 @@ androidx-room-compiler = { group = "androidx.room", name = "room-compiler", vers
google-dagger-hilt = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
google-dagger-hiltCompiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }

androidx-compose-bom = "androidx.compose:compose-bom:2023.10.01"
androidx-compose-bom = "androidx.compose:compose-bom:2024.05.00"
androidx-compose-material3 = { module = "androidx.compose.material3:material3" }
androidx-compose-ui = { module = "androidx.compose.ui:ui" }
androidx-compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling" }
androidx-compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" }

androidx-core-ktx = "androidx.core:core-ktx:1.12.0"
androidx-activity-compose = "androidx.activity:activity-compose:1.8.1"
plrapps-mapcompose = "ovh.plrapps:mapcompose:2.9.8"
androidx-core-ktx = "androidx.core:core-ktx:1.13.1"
androidx-activity-compose = "androidx.activity:activity-compose:1.9.0"
plrapps-mapcompose = "ovh.plrapps:mapcompose:2.12.4"

junit = "junit:junit:4.13.2"
androidx-test-runner = "androidx.test:runner:1.5.2"
Expand All @@ -35,7 +39,7 @@ androidx-test-extJunit = "androidx.test.ext:junit:1.1.5"

[plugins]

android-application = "com.android.application:8.2.0"
android-application = { id = "com.android.application", version = "8.4.0" }
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
google-dagger-hilt-android = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
google-devtools-ksp = { id = "com.google.devtools.ksp", version.ref = "kspPlugin" }
Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu May 18 22:44:59 MSK 2023
#Fri May 17 12:35:02 MSK 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

0 comments on commit 4c17a65

Please sign in to comment.