Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed May 23, 2024
1 parent 31ddb86 commit 6896fef
Show file tree
Hide file tree
Showing 12 changed files with 10 additions and 62 deletions.
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 @@ -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.

0 comments on commit 6896fef

Please sign in to comment.