Skip to content

Commit

Permalink
update dependencies and android target version (#6074)
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost authored Jan 4, 2025
1 parent 00178c1 commit dfc39fb
Show file tree
Hide file tree
Showing 27 changed files with 338 additions and 92 deletions.
42 changes: 21 additions & 21 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ android {
}
}

compileSdk = 34
compileSdk = 35
testOptions {
unitTests {
isReturnDefaultValues = true
Expand All @@ -34,7 +34,7 @@ android {
defaultConfig {
applicationId = "de.westnordost.streetcomplete"
minSdk = 21
targetSdk = 34
targetSdk = 35
versionCode = 6003
versionName = "60.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
Expand Down Expand Up @@ -107,9 +107,9 @@ repositories {
}

dependencies {
val mockitoVersion = "3.12.4"
val mockitoVersion = "5.14.2"

coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.3")
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")

// tests
testImplementation("org.mockito:mockito-core:$mockitoVersion")
Expand All @@ -122,21 +122,21 @@ dependencies {
androidTestImplementation(kotlin("test"))

// dependency injection
implementation(platform("io.insert-koin:koin-bom:4.0.0"))
implementation(platform("io.insert-koin:koin-bom:4.0.1"))
implementation("io.insert-koin:koin-core")
implementation("io.insert-koin:koin-android")
implementation("io.insert-koin:koin-androidx-workmanager")
implementation("io.insert-koin:koin-androidx-compose")

// Android stuff
implementation("com.google.android.material:material:1.12.0")
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.core:core-ktx:1.15.0")
implementation("androidx.appcompat:appcompat:1.7.0")
implementation("androidx.constraintlayout:constraintlayout:2.2.0")
implementation("androidx.annotation:annotation:1.9.1")
implementation("androidx.fragment:fragment-ktx:1.8.5")
implementation("androidx.recyclerview:recyclerview:1.3.2")
implementation("androidx.viewpager:viewpager:1.0.0")
implementation("androidx.viewpager:viewpager:1.1.0")
implementation("androidx.localbroadcastmanager:localbroadcastmanager:1.1.0")

// Jetpack Compose
Expand All @@ -149,38 +149,38 @@ dependencies {
implementation("androidx.compose.ui:ui-tooling-preview")
debugImplementation("androidx.compose.ui:ui-tooling")

implementation("androidx.navigation:navigation-compose:2.8.4")
implementation("androidx.navigation:navigation-compose:2.8.5")

implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.8.7")
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.8.7")

// reorderable lists (raw Compose API is pretty complicated)
implementation("sh.calvin.reorderable:reorderable:2.4.0")
implementation("sh.calvin.reorderable:reorderable:2.4.2")

// multiplatform webview (for login via OAuth)
implementation("io.github.kevinnzou:compose-webview-multiplatform-android:1.9.20")
implementation("io.github.kevinnzou:compose-webview-multiplatform-android:1.9.40")

// photos
implementation("androidx.exifinterface:exifinterface:1.3.7")

// settings
implementation("com.russhwolf:multiplatform-settings:1.2.0")
implementation("com.russhwolf:multiplatform-settings:1.3.0")

// Kotlin
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.5.4")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.10.1")
implementation("org.jetbrains.kotlinx:kotlinx-io-core:0.6.0")

// Date/time
api("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")

// scheduling background jobs
implementation("androidx.work:work-runtime-ktx:2.9.1")
implementation("androidx.work:work-runtime-ktx:2.10.0")

// HTTP Client
implementation("io.ktor:ktor-client-core:2.3.13")
implementation("io.ktor:ktor-client-android:2.3.13")
testImplementation("io.ktor:ktor-client-mock:2.3.13")
implementation("io.ktor:ktor-client-core:3.0.3")
implementation("io.ktor:ktor-client-android:3.0.3")
testImplementation("io.ktor:ktor-client-mock:3.0.3")
// TODO: as soon as both ktor-client and kotlinx-serialization have been refactored to be based
// on kotlinx-io, revisit sending and receiving xml/json payloads via APIs, currently it
// is all String-based, i.e. no KMP equivalent of InputStream/OutputStream involved
Expand All @@ -202,11 +202,11 @@ dependencies {

// serialization
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3")
implementation("com.charleskorn.kaml:kaml:0.66.0")
implementation("io.github.pdvrieze.xmlutil:core:0.90.2")
implementation("com.charleskorn.kaml:kaml:0.67.0")
implementation("io.github.pdvrieze.xmlutil:core:0.90.3")

// map and location
implementation("org.maplibre.gl:android-sdk:11.6.1")
implementation("org.maplibre.gl:android-sdk:11.7.1")

// opening hours parser
implementation("de.westnordost:osm-opening-hours:0.1.0")
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@
<activity
android:name="de.westnordost.streetcomplete.screens.about.AboutActivity"
android:label="@string/action_about2"
android:parentActivityName="de.westnordost.streetcomplete.screens.MainActivity"
android:parentActivityName="de.westnordost.streetcomplete.screens.main.MainActivity"
android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
/>
<activity
android:name="de.westnordost.streetcomplete.screens.user.UserActivity"
android:label="@string/user_profile"
android:windowSoftInputMode="adjustResize"
android:parentActivityName="de.westnordost.streetcomplete.screens.MainActivity"
android:parentActivityName="de.westnordost.streetcomplete.screens.main.MainActivity"
android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
/>
<!-- For WorkManager -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ package de.westnordost.streetcomplete.screens.about

import android.content.Context
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.AppBarDefaults
import androidx.compose.material.IconButton
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
Expand Down Expand Up @@ -47,9 +53,15 @@ fun AboutScreen(
Column(Modifier.fillMaxSize()) {
TopAppBar(
title = { Text(stringResource(R.string.action_about2)) },
windowInsets = AppBarDefaults.topAppBarWindowInsets,
navigationIcon = { IconButton(onClick = onClickBack) { BackIcon() } },
)
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
Column(modifier = Modifier
.verticalScroll(rememberScrollState())
.windowInsetsPadding(WindowInsets.safeDrawing.only(
WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom
))
) {

PreferenceCategory(null) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@ package de.westnordost.streetcomplete.screens.about

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.AppBarDefaults
import androidx.compose.material.Divider
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
Expand All @@ -21,6 +28,7 @@ import androidx.compose.ui.unit.dp
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.ui.common.BackIcon
import de.westnordost.streetcomplete.ui.common.HtmlText
import de.westnordost.streetcomplete.ui.ktx.plus
import de.westnordost.streetcomplete.ui.theme.titleLarge
import de.westnordost.streetcomplete.util.html.HtmlNode

Expand All @@ -35,13 +43,18 @@ fun ChangelogScreen(
Column(Modifier.fillMaxSize()) {
TopAppBar(
title = { Text(stringResource(R.string.about_title_changelog)) },
windowInsets = AppBarDefaults.topAppBarWindowInsets,
navigationIcon = { IconButton(onClick = onClickBack) { BackIcon() } },
)
changelog?.let { changelog ->
SelectionContainer {
val insets = WindowInsets.safeDrawing.only(
WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom
).asPaddingValues()
ChangelogList(
changelog = changelog,
paddingValues = PaddingValues(16.dp)
paddingValues = insets + PaddingValues(16.dp),
modifier = Modifier.consumeWindowInsets(insets)
)
}
}
Expand All @@ -63,7 +76,10 @@ fun ChangelogList(
key = { index, _ -> index }
) { index, (version, html) ->
if (index > 0) Divider(modifier = Modifier.padding(vertical = 16.dp))
Text(text = version, style = MaterialTheme.typography.titleLarge)
Text(
text = version,
style = MaterialTheme.typography.titleLarge
)
HtmlText(
html = html,
style = MaterialTheme.typography.body2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@ package de.westnordost.streetcomplete.screens.about
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.width
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.AppBarDefaults
import androidx.compose.material.IconButton
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.MaterialTheme
Expand Down Expand Up @@ -42,6 +48,7 @@ fun CreditsScreen(
Column(Modifier.fillMaxSize()) {
TopAppBar(
title = { Text(stringResource(R.string.about_title_authors)) },
windowInsets = AppBarDefaults.topAppBarWindowInsets,
navigationIcon = { IconButton(onClick = onClickBack) { BackIcon() } },
)
credits?.let { credits ->
Expand All @@ -51,6 +58,9 @@ fun CreditsScreen(
modifier = Modifier
.fillMaxWidth()
.verticalScroll(rememberScrollState())
.windowInsetsPadding(WindowInsets.safeDrawing.only(
WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom
))
.padding(16.dp)
)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
package de.westnordost.streetcomplete.screens.about

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.AppBarDefaults
import androidx.compose.material.IconButton
import androidx.compose.material.MaterialTheme
import androidx.compose.material.Text
Expand All @@ -28,6 +34,7 @@ fun PrivacyStatementScreen(
Column(Modifier.fillMaxSize()) {
TopAppBar(
title = { Text(stringResource(R.string.about_title_privacy_statement)) },
windowInsets = AppBarDefaults.topAppBarWindowInsets,
navigationIcon = { IconButton(onClick = onClickBack) { BackIcon() } },
)
SelectionContainer {
Expand All @@ -40,6 +47,9 @@ fun PrivacyStatementScreen(
modifier = Modifier
.fillMaxWidth()
.verticalScroll(rememberScrollState())
.windowInsetsPadding(WindowInsets.safeDrawing.only(
WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom
))
.padding(16.dp),
style = MaterialTheme.typography.body2,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ import android.content.Intent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.WindowInsetsSides
import androidx.compose.foundation.layout.asPaddingValues
import androidx.compose.foundation.layout.consumeWindowInsets
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.only
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.AppBarDefaults
import androidx.compose.material.Divider
import androidx.compose.material.Icon
import androidx.compose.material.IconButton
Expand Down Expand Up @@ -61,6 +68,7 @@ fun LogsScreen(
Column(Modifier.fillMaxSize()) {
TopAppBar(
title = { Text(stringResource(R.string.about_title_logs, logs.size)) },
windowInsets = AppBarDefaults.topAppBarWindowInsets,
navigationIcon = { IconButton(onClick = onClickBack) { BackIcon() } },
actions = {
IconButton(onClick = { showFiltersDialog = true }) {
Expand All @@ -86,7 +94,14 @@ fun LogsScreen(
if (logs.isEmpty()) {
CenteredLargeTitleHint(stringResource(R.string.no_search_results))
} else {
LazyColumn(state = listState) {
val insets = WindowInsets.safeDrawing.only(
WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom
).asPaddingValues()
LazyColumn(
state = listState,
contentPadding = insets,
modifier = Modifier.consumeWindowInsets(insets)
) {
itemsIndexed(logs) { index, item ->
if (index > 0) Divider()
LogsRow(item, modifier = Modifier.padding(horizontal = 16.dp, vertical = 8.dp))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,7 @@ class MainActivity :
//region Lifecycle - Android Lifecycle Callbacks

override fun onCreate(savedInstanceState: Bundle?) {
val systemBarStyle = SystemBarStyle.dark(Color.argb(0x80, 0x1b, 0x1b, 0x1b))
enableEdgeToEdge(systemBarStyle, systemBarStyle)
enableEdgeToEdge()
super.onCreate(savedInstanceState)

LocalBroadcastManager.getInstance(this).registerReceiver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.systemBars
import androidx.compose.foundation.layout.safeDrawing
import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.material.ButtonDefaults
import androidx.compose.material.MaterialTheme
Expand Down Expand Up @@ -217,7 +217,7 @@ fun MainScreen(

Column(Modifier
.fillMaxSize()
.windowInsetsPadding(WindowInsets.systemBars)
.windowInsetsPadding(WindowInsets.safeDrawing)
.onGloballyPositioned { pointerPinRects["frame"] = it.boundsInRoot() }
) {
Box(Modifier
Expand Down Expand Up @@ -286,7 +286,8 @@ fun MainScreen(
.align(Alignment.BottomEnd)
.padding(4.dp)
.onGloballyPositioned { pointerPinRects["bottom-end"] = it.boundsInRoot() },
verticalArrangement = Arrangement.spacedBy(8.dp)
verticalArrangement = Arrangement.spacedBy(8.dp),
horizontalAlignment = Alignment.End,
) {
val isCompassVisible = abs(mapRotation) >= 1.0 || abs(mapTilt) >= 1.0
AnimatedVisibility(
Expand Down Expand Up @@ -323,6 +324,7 @@ fun MainScreen(
},
modifier = Modifier
.align(BiasAlignment(0.333f, 1f))
.onGloballyPositioned { pointerPinRects["create-node"] = it.boundsInRoot() }
.padding(4.dp),
colors = ButtonDefaults.buttonColors(
backgroundColor = MaterialTheme.colors.secondaryVariant,
Expand Down
Loading

0 comments on commit dfc39fb

Please sign in to comment.