Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Mar 27, 2024
1 parent 5b9423b commit da269bc
Show file tree
Hide file tree
Showing 45 changed files with 58 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import androidx.appcompat.app.AppCompatDelegate
import androidx.work.ExistingPeriodicWorkPolicy
import androidx.work.PeriodicWorkRequest
import androidx.work.WorkManager
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.data.CacheTrimmer
import de.westnordost.streetcomplete.data.CleanerWorker
import de.westnordost.streetcomplete.data.Preloader
Expand Down Expand Up @@ -56,7 +57,6 @@ import de.westnordost.streetcomplete.util.ktx.nowAsEpochMilliseconds
import de.westnordost.streetcomplete.util.logs.AndroidLogger
import de.westnordost.streetcomplete.util.logs.DatabaseLogger
import de.westnordost.streetcomplete.util.logs.Log
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.util.prefs.preferencesModule
import de.westnordost.streetcomplete.util.setDefaultLocales
import kotlinx.coroutines.CoroutineName
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package de.westnordost.streetcomplete.data.logs

import de.westnordost.streetcomplete.util.Listeners
import de.westnordost.streetcomplete.util.logs.Log

class LogsController(private val logsDao: LogsDao) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.westnordost.streetcomplete.data.maptiles

import android.content.Context
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.ApplicationConstants.DEFAULT_MAP_CACHE_SIZE_IN_MB
import de.westnordost.streetcomplete.ApplicationConstants.DELETE_OLD_DATA_AFTER
import de.westnordost.streetcomplete.Prefs
import com.russhwolf.settings.ObservableSettings
import okhttp3.Cache
import okhttp3.CacheControl
import java.io.File
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package de.westnordost.streetcomplete.data.messages

import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.BuildConfig
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.data.user.UserDataController
import de.westnordost.streetcomplete.data.user.UserDataSource
import de.westnordost.streetcomplete.data.user.achievements.Achievement
import de.westnordost.streetcomplete.data.user.achievements.AchievementsSource
import de.westnordost.streetcomplete.util.Listeners
import com.russhwolf.settings.ObservableSettings

/** This class is to access user messages, which are basically dialogs that pop up when
* clicking on the mail icon, such as "you have a new OSM message in your inbox" etc. */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.westnordost.streetcomplete.data.messages

import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.ApplicationConstants.QUEST_COUNT_AT_WHICH_TO_SHOW_QUEST_SELECTION_HINT
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.data.messages.QuestSelectionHintState.NOT_SHOWN
Expand All @@ -8,7 +9,6 @@ import de.westnordost.streetcomplete.data.quest.Quest
import de.westnordost.streetcomplete.data.quest.QuestKey
import de.westnordost.streetcomplete.data.quest.VisibleQuestsSource
import de.westnordost.streetcomplete.util.Listeners
import com.russhwolf.settings.ObservableSettings

