From da269bcbd92ad8082265caaf9288378e22077def Mon Sep 17 00:00:00 2001 From: Flo Edelmann Date: Wed, 27 Mar 2024 15:16:40 +0100 Subject: [PATCH] Lint --- .../streetcomplete/StreetCompleteApplication.kt | 2 +- .../streetcomplete/data/logs/LogsController.kt | 1 - .../data/maptiles/MapTilesDownloadCacheConfig.kt | 2 +- .../data/messages/MessagesSource.kt | 2 +- .../messages/QuestSelectionHintController.kt | 2 +- .../data/osm/edits/upload/LastEditTimeStore.kt | 2 +- .../streetcomplete/data/quest/QuestAutoSyncer.kt | 2 +- .../data/user/UserDataController.kt | 2 +- .../data/user/UserLoginStatusController.kt | 2 +- .../data/user/statistics/StatisticsController.kt | 2 +- .../visiblequests/SelectedQuestPresetStore.kt | 2 +- .../data/visiblequests/TeamModeQuestFilter.kt | 2 +- .../overlays/AStreetSideSelectOverlayForm.kt | 2 +- .../overlays/buildings/BuildingsOverlayForm.kt | 2 +- .../overlays/cycleway/SeparateCyclewayForm.kt | 2 +- .../overlays/places/PlacesOverlayForm.kt | 2 +- .../overlays/surface/SurfaceOverlayForm.kt | 2 +- .../overlays/way_lit/WayLitOverlayForm.kt | 2 +- .../quests/AAddLocalizedNameForm.kt | 2 +- .../quests/AGroupedImageListQuestForm.kt | 2 +- .../streetcomplete/quests/AImageListQuestForm.kt | 2 +- .../quests/AStreetSideSelectForm.kt | 2 +- .../building_levels/AddBuildingLevelsForm.kt | 2 +- .../AddFireHydrantDiameterForm.kt | 2 +- .../streetcomplete/screens/BaseActivity.kt | 2 +- .../streetcomplete/screens/MainActivity.kt | 2 +- .../streetcomplete/screens/main/MainFragment.kt | 2 +- .../main/controls/AnswersCounterFragment.kt | 2 +- .../main/controls/OverlaysButtonFragment.kt | 2 +- .../main/controls/UploadButtonFragment.kt | 2 +- .../screens/main/map/LocationAwareMapFragment.kt | 2 +- .../screens/main/map/MapFragment.kt | 2 +- .../screens/main/map/TangramIconsSpriteSheet.kt | 2 +- .../screens/main/map/TangramPinsSpriteSheet.kt | 2 +- .../screens/settings/ResurveyIntervalsUpdater.kt | 2 +- .../screens/settings/SettingsFragment.kt | 2 +- .../screens/settings/SettingsModule.kt | 1 - .../screens/settings/SettingsViewModel.kt | 12 ++++++------ .../settings/debug/ShowQuestFormsActivity.kt | 2 +- .../questselection/QuestSelectionAdapter.kt | 2 +- .../questselection/QuestSelectionFragment.kt | 2 +- .../screens/user/profile/ProfileViewModel.kt | 2 +- .../streetcomplete/util/LocaleListCompatUtils.kt | 2 +- ...deSelectWithLastAnswerButtonViewController.kt | 16 +++++++++++----- .../user/statistics/StatisticsControllerTest.kt | 2 +- 45 files changed, 58 insertions(+), 54 deletions(-) diff --git a/app/src/main/java/de/westnordost/streetcomplete/StreetCompleteApplication.kt b/app/src/main/java/de/westnordost/streetcomplete/StreetCompleteApplication.kt index f85cdcb242..dc4d77aad7 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/StreetCompleteApplication.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/StreetCompleteApplication.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/logs/LogsController.kt b/app/src/main/java/de/westnordost/streetcomplete/data/logs/LogsController.kt index 943a7a6415..bc78ee7009 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/logs/LogsController.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/logs/LogsController.kt @@ -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) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt b/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt index f6324528cf..34028c517c 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/maptiles/MapTilesDownloadCacheConfig.kt @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt b/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt index 6e9ca7114b..6966c817c2 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/messages/MessagesSource.kt @@ -1,5 +1,6 @@ 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 @@ -7,7 +8,6 @@ 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. */ diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/messages/QuestSelectionHintController.kt b/app/src/main/java/de/westnordost/streetcomplete/data/messages/QuestSelectionHintController.kt index d7e6ee5e7a..3a751ec3ee 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/messages/QuestSelectionHintController.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/messages/QuestSelectionHintController.kt @@ -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 @@ -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, diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/osm/edits/upload/LastEditTimeStore.kt b/app/src/main/java/de/westnordost/streetcomplete/data/osm/edits/upload/LastEditTimeStore.kt index 4f91672027..c987f4d042 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/osm/edits/upload/LastEditTimeStore.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/osm/edits/upload/LastEditTimeStore.kt @@ -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) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestAutoSyncer.kt b/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestAutoSyncer.kt index 38ab8321d7..5933d5f84e 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestAutoSyncer.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/quest/QuestAutoSyncer.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/user/UserDataController.kt b/app/src/main/java/de/westnordost/streetcomplete/data/user/UserDataController.kt index 0a2eafa45f..a36a32d8d2 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/user/UserDataController.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/user/UserDataController.kt @@ -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( diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/user/UserLoginStatusController.kt b/app/src/main/java/de/westnordost/streetcomplete/data/user/UserLoginStatusController.kt index eb23dbb248..9d1e8f15c8 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/user/UserLoginStatusController.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/user/UserLoginStatusController.kt @@ -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, diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsController.kt b/app/src/main/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsController.kt index 452a216ed9..1879d95048 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsController.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsController.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/SelectedQuestPresetStore.kt b/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/SelectedQuestPresetStore.kt index 04810e400c..23b806c346 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/SelectedQuestPresetStore.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/SelectedQuestPresetStore.kt @@ -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) { diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/TeamModeQuestFilter.kt b/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/TeamModeQuestFilter.kt index 421c15770c..8fed9add35 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/TeamModeQuestFilter.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/visiblequests/TeamModeQuestFilter.kt @@ -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 */ diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/AStreetSideSelectOverlayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/AStreetSideSelectOverlayForm.kt index 68c4f4e285..db6af3df64 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/AStreetSideSelectOverlayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/AStreetSideSelectOverlayForm.kt @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/buildings/BuildingsOverlayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/buildings/BuildingsOverlayForm.kt index 5d22ab84a5..2f4db7339b 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/buildings/BuildingsOverlayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/buildings/BuildingsOverlayForm.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/cycleway/SeparateCyclewayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/cycleway/SeparateCyclewayForm.kt index 215d4acfea..9d33c94636 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/cycleway/SeparateCyclewayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/cycleway/SeparateCyclewayForm.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/places/PlacesOverlayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/places/PlacesOverlayForm.kt index 03d2424f33..7e63339843 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/places/PlacesOverlayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/places/PlacesOverlayForm.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/surface/SurfaceOverlayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/surface/SurfaceOverlayForm.kt index 74009616dc..54777eeb66 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/surface/SurfaceOverlayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/surface/SurfaceOverlayForm.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/way_lit/WayLitOverlayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/way_lit/WayLitOverlayForm.kt index 3e22eb73d5..0a8bf09375 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/way_lit/WayLitOverlayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/way_lit/WayLitOverlayForm.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/AAddLocalizedNameForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/AAddLocalizedNameForm.kt index 08e3119124..8a993c504e 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AAddLocalizedNameForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AAddLocalizedNameForm.kt @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/AGroupedImageListQuestForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/AGroupedImageListQuestForm.kt index 42efc299d9..1204538c47 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AGroupedImageListQuestForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AGroupedImageListQuestForm.kt @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/AImageListQuestForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/AImageListQuestForm.kt index 2bf082b2a9..0117351c7d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AImageListQuestForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AImageListQuestForm.kt @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/AStreetSideSelectForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/AStreetSideSelectForm.kt index b02b256232..468ed483ed 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AStreetSideSelectForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AStreetSideSelectForm.kt @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsForm.kt index c9e94c2cfb..f78a9b5b8c 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/building_levels/AddBuildingLevelsForm.kt @@ -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 @@ -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() { diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/fire_hydrant_diameter/AddFireHydrantDiameterForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/fire_hydrant_diameter/AddFireHydrantDiameterForm.kt index 3605ce03d7..5d6ccd94ba 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/fire_hydrant_diameter/AddFireHydrantDiameterForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/fire_hydrant_diameter/AddFireHydrantDiameterForm.kt @@ -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 @@ -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() { diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/BaseActivity.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/BaseActivity.kt index 3e85b6384f..1f19e52aff 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/BaseActivity.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/BaseActivity.kt @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/MainActivity.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/MainActivity.kt index abc439a4df..1a7b71a1ca 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/MainActivity.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/MainActivity.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainFragment.kt index f0acb66643..7f55a187b9 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/MainFragment.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/AnswersCounterFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/AnswersCounterFragment.kt index 9a026da70f..a3dcc3de59 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/AnswersCounterFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/AnswersCounterFragment.kt @@ -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 @@ -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 diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/OverlaysButtonFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/OverlaysButtonFragment.kt index de32543e19..2acf93b3a5 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/OverlaysButtonFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/OverlaysButtonFragment.kt @@ -5,6 +5,7 @@ import android.view.View import android.widget.ImageView import androidx.appcompat.widget.ListPopupWindow import androidx.fragment.app.Fragment +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.data.overlays.OverlayRegistry @@ -13,7 +14,6 @@ import de.westnordost.streetcomplete.data.overlays.SelectedOverlaySource import de.westnordost.streetcomplete.screens.main.overlays.OverlaySelectionAdapter import de.westnordost.streetcomplete.util.ktx.dpToPx import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope -import com.russhwolf.settings.ObservableSettings import kotlinx.coroutines.launch import org.koin.android.ext.android.inject diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UploadButtonFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UploadButtonFragment.kt index 97109f92de..77cc3d48e7 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UploadButtonFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/controls/UploadButtonFragment.kt @@ -6,6 +6,7 @@ import android.view.View import androidx.core.content.getSystemService import androidx.core.view.isGone 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 @@ -15,7 +16,6 @@ import de.westnordost.streetcomplete.data.upload.UploadProgressSource import de.westnordost.streetcomplete.data.user.UserLoginStatusSource import de.westnordost.streetcomplete.util.ktx.toast import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope -import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.view.dialogs.RequestLoginDialog import kotlinx.coroutines.launch import org.koin.android.ext.android.inject diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/LocationAwareMapFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/LocationAwareMapFragment.kt index fb04299af8..0592dc3fea 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/LocationAwareMapFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/LocationAwareMapFragment.kt @@ -7,6 +7,7 @@ import android.location.Location import android.os.Bundle import android.view.WindowManager import androidx.core.content.getSystemService +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.data.location.RecentLocationStore import de.westnordost.streetcomplete.data.osm.mapdata.LatLon @@ -21,7 +22,6 @@ import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope import de.westnordost.streetcomplete.util.location.FineLocationManager import de.westnordost.streetcomplete.util.location.LocationAvailabilityReceiver import de.westnordost.streetcomplete.util.math.translate -import com.russhwolf.settings.ObservableSettings import kotlinx.coroutines.delay import kotlinx.coroutines.launch import kotlinx.serialization.encodeToString diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MapFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MapFragment.kt index 719dea9e04..c1154c40a3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MapFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MapFragment.kt @@ -20,6 +20,7 @@ import com.mapzen.tangram.TouchInput.ShoveResponder import com.mapzen.tangram.TouchInput.TapResponder import com.mapzen.tangram.networking.DefaultHttpHandler import com.mapzen.tangram.networking.HttpHandler +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.ApplicationConstants import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.R @@ -38,7 +39,6 @@ import de.westnordost.streetcomplete.util.ktx.openUri import de.westnordost.streetcomplete.util.ktx.setMargins import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope import de.westnordost.streetcomplete.util.math.distanceTo -import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.util.viewBinding import de.westnordost.streetcomplete.view.insets_animation.respectSystemInsets import kotlinx.coroutines.delay diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramIconsSpriteSheet.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramIconsSpriteSheet.kt index 15f354e0a1..683863b06f 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramIconsSpriteSheet.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramIconsSpriteSheet.kt @@ -4,11 +4,11 @@ import android.content.Context import android.graphics.Bitmap import android.graphics.Canvas import android.graphics.Color +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.BuildConfig import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.util.ktx.createBitmapWithWhiteBorder import de.westnordost.streetcomplete.util.ktx.dpToPx -import com.russhwolf.settings.ObservableSettings import kotlin.math.ceil import kotlin.math.max import kotlin.math.sqrt diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramPinsSpriteSheet.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramPinsSpriteSheet.kt index cc3b9e47e0..b70ab0f143 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramPinsSpriteSheet.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/TangramPinsSpriteSheet.kt @@ -3,13 +3,13 @@ package de.westnordost.streetcomplete.screens.main.map import android.content.Context import android.graphics.Bitmap import android.graphics.Canvas +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.BuildConfig import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.data.overlays.OverlayRegistry import de.westnordost.streetcomplete.data.quest.QuestTypeRegistry import de.westnordost.streetcomplete.util.ktx.isApril1st -import com.russhwolf.settings.ObservableSettings import kotlin.math.ceil import kotlin.math.sqrt diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/ResurveyIntervalsUpdater.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/ResurveyIntervalsUpdater.kt index 6c370b56a8..eccac96674 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/ResurveyIntervalsUpdater.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/ResurveyIntervalsUpdater.kt @@ -1,5 +1,6 @@ package de.westnordost.streetcomplete.screens.settings +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.ApplicationConstants import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.Prefs.ResurveyIntervals.DEFAULT @@ -7,7 +8,6 @@ import de.westnordost.streetcomplete.Prefs.ResurveyIntervals.LESS_OFTEN import de.westnordost.streetcomplete.Prefs.ResurveyIntervals.MORE_OFTEN import de.westnordost.streetcomplete.Prefs.ResurveyIntervals.valueOf import de.westnordost.streetcomplete.data.elementfilter.filters.RelativeDate -import com.russhwolf.settings.ObservableSettings /** This class is just to access the user's preference about which multiplier for the resurvey * intervals to use */ diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsFragment.kt index 448b8c0fcf..36a7f83a53 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsFragment.kt @@ -24,8 +24,8 @@ import de.westnordost.streetcomplete.screens.settings.debug.ShowQuestFormsActivi import de.westnordost.streetcomplete.util.ktx.format import de.westnordost.streetcomplete.util.ktx.observe import de.westnordost.streetcomplete.util.ktx.setUpToolbarTitleAndIcon -import java.util.Locale import org.koin.androidx.viewmodel.ext.android.viewModel +import java.util.Locale /** Shows the settings lists */ class SettingsFragment : TwoPaneListFragment(), HasTitle { diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsModule.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsModule.kt index bbb5f714fa..ab45c5f110 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsModule.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsModule.kt @@ -1,7 +1,6 @@ package de.westnordost.streetcomplete.screens.settings import org.koin.androidx.viewmodel.dsl.viewModel -import org.koin.androidx.viewmodel.dsl.viewModelOf import org.koin.dsl.module val settingsModule = module { diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsViewModel.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsViewModel.kt index f2e0e8ae4f..16e164c1ef 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsViewModel.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/SettingsViewModel.kt @@ -3,6 +3,8 @@ package de.westnordost.streetcomplete.screens.settings import android.content.res.Resources import androidx.appcompat.app.AppCompatDelegate import androidx.lifecycle.ViewModel +import com.russhwolf.settings.ObservableSettings +import com.russhwolf.settings.SettingsListener import de.westnordost.streetcomplete.ApplicationConstants import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.R @@ -22,8 +24,6 @@ import de.westnordost.streetcomplete.util.getDefaultTheme import de.westnordost.streetcomplete.util.getSelectedLocales import de.westnordost.streetcomplete.util.ktx.getYamlObject import de.westnordost.streetcomplete.util.ktx.launch -import com.russhwolf.settings.ObservableSettings -import com.russhwolf.settings.SettingsListener import de.westnordost.streetcomplete.util.setDefaultLocales import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.flow.MutableStateFlow @@ -41,10 +41,10 @@ abstract class SettingsViewModel : ViewModel() { abstract fun deleteCache() /* this direct access should be removed in the mid-term. However, since the - * PreferenceFragmentCompat already implicitly accesses the shared preferences to display the - * current choice, the ViewModel needs to be adapted anyway later when the view does not - * inherit from that construct anymore and include many more StateFlows based off the - * Preferences displayed here - */ + * PreferenceFragmentCompat already implicitly accesses the shared preferences to display the + * current choice, the ViewModel needs to be adapted anyway later when the view does not + * inherit from that construct anymore and include many more StateFlows based off the + * Preferences displayed here - */ abstract val prefs: ObservableSettings } diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/debug/ShowQuestFormsActivity.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/debug/ShowQuestFormsActivity.kt index c971c964f3..db659ef231 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/debug/ShowQuestFormsActivity.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/debug/ShowQuestFormsActivity.kt @@ -14,6 +14,7 @@ import androidx.core.view.isGone import androidx.fragment.app.commit import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.data.osm.edits.AddElementEditsController @@ -41,7 +42,6 @@ import de.westnordost.streetcomplete.screens.BaseActivity import de.westnordost.streetcomplete.screens.settings.genericQuestTitle import de.westnordost.streetcomplete.util.ktx.containsAll import de.westnordost.streetcomplete.util.math.translate -import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.util.viewBinding import de.westnordost.streetcomplete.view.ListAdapter import org.koin.android.ext.android.inject diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt index f2b79181f1..5e9b9005c7 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionAdapter.kt @@ -20,6 +20,7 @@ import androidx.recyclerview.widget.ItemTouchHelper.DOWN import androidx.recyclerview.widget.ItemTouchHelper.UP import androidx.recyclerview.widget.ListAdapter import androidx.recyclerview.widget.RecyclerView +import com.russhwolf.settings.ObservableSettings import de.westnordost.countryboundaries.CountryBoundaries import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.R @@ -37,7 +38,6 @@ import de.westnordost.streetcomplete.databinding.RowQuestSelectionBinding import de.westnordost.streetcomplete.screens.settings.genericQuestTitle import de.westnordost.streetcomplete.util.ktx.containsAll import de.westnordost.streetcomplete.util.ktx.containsAny -import com.russhwolf.settings.ObservableSettings import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.SupervisorJob diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionFragment.kt index d460662d77..90b2fe4782 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/settings/questselection/QuestSelectionFragment.kt @@ -10,6 +10,7 @@ import androidx.core.view.isInvisible import androidx.recyclerview.widget.DividerItemDecoration import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView +import com.russhwolf.settings.ObservableSettings import de.westnordost.countryboundaries.CountryBoundaries import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.data.quest.QuestTypeRegistry @@ -20,7 +21,6 @@ import de.westnordost.streetcomplete.databinding.FragmentQuestSelectionBinding import de.westnordost.streetcomplete.screens.HasTitle import de.westnordost.streetcomplete.screens.TwoPaneDetailFragment import de.westnordost.streetcomplete.util.ktx.viewLifecycleScope -import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.util.viewBinding import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/user/profile/ProfileViewModel.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/user/profile/ProfileViewModel.kt index 54bee76cd5..955c837bf2 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/user/profile/ProfileViewModel.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/user/profile/ProfileViewModel.kt @@ -1,6 +1,7 @@ package de.westnordost.streetcomplete.screens.user.profile import androidx.lifecycle.ViewModel +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.data.UnsyncedChangesCountSource import de.westnordost.streetcomplete.data.user.UserDataSource @@ -11,7 +12,6 @@ import de.westnordost.streetcomplete.data.user.achievements.AchievementsSource import de.westnordost.streetcomplete.data.user.statistics.CountryStatistics import de.westnordost.streetcomplete.data.user.statistics.StatisticsSource import de.westnordost.streetcomplete.util.ktx.launch -import com.russhwolf.settings.ObservableSettings import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.StateFlow diff --git a/app/src/main/java/de/westnordost/streetcomplete/util/LocaleListCompatUtils.kt b/app/src/main/java/de/westnordost/streetcomplete/util/LocaleListCompatUtils.kt index 3f38180740..1bb734bf03 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/util/LocaleListCompatUtils.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/util/LocaleListCompatUtils.kt @@ -6,9 +6,9 @@ import android.os.Build import android.os.LocaleList import androidx.core.os.ConfigurationCompat import androidx.core.os.LocaleListCompat +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.Prefs import de.westnordost.streetcomplete.util.ktx.addedToFront -import com.russhwolf.settings.ObservableSettings import java.util.Locale /** Get the override-locale selected in this app or null if there is no override */ diff --git a/app/src/main/java/de/westnordost/streetcomplete/view/controller/StreetSideSelectWithLastAnswerButtonViewController.kt b/app/src/main/java/de/westnordost/streetcomplete/view/controller/StreetSideSelectWithLastAnswerButtonViewController.kt index af5f0fd3b8..07d0f2de96 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/view/controller/StreetSideSelectWithLastAnswerButtonViewController.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/view/controller/StreetSideSelectWithLastAnswerButtonViewController.kt @@ -4,10 +4,10 @@ import android.view.View import androidx.annotation.DrawableRes import androidx.annotation.StringRes import androidx.core.view.isGone +import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.R import de.westnordost.streetcomplete.databinding.ViewStreetSideLastAnswerButtonBinding import de.westnordost.streetcomplete.util.math.normalizeDegrees -import com.russhwolf.settings.ObservableSettings import de.westnordost.streetcomplete.view.Image import de.westnordost.streetcomplete.view.ResImage import de.westnordost.streetcomplete.view.ResText @@ -199,11 +199,17 @@ class StreetSideSelectWithLastAnswerButtonViewController( val r = if (isUpsideDown) left else right if (showSides == Sides.BOTH) { - if (l != null) prefs.putString("$lastSelectionPreferencePrefix.left", serializeLastSelection(l.value)) - else prefs.remove("$lastSelectionPreferencePrefix.left") + if (l != null) { + prefs.putString("$lastSelectionPreferencePrefix.left", serializeLastSelection(l.value)) + } else { + prefs.remove("$lastSelectionPreferencePrefix.left") + } - if (r != null) prefs.putString("$lastSelectionPreferencePrefix.right", serializeLastSelection(r.value)) - else prefs.remove("$lastSelectionPreferencePrefix.right") + if (r != null) { + prefs.putString("$lastSelectionPreferencePrefix.right", serializeLastSelection(r.value)) + } else { + prefs.remove("$lastSelectionPreferencePrefix.right") + } } else { (l ?: r)?.let { prefs.putString("$lastSelectionPreferencePrefix.oneSide", serializeLastSelection(it.value)) } } diff --git a/app/src/test/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsControllerTest.kt b/app/src/test/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsControllerTest.kt index 6d5166b2ca..69c94b9559 100644 --- a/app/src/test/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsControllerTest.kt +++ b/app/src/test/java/de/westnordost/streetcomplete/data/user/statistics/StatisticsControllerTest.kt @@ -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.user.UserLoginStatusSource @@ -7,7 +8,6 @@ import de.westnordost.streetcomplete.testutils.any import de.westnordost.streetcomplete.testutils.mock import de.westnordost.streetcomplete.testutils.on import de.westnordost.streetcomplete.testutils.p -import com.russhwolf.settings.ObservableSettings import kotlinx.datetime.LocalDate import org.mockito.ArgumentMatchers.anyDouble import org.mockito.Mockito.verify