Skip to content

Commit

Permalink
Merge branch 'master' into compose-about
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed May 23, 2024
2 parents 94923aa + 6896fef commit 643f06d
Show file tree
Hide file tree
Showing 17 changed files with 18 additions and 73 deletions.
7 changes: 2 additions & 5 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import java.util.Properties
plugins {
id("com.android.application")
kotlin("android")
kotlin("plugin.serialization") version "1.9.23"
kotlin("plugin.serialization") version "2.0.0"
kotlin("plugin.compose") version "2.0.0"
}

android {
Expand Down Expand Up @@ -69,10 +70,6 @@ android {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.12"
}

bundle {
language {
enableSplit = false // because language is selectable in-app
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ fun parseConfigUrl(
keyValue[0].lowercase() to keyValue[1]
}

val name = parameters[PARAM_NAME]?.let { it.decodeURLQueryComponent(plusIsSpace = true) }
val name = parameters[PARAM_NAME]?.decodeURLQueryComponent(plusIsSpace = true)

val questTypesString = parameters[PARAM_QUESTS] ?: return null
val questTypes = stringToQuestTypes(questTypesString, questTypeRegistry) ?: return null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class OAuthService(private val httpClient: HttpClient) {
* and required in the OAuth 2.1 draft
* https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1-09
*/
public val codeVerifier: String = createRandomAlphanumericString(128)
val codeVerifier: String = createRandomAlphanumericString(128)

/**
* Creates the URL to be opened in the browser or a web view in which the user agrees to
Expand Down Expand Up @@ -144,7 +144,7 @@ class OAuthService(private val httpClient: HttpClient) {
* the user did not accept the requested permissions
* @throws OAuthConnectionException if the server reply is malformed
*/
public fun extractAuthorizationCode(uri: String): String {
fun extractAuthorizationCode(uri: String): String {
val parameters = Url(uri).parameters
val authorizationCode = parameters["code"]
if (authorizationCode != null) return authorizationCode
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ data class LeftAndRightStreetParking(val left: StreetParking?, val right: Street

@Serializable sealed class StreetParking

@Serializable object NoStreetParking : StreetParking()
@Serializable data object NoStreetParking : StreetParking()
/** When an unknown/unsupported value has been used */
@Serializable object UnknownStreetParking : StreetParking()
@Serializable data object UnknownStreetParking : StreetParking()
/** When not both parking orientation and position have been specified*/
@Serializable object IncompleteStreetParking : StreetParking()
@Serializable data object IncompleteStreetParking : StreetParking()
/** There is street parking, but it is mapped as separate geometry */
@Serializable object StreetParkingSeparate : StreetParking()
@Serializable data object StreetParkingSeparate : StreetParking()

@Serializable data class StreetParkingPositionAndOrientation(
val orientation: ParkingOrientation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ class PlacesOverlayForm : AbstractOverlayForm() {
and if that feature doesn't already set a name (i.e. is a brand)
*/
val isNameInputInvisible = selectedFeature == null ||
selectedFeature.addTags?.get("name") != null ||
selectedFeature.addTags["name"] != null ||
selectedFeature.id == "shop/vacant"

binding.nameContainer.root.isGone = isNameInputInvisible
Expand Down Expand Up @@ -261,7 +261,7 @@ private suspend fun createEditAction(
val hasAddedNames = previousNames.isEmpty() && newNames.isNotEmpty()
val hasChangedNames = previousNames != newNames
val hasChangedFeature = newFeature != previousFeature
val isFeatureWithName = newFeature.addTags?.get("name") != null
val isFeatureWithName = newFeature.addTags.get("name") != null
val wasFeatureWithName = previousFeature?.addTags?.get("name") != null
val wasVacant = element != null && element.isDisusedPlace()
val isVacant = newFeature.id == "shop/vacant"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import de.westnordost.streetcomplete.view.image_select.ItemViewHolder

class AddSmoothnessForm : AImageListQuestForm<Smoothness, SmoothnessAnswer>() {

private val binding by contentViewBinding(QuestGenericListBinding::bind)

override val otherAnswers get() = listOfNotNull(
AnswerItem(R.string.quest_smoothness_wrong_surface) { surfaceWrong() },
createConvertToStepsAnswer(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun Smoothness.asItem(context: Context, surface: String): DisplayItem<Smoothness
}

/** return fitting vehicle type emoji that corresponds to the "usable by" column in the wiki */
val Smoothness.icon get(): @DrawableRes Int = when (this) {
val Smoothness.icon @DrawableRes get(): Int = when (this) {
EXCELLENT -> R.drawable.ic_smoothness_skateboard
GOOD -> R.drawable.ic_smoothness_scooter
INTERMEDIATE -> R.drawable.ic_smoothness_city_bike
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.FragmentManager.FragmentLifecycleCallbacks
import androidx.preference.PreferenceHeaderFragmentCompat
import de.westnordost.streetcomplete.R

/** A two pane preferences fragment that dispatches updates of its pane state to its children. */
abstract class TwoPaneHeaderFragment : PreferenceHeaderFragmentCompat() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import de.westnordost.streetcomplete.util.ktx.toast
import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope
import de.westnordost.streetcomplete.util.viewBinding
import de.westnordost.streetcomplete.view.insets_animation.respectSystemInsets
import kotlinx.coroutines.flow.firstOrNull
import kotlinx.coroutines.launch
import org.koin.androidx.viewmodel.ext.android.viewModel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,6 @@ val Context.hasLocationPermission: Boolean get() = hasPermission(ACCESS_FINE_LOC

private val Context.locationManager get() = getSystemService<LocationManager>()!!

/** Await a call from a broadcast once and return it */
suspend fun Context.awaitReceiverCall(intentFilter: IntentFilter): Intent =
suspendCancellableCoroutine { continuation ->
val receiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
unregisterReceiver(this)
continuation.resume(intent)
}
}
registerReceiver(receiver, intentFilter)
continuation.invokeOnCancellation { unregisterReceiver(receiver) }
}

fun Context.sendEmail(email: String, subject: String, text: String? = null) {
val intent = Intent(Intent.ACTION_SENDTO).apply {
data = "mailto:".toUri()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@file:Suppress("NOTHING_TO_INLINE")

package de.westnordost.streetcomplete.util.ktx

import kotlinx.datetime.Clock
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/main/res/layout/labeled_icon_button_cell.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
android:scaleType="fitCenter"
android:adjustViewBounds="true"
android:background="#3666"
tools:src="@drawable/ic_cycleway_lane"/>
tools:src="@drawable/ic_cycleway_lane_white"/>

<TextView
android:id="@+id/textView"
Expand Down
6 changes: 0 additions & 6 deletions app/src/main/res/values-w720dp/dimens.xml

This file was deleted.

4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ buildscript {
mavenCentral()
}
dependencies {
val kotlinVersion = "1.9.23"
classpath("com.android.tools.build:gradle:8.3.2")
val kotlinVersion = "2.0.0"
classpath("com.android.tools.build:gradle:8.4.1")
classpath(kotlin("gradle-plugin", version = kotlinVersion))
}
}
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ dependencies {
implementation("de.westnordost:countryboundaries:2.1")
implementation("com.esotericsoftware.yamlbeans:yamlbeans:1.15")
implementation("org.jsoup:jsoup:1.15.3")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.2")
implementation("com.charleskorn.kaml:kaml:0.58.0")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation("com.charleskorn.kaml:kaml:0.59.0")
implementation("org.jetbrains:markdown:0.7.0")
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME

0 comments on commit 643f06d

Please sign in to comment.