class QuestSelectionHintController(
private val visibleQuestsSource: VisibleQuestsSource,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package de.westnordost.streetcomplete.data.osm.edits.upload

import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.util.ktx.nowAsEpochMilliseconds
import com.russhwolf.settings.ObservableSettings

class LastEditTimeStore(private val prefs: ObservableSettings) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import android.net.ConnectivityManager
import androidx.core.content.getSystemService
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.ApplicationConstants
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.data.UnsyncedChangesCountSource
Expand All @@ -25,7 +26,6 @@ import de.westnordost.streetcomplete.util.ktx.format
import de.westnordost.streetcomplete.util.ktx.toLatLon
import de.westnordost.streetcomplete.util.location.FineLocationManager
import de.westnordost.streetcomplete.util.logs.Log
import com.russhwolf.settings.ObservableSettings
import kotlinx.coroutines.CoroutineName
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package de.westnordost.streetcomplete.data.user

import com.russhwolf.settings.ObservableSettings
import de.westnordost.osmapi.user.UserDetails
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.util.Listeners
import com.russhwolf.settings.ObservableSettings

/** Controller that handles user login, logout, auth and updated data */
class UserDataController(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package de.westnordost.streetcomplete.data.user

import com.russhwolf.settings.ObservableSettings
import de.westnordost.osmapi.OsmConnection
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.util.Listeners
import com.russhwolf.settings.ObservableSettings

class UserLoginStatusController(
private val osmConnection: OsmConnection,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package de.westnordost.streetcomplete.data.user.statistics

import com.russhwolf.settings.ObservableSettings
import de.westnordost.countryboundaries.CountryBoundaries
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.data.osm.mapdata.LatLon
Expand All @@ -10,7 +11,6 @@ import de.westnordost.streetcomplete.util.ktx.nowAsEpochMilliseconds
import de.westnordost.streetcomplete.util.ktx.systemTimeNow
import de.westnordost.streetcomplete.util.ktx.toLocalDate
import de.westnordost.streetcomplete.util.logs.Log
import com.russhwolf.settings.ObservableSettings
import kotlinx.datetime.Instant
import kotlinx.datetime.LocalDate

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.westnordost.streetcomplete.data.visiblequests

import de.westnordost.streetcomplete.Prefs
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.Prefs

class SelectedQuestPresetStore(private val prefs: ObservableSettings) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package de.westnordost.streetcomplete.data.visiblequests

import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.data.osm.created_elements.CreatedElementsSource
import de.westnordost.streetcomplete.data.osm.osmquests.OsmQuest
import de.westnordost.streetcomplete.data.osmnotes.notequests.OsmNoteQuest
import de.westnordost.streetcomplete.data.quest.Quest
import de.westnordost.streetcomplete.util.Listeners
import com.russhwolf.settings.ObservableSettings

/** Controller for filtering all quests that are hidden because they are shown to other users in
* team mode. Takes care of persisting team mode settings and notifying listeners about changes */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package de.westnordost.streetcomplete.overlays

import android.os.Bundle
import android.view.View
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementPolylinesGeometry
import de.westnordost.streetcomplete.databinding.FragmentOverlayStreetSidePuzzleWithLastAnswerButtonBinding
import de.westnordost.streetcomplete.util.math.getOrientationAtCenterLineInDegrees
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.ResImage
import de.westnordost.streetcomplete.view.controller.StreetSideDisplayItem
import de.westnordost.streetcomplete.view.controller.StreetSideSelectWithLastAnswerButtonViewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package de.westnordost.streetcomplete.overlays.buildings
import android.content.Context
import android.os.Bundle
import android.view.View
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder
import de.westnordost.streetcomplete.data.osm.edits.update_tags.UpdateElementTagsAction
import de.westnordost.streetcomplete.osm.building.BuildingType
Expand All @@ -16,7 +17,6 @@ import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.getNameAndLocationLabel
import de.westnordost.streetcomplete.util.mostCommonWithin
import de.westnordost.streetcomplete.util.padWith
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.image_select.GroupableDisplayItem
import org.koin.android.ext.android.inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package de.westnordost.streetcomplete.overlays.cycleway
import android.content.Context
import android.os.Bundle
import android.view.View
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder
import de.westnordost.streetcomplete.data.osm.edits.update_tags.UpdateElementTagsAction
Expand All @@ -13,7 +14,6 @@ import de.westnordost.streetcomplete.osm.cycleway_separate.asItem
import de.westnordost.streetcomplete.osm.cycleway_separate.parseSeparateCycleway
import de.westnordost.streetcomplete.overlays.AImageSelectOverlayForm
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.image_select.DisplayItem
import org.koin.android.ext.android.inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AlertDialog
import androidx.core.view.isGone
import com.russhwolf.settings.ObservableSettings
import de.westnordost.osmfeatures.Feature
import de.westnordost.osmfeatures.GeometryType
import de.westnordost.streetcomplete.Prefs.PREFERRED_LANGUAGE_FOR_NAMES
Expand Down Expand Up @@ -33,7 +34,6 @@ import de.westnordost.streetcomplete.util.getLocalesForFeatureDictionary
import de.westnordost.streetcomplete.util.getLocationLabel
import de.westnordost.streetcomplete.util.ktx.geometryType
import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.AdapterDataChangedWatcher
import de.westnordost.streetcomplete.view.controller.FeatureViewController
import de.westnordost.streetcomplete.view.dialogs.SearchFeaturesDialog
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import android.content.Context
import android.os.Bundle
import android.view.View
import androidx.core.view.isGone
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.elementfilter.toElementFilterExpression
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder
Expand All @@ -27,7 +28,6 @@ import de.westnordost.streetcomplete.overlays.IAnswerItem
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.getLocalesForFeatureDictionary
import de.westnordost.streetcomplete.util.ktx.couldBeSteps
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.setImage
import org.koin.android.ext.android.inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package de.westnordost.streetcomplete.overlays.way_lit
import android.content.Context
import android.os.Bundle
import android.view.View
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.edits.update_tags.StringMapChangesBuilder
import de.westnordost.streetcomplete.data.osm.edits.update_tags.UpdateElementTagsAction
Expand All @@ -20,7 +21,6 @@ import de.westnordost.streetcomplete.overlays.AImageSelectOverlayForm
import de.westnordost.streetcomplete.overlays.AnswerItem
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.ktx.couldBeSteps
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.image_select.DisplayItem
import org.koin.android.ext.android.inject

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import android.view.View
import androidx.appcompat.app.AlertDialog
import androidx.core.text.parseAsHtml
import androidx.recyclerview.widget.RecyclerView
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.meta.AbbreviationsByLocale
import de.westnordost.streetcomplete.osm.LocalizedName
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.AdapterDataChangedWatcher
import kotlinx.serialization.encodeToString
import kotlinx.serialization.json.Json
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import androidx.appcompat.app.AlertDialog
import androidx.core.view.postDelayed
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.databinding.QuestGenericListBinding
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.mostCommonWithin
import de.westnordost.streetcomplete.util.padWith
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.image_select.GroupableDisplayItem
import de.westnordost.streetcomplete.view.image_select.GroupedImageSelectAdapter
import org.koin.android.ext.android.inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import android.os.Bundle
import android.view.View
import androidx.core.view.isGone
import androidx.recyclerview.widget.GridLayoutManager
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.databinding.QuestGenericListBinding
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.padWith
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.image_select.DisplayItem
import de.westnordost.streetcomplete.view.image_select.ImageSelectAdapter
import org.koin.android.ext.android.inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package de.westnordost.streetcomplete.quests

import android.os.Bundle
import android.view.View
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.osm.geometry.ElementPolylinesGeometry
import de.westnordost.streetcomplete.databinding.QuestStreetSidePuzzleWithLastAnswerButtonBinding
import de.westnordost.streetcomplete.util.math.getOrientationAtCenterLineInDegrees
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.ResImage
import de.westnordost.streetcomplete.view.controller.StreetSideDisplayItem
import de.westnordost.streetcomplete.view.controller.StreetSideSelectWithLastAnswerButtonViewController
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import android.view.ViewGroup
import androidx.appcompat.app.AlertDialog
import androidx.core.widget.doAfterTextChanged
import androidx.recyclerview.widget.RecyclerView
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.databinding.QuestBuildingLevelsBinding
import de.westnordost.streetcomplete.databinding.QuestBuildingLevelsLastPickedButtonBinding
Expand All @@ -16,7 +17,6 @@ import de.westnordost.streetcomplete.quests.AnswerItem
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.ktx.intOrNull
import de.westnordost.streetcomplete.util.mostCommonWithin
import com.russhwolf.settings.ObservableSettings
import org.koin.android.ext.android.inject

class AddBuildingLevelsForm : AbstractOsmQuestForm<BuildingLevelsAnswer>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import androidx.appcompat.app.AlertDialog
import androidx.appcompat.widget.PopupMenu
import androidx.core.view.isGone
import androidx.core.widget.doAfterTextChanged
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.quests.AbstractOsmQuestForm
import de.westnordost.streetcomplete.quests.AnswerItem
Expand All @@ -16,7 +17,6 @@ import de.westnordost.streetcomplete.quests.fire_hydrant_diameter.FireHydrantDia
import de.westnordost.streetcomplete.util.LastPickedValuesStore
import de.westnordost.streetcomplete.util.ktx.intOrNull
import de.westnordost.streetcomplete.util.mostCommonWithin
import com.russhwolf.settings.ObservableSettings
import org.koin.android.ext.android.inject

class AddFireHydrantDiameterForm : AbstractOsmQuestForm<FireHydrantDiameterAnswer>() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import android.content.res.Configuration
import androidx.annotation.LayoutRes
import androidx.appcompat.app.AppCompatActivity
import androidx.core.app.ActivityCompat
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.util.getSelectedLocale
import de.westnordost.streetcomplete.util.getSystemLocales
import de.westnordost.streetcomplete.util.ktx.addedToFront
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.util.setDefaultLocales
import de.westnordost.streetcomplete.util.setLocales
import org.koin.android.ext.android.inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import androidx.fragment.app.commit
import androidx.lifecycle.lifecycleScope
import androidx.localbroadcastmanager.content.LocalBroadcastManager
import androidx.preference.PreferenceManager
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.R
import de.westnordost.streetcomplete.data.UnsyncedChangesCountSource
Expand Down Expand Up @@ -56,7 +57,6 @@ import de.westnordost.streetcomplete.util.ktx.toast
import de.westnordost.streetcomplete.util.location.LocationAvailabilityReceiver
import de.westnordost.streetcomplete.util.location.LocationRequestFragment
import de.westnordost.streetcomplete.util.parseGeoUri
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.view.dialogs.RequestLoginDialog
import kotlinx.coroutines.launch
import org.koin.android.ext.android.inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import androidx.core.view.isVisible
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.fragment.app.commit
import com.russhwolf.settings.ObservableSettings
import de.westnordost.osmfeatures.FeatureDictionary
import de.westnordost.streetcomplete.ApplicationConstants
import de.westnordost.streetcomplete.Prefs
Expand Down Expand Up @@ -112,7 +113,6 @@ import de.westnordost.streetcomplete.util.math.area
import de.westnordost.streetcomplete.util.math.enclosingBoundingBox
import de.westnordost.streetcomplete.util.math.enlargedBy
import de.westnordost.streetcomplete.util.math.initialBearingTo
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.util.viewBinding
import de.westnordost.streetcomplete.view.insets_animation.respectSystemInsets
import kotlinx.coroutines.Dispatchers
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package de.westnordost.streetcomplete.screens.main.controls
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import com.russhwolf.settings.ObservableSettings
import de.westnordost.streetcomplete.ApplicationConstants
import de.westnordost.streetcomplete.Prefs
import de.westnordost.streetcomplete.R
Expand All @@ -11,7 +12,6 @@ import de.westnordost.streetcomplete.data.download.DownloadProgressSource
import de.westnordost.streetcomplete.data.upload.UploadProgressSource
import de.westnordost.streetcomplete.data.user.statistics.StatisticsSource
import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope
import com.russhwolf.settings.ObservableSettings
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext
Expand Down
Loading

0 comments on commit da269bc

Please sign in to comment.