diff --git a/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NotesDownloader.kt b/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NotesDownloader.kt index b7c166c3d1..2ef54e6962 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NotesDownloader.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/data/osmnotes/NotesDownloader.kt @@ -26,7 +26,7 @@ class NotesDownloader( yield() - noteController.putAllForBBox(bbox, notes) + noteController.putAllForBBox(bbox, notes) } companion object { 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 db8864d54e..5c8ed46995 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/AStreetSideSelectOverlayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/AStreetSideSelectOverlayForm.kt @@ -59,7 +59,7 @@ abstract class AStreetSideSelectOverlayForm : AbstractOverlayForm() { } } - override fun onMapOrientation(rotation: Float, tilt: Float) { + override fun onMapOrientation(rotation: Double, tilt: Double) { streetSideSelect.onMapOrientation(rotation, tilt) } diff --git a/app/src/main/java/de/westnordost/streetcomplete/overlays/AbstractOverlayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/overlays/AbstractOverlayForm.kt index 21501f2a6d..42d0bd5034 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/overlays/AbstractOverlayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/overlays/AbstractOverlayForm.kt @@ -126,8 +126,8 @@ abstract class AbstractOverlayForm : protected val geometry: ElementGeometry get() = _geometry ?: ElementPointGeometry(getDefaultMarkerPosition()!!) - private var initialMapRotation = 0f - private var initialMapTilt = 0f + private var initialMapRotation = 0.0 + private var initialMapTilt = 0.0 override val elementKey: ElementKey? get() = element?.key protected val metersPerPixel: Double? get() = listener?.metersPerPixel @@ -171,8 +171,8 @@ abstract class AbstractOverlayForm : element = args.getString(ARG_ELEMENT)?.let { Json.decodeFromString(it) } _geometry = (savedInstanceState?.getString(ARG_GEOMETRY) ?: args.getString(ARG_GEOMETRY)) ?.let { Json.decodeFromString(it) } - initialMapRotation = args.getFloat(ARG_MAP_ROTATION) - initialMapTilt = args.getFloat(ARG_MAP_TILT) + initialMapRotation = args.getDouble(ARG_MAP_ROTATION) + initialMapTilt = args.getDouble(ARG_MAP_TILT) _countryInfo = null // reset lazy field /* deliberately did not copy the mobile-country-code hack from AbstractQuestForm because @@ -236,7 +236,7 @@ abstract class AbstractOverlayForm : } } - override fun onMapOrientation(rotation: Float, tilt: Float) { + override fun onMapOrientation(rotation: Double, tilt: Double) { // default empty implementation } @@ -450,7 +450,7 @@ abstract class AbstractOverlayForm : private const val ARG_MAP_ROTATION = "map_rotation" private const val ARG_MAP_TILT = "map_tilt" - fun createArguments(overlay: Overlay, element: Element?, geometry: ElementGeometry?, rotation: Float, tilt: Float) = bundleOf( + fun createArguments(overlay: Overlay, element: Element?, geometry: ElementGeometry?, rotation: Double, tilt: Double) = bundleOf( ARG_ELEMENT to element?.let { Json.encodeToString(it) }, ARG_GEOMETRY to geometry?.let { Json.encodeToString(it) }, ARG_OVERLAY to overlay.name, 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 aa00e72e7e..39fbf80a5d 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AStreetSideSelectForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AStreetSideSelectForm.kt @@ -68,7 +68,7 @@ abstract class AStreetSideSelectForm : AbstractOsmQuestForm() { checkIsFormComplete() } - override fun onMapOrientation(rotation: Float, tilt: Float) { + override fun onMapOrientation(rotation: Double, tilt: Double) { streetSideSelect.onMapOrientation(rotation, tilt) } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt index e8360a81b4..4fab933609 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/AbstractQuestForm.kt @@ -88,8 +88,8 @@ abstract class AbstractQuestForm : override lateinit var questKey: QuestKey protected lateinit var questType: QuestType protected lateinit var geometry: ElementGeometry private set - private var initialMapRotation = 0f - private var initialMapTilt = 0f + private var initialMapRotation = 0.0 + private var initialMapTilt = 0.0 // overridable by child classes open val contentLayoutResId: Int? = null @@ -102,8 +102,8 @@ abstract class AbstractQuestForm : questKey = Json.decodeFromString(args.getString(ARG_QUEST_KEY)!!) questType = questTypeRegistry.getByName(args.getString(ARG_QUESTTYPE)!!)!! geometry = Json.decodeFromString(args.getString(ARG_GEOMETRY)!!) - initialMapRotation = args.getFloat(ARG_MAP_ROTATION) - initialMapTilt = args.getFloat(ARG_MAP_TILT) + initialMapRotation = args.getDouble(ARG_MAP_ROTATION) + initialMapTilt = args.getDouble(ARG_MAP_TILT) _countryInfo = null // reset lazy field } @@ -202,7 +202,7 @@ abstract class AbstractQuestForm : protected open fun isFormComplete(): Boolean = false - @AnyThread override fun onMapOrientation(rotation: Float, tilt: Float) { + @AnyThread override fun onMapOrientation(rotation: Double, tilt: Double) { // default empty implementation } @@ -219,7 +219,7 @@ abstract class AbstractQuestForm : private const val ARG_MAP_ROTATION = "map_rotation" private const val ARG_MAP_TILT = "map_tilt" - fun createArguments(questKey: QuestKey, questType: QuestType, geometry: ElementGeometry, rotation: Float, tilt: Float) = bundleOf( + fun createArguments(questKey: QuestKey, questType: QuestType, geometry: ElementGeometry, rotation: Double, tilt: Double) = bundleOf( ARG_QUEST_KEY to Json.encodeToString(questKey), ARG_GEOMETRY to Json.encodeToString(geometry), ARG_QUESTTYPE to questType.name, diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleInclineForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleInclineForm.kt index ba624bb1a5..e738963c8b 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleInclineForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddBicycleInclineForm.kt @@ -28,8 +28,8 @@ class AddBicycleInclineForm : AImageListQuestForm imageSelector.cellLayoutId = R.layout.cell_icon_select_with_label_below } - override fun onMapOrientation(rotation: Float, tilt: Float) { - mapRotation = (rotation * 180 / PI).toFloat() + override fun onMapOrientation(rotation: Double, tilt: Double) { + mapRotation = rotation.toFloat() imageSelector.items = items } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddInclineForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddInclineForm.kt index 62d2e49c2d..ce32487cb9 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddInclineForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/incline_direction/AddInclineForm.kt @@ -22,8 +22,8 @@ class AddInclineForm : AImageListQuestForm() { imageSelector.cellLayoutId = R.layout.cell_icon_select_with_label_below } - override fun onMapOrientation(rotation: Float, tilt: Float) { - mapRotation = (rotation * 180 / PI).toFloat() + override fun onMapOrientation(rotation: Double, tilt: Double) { + mapRotation = rotation.toFloat() imageSelector.items = items } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt index b303704887..f473e7c653 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/lanes/AddLanesForm.kt @@ -86,9 +86,9 @@ class AddLanesForm : AbstractOsmQuestForm() { } } - @AnyThread override fun onMapOrientation(rotation: Float, tilt: Float) { - mapRotation = (rotation * 180 / PI).toFloat() - mapTilt = (tilt * 180 / PI).toFloat() + @AnyThread override fun onMapOrientation(rotation: Double, tilt: Double) { + mapRotation = rotation.toFloat() + mapTilt = tilt.toFloat() updateStreetOrientation() } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOnewayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOnewayForm.kt index 2a389f79c4..d7d0f661ab 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOnewayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway/AddOnewayForm.kt @@ -23,8 +23,8 @@ class AddOnewayForm : AImageListQuestForm() { imageSelector.cellLayoutId = R.layout.cell_icon_select_with_label_below } - override fun onMapOrientation(rotation: Float, tilt: Float) { - mapRotation = (rotation * 180 / PI).toFloat() + override fun onMapOrientation(rotation: Double, tilt: Double) { + mapRotation = rotation.toFloat() imageSelector.items = items } diff --git a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOnewayForm.kt b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOnewayForm.kt index 0e893ca707..a671d31852 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOnewayForm.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/quests/oneway_suspects/AddSuspectedOnewayForm.kt @@ -47,8 +47,8 @@ class AddSuspectedOnewayForm : AbstractOsmQuestForm() { } } - override fun onMapOrientation(rotation: Float, tilt: Float) { - mapRotation = (rotation * 180 / PI).toFloat() + override fun onMapOrientation(rotation: Double, tilt: Double) { + mapRotation = rotation.toFloat() binding.onewayIcon.rotation = wayRotation + mapRotation } 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 434347d787..eed2d04b4e 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/MainActivity.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/MainActivity.kt @@ -178,9 +178,9 @@ class MainActivity : val data = intent.data ?: return if ("geo" != data.scheme) return val geo = parseGeoUri(data) ?: return - val zoom = if (geo.zoom == null || geo.zoom < 14) 18f else geo.zoom + val zoom = if (geo.zoom == null || geo.zoom < 14) 18.0 else geo.zoom val pos = LatLon(geo.latitude, geo.longitude) - mainFragment?.setCameraPosition(pos, zoom.toFloat()) + mainFragment?.setCameraPosition(pos, zoom) } public override fun onStart() { 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 15583bf0d1..d1337d7322 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 @@ -319,11 +319,11 @@ class MainFragment : binding.gpsTrackingButton.isNavigation = mapFragment?.isNavigationMode ?: false binding.stopTracksButton.isVisible = mapFragment?.isRecordingTracks ?: false updateLocationPointerPin() - mapFragment?.cameraPosition?.zoom?.let { updateCreateButtonEnablement(it.toFloat()) } + mapFragment?.cameraPosition?.zoom?.let { updateCreateButtonEnablement(it) } listener?.onMapInitialized() } - override fun onMapIsChanging(position: LatLon, rotation: Float, tilt: Float, zoom: Float) { + override fun onMapIsChanging(position: LatLon, rotation: Double, tilt: Double, zoom: Double) { // binding.compassView.rotation = (180 * rotation / PI).toFloat() // binding.compassView.rotationX = (180 * tilt / PI).toFloat() @@ -347,7 +347,7 @@ class MainFragment : } } - override fun onMapDidChange(position: LatLon, rotation: Float, tilt: Float, zoom: Float) { } + override fun onMapDidChange(position: LatLon, rotation: Double, tilt: Double, zoom: Double) { } override fun onLongPress(x: Float, y: Float) { val point = PointF(x, y) @@ -771,8 +771,8 @@ class MainFragment : binding.crosshairView.isGone = !isCreateNodeEnabled } - private fun updateCreateButtonEnablement(zoom: Float) { - binding.createButton.isEnabled = zoom >= 18f + private fun updateCreateButtonEnablement(zoom: Double) { + binding.createButton.isEnabled = zoom >= 18.0 } private fun setIsNavigationMode(navigation: Boolean) { @@ -992,7 +992,7 @@ class MainFragment : val camera = mapFragment.cameraPosition val rotation = camera?.rotation ?: 0.0 val tilt = camera?.tilt ?: 0.0 - val args = AbstractOverlayForm.createArguments(overlay, null, null, rotation.toFloat(), tilt.toFloat()) + val args = AbstractOverlayForm.createArguments(overlay, null, null, rotation, tilt) f.requireArguments().putAll(args) showInBottomSheet(f) @@ -1025,7 +1025,7 @@ class MainFragment : val camera = mapFragment.cameraPosition val rotation = camera?.rotation ?: 0.0 val tilt = camera?.tilt ?: 0.0 - val args = AbstractOverlayForm.createArguments(overlay, element, geometry, rotation.toFloat(), tilt.toFloat()) + val args = AbstractOverlayForm.createArguments(overlay, element, geometry, rotation, tilt) f.requireArguments().putAll(args) showInBottomSheet(f) @@ -1059,7 +1059,7 @@ class MainFragment : val camera = mapFragment.cameraPosition val rotation = camera?.rotation ?: 0.0 val tilt = camera?.tilt ?: 0.0 - val args = AbstractQuestForm.createArguments(quest.key, quest.type, quest.geometry, rotation.toFloat(), tilt.toFloat()) + val args = AbstractQuestForm.createArguments(quest.key, quest.type, quest.geometry, rotation, tilt) f.requireArguments().putAll(args) if (quest is OsmQuest) { @@ -1186,10 +1186,10 @@ class MainFragment : return mapFragment?.cameraPosition } - fun setCameraPosition(position: LatLon, zoom: Float) { + fun setCameraPosition(position: LatLon, zoom: Double) { mapFragment?.isFollowingPosition = false mapFragment?.isNavigationMode = false - mapFragment?.setInitialCameraPosition(ScCameraPosition(position, 0.0, 0.0, zoom.toDouble())) + mapFragment?.setInitialCameraPosition(ScCameraPosition(position, 0.0, 0.0, zoom)) setIsFollowingPosition(false) } diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/IsMapOrientationAware.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/IsMapOrientationAware.kt index bdc90cd0df..66b15a92f3 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/IsMapOrientationAware.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/bottom_sheet/IsMapOrientationAware.kt @@ -1,5 +1,5 @@ package de.westnordost.streetcomplete.screens.main.bottom_sheet interface IsMapOrientationAware { - fun onMapOrientation(rotation: Float, tilt: Float) + fun onMapOrientation(rotation: Double, tilt: Double) } 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 aa9f32a024..3cfdd1e9f3 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 @@ -151,7 +151,7 @@ open class LocationAwareMapFragment : MapFragment() { centerCurrentPositionIfFollowing() } - override fun onMapIsChanging(position: LatLon, rotation: Float, tilt: Float, zoom: Float) { + override fun onMapIsChanging(position: LatLon, rotation: Double, tilt: Double, zoom: Double) { super.onMapIsChanging(position, rotation, tilt, zoom) locationMapComponent?.currentMapZoom = zoom } diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MainMapFragment.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MainMapFragment.kt index 1dab17635b..0321f5b418 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MainMapFragment.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/MainMapFragment.kt @@ -163,7 +163,7 @@ class MainMapFragment : LocationAwareMapFragment(), ShowsGeometryMarkers { // enable offline stuff // needs some file at server because for absolutely no reason you can't supply a local style (or even just tile url) for offline stuff // see MapTilesDownloader - // moving to user position after auto-zoom from opening a quest does not center user (looks like it keeps the insets) + // moving to user position after auto-zoom from opening a quest does not center user (looks like it keeps the insets/padding) // zoom very often is choppy, far not as smooth as tangram // more quests make it a little worse, but most of it seems to be "natural" // is it definitely a maplibre issue? or maybe some map change listener? @@ -540,7 +540,7 @@ class MainMapFragment : LocationAwareMapFragment(), ShowsGeometryMarkers { style.addLayerBelow(downloadedAreaLayer, "pins-layer") } - override fun onMapIsChanging(position: LatLon, rotation: Float, tilt: Float, zoom: Float) { + override fun onMapIsChanging(position: LatLon, rotation: Double, tilt: Double, zoom: Double) { super.onMapIsChanging(position, rotation, tilt, zoom) questPinsManager?.onNewScreenPosition() styleableOverlayManager?.onNewScreenPosition() 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 565c7d86e5..ff1b93d278 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 @@ -79,9 +79,9 @@ open class MapFragment : Fragment() { /** Called when the map has been completely initialized */ fun onMapInitialized() /** Called during camera animation and while the map is being controlled by a user */ - fun onMapIsChanging(position: LatLon, rotation: Float, tilt: Float, zoom: Float) + fun onMapIsChanging(position: LatLon, rotation: Double, tilt: Double, zoom: Double) /** Called after camera animation or after the map was controlled by a user */ - fun onMapDidChange(position: LatLon, rotation: Float, tilt: Float, zoom: Float) + fun onMapDidChange(position: LatLon, rotation: Double, tilt: Double, zoom: Double) /** Called when the user begins to pan the map */ fun onPanBegin() /** Called when the user long-presses the map */ @@ -223,15 +223,15 @@ open class MapFragment : Fragment() { val camera = cameraPosition ?: return if (camera == previousCameraPosition) return previousCameraPosition = camera - onMapIsChanging(camera.position, camera.rotation.toFloat(), camera.tilt.toFloat(), camera.zoom.toFloat()) - listener?.onMapIsChanging(camera.position, camera.rotation.toFloat(), camera.tilt.toFloat(), camera.zoom.toFloat()) + onMapIsChanging(camera.position, camera.rotation, camera.tilt, camera.zoom) + listener?.onMapIsChanging(camera.position, camera.rotation, camera.tilt, camera.zoom) } override fun onMapDidChange() { val camera = cameraPosition ?: return if (camera == previousCameraPosition) return previousCameraPosition = camera - onMapDidChange(camera.position, camera.rotation.toFloat(), camera.tilt.toFloat(), camera.zoom.toFloat()) - listener?.onMapDidChange(camera.position, camera.rotation.toFloat(), camera.tilt.toFloat(), camera.zoom.toFloat()) + onMapDidChange(camera.position, camera.rotation, camera.tilt, camera.zoom) + listener?.onMapDidChange(camera.position, camera.rotation, camera.tilt, camera.zoom) } }) } @@ -248,9 +248,9 @@ open class MapFragment : Fragment() { @CallSuper protected open suspend fun onBeforeLoadScene() {} - protected open fun onMapIsChanging(position: LatLon, rotation: Float, tilt: Float, zoom: Float) {} + protected open fun onMapIsChanging(position: LatLon, rotation: Double, tilt: Double, zoom: Double) {} - protected open fun onMapDidChange(position: LatLon, rotation: Float, tilt: Float, zoom: Float) {} + protected open fun onMapDidChange(position: LatLon, rotation: Double, tilt: Double, zoom: Double) {} /* ---------------------- Overridable callbacks for map interaction ------------------------ */ /* diff --git a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/components/CurrentLocationMapComponent.kt b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/components/CurrentLocationMapComponent.kt index f1d87c0eed..e7bba58791 100644 --- a/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/components/CurrentLocationMapComponent.kt +++ b/app/src/main/java/de/westnordost/streetcomplete/screens/main/map/components/CurrentLocationMapComponent.kt @@ -66,7 +66,7 @@ class CurrentLocationMapComponent(ctx: Context, mapStyle: Style, private val ctr * but it needs to know when it changed. There is no specific event for that. Whenever the * zoom changed, the marker showing the accuracy must be updated because the accuracy's marker * size is calculated programmatically using the current zoom. */ - var currentMapZoom: Float? = null + var currentMapZoom: Double? = null set(value) { if (field == value) return field = value @@ -79,6 +79,7 @@ class CurrentLocationMapComponent(ctx: Context, mapStyle: Style, private val ctr delay(100) } delay(500) // just to be sure + // this is the maplibre location component, could be used instead most of the stuff in here val options = LocationComponentOptions.builder(ctx) .bearingDrawable(R.drawable.location_direction) // todo: not displayed .gpsDrawable(R.drawable.location_dot) // todo: not displayed 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 fcb664a0a3..16f6130f74 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 @@ -186,7 +186,7 @@ class ShowQuestFormsActivity : BaseActivity(), AbstractOsmQuestForm.Listener { val f = questType.createForm() if (f.arguments == null) f.arguments = bundleOf() f.requireArguments().putAll( - AbstractQuestForm.createArguments(quest.key, quest.type, geometry, 30.0f, 0.0f) + AbstractQuestForm.createArguments(quest.key, quest.type, geometry, 30.0, 0.0) ) f.requireArguments().putAll(AbstractOsmQuestForm.createArguments(element)) f.hideOsmQuestController = object : HideOsmQuestController { 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 c16818a697..f7e9ae3bb9 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 @@ -136,10 +136,10 @@ class StreetSideSelectWithLastAnswerButtonViewController( /* ------------------------------------ rotate view ----------------------------------------- */ - fun onMapOrientation(rotation: Float, tilt: Float) { - puzzleView.streetRotation = offsetPuzzleRotation + (180 * rotation / PI).toFloat() - compassView.rotation = (180 * rotation / PI).toFloat() - compassView.rotationX = (180 * tilt / PI).toFloat() + fun onMapOrientation(rotation: Double, tilt: Double) { + puzzleView.streetRotation = offsetPuzzleRotation + rotation.toFloat() + compassView.rotation = rotation.toFloat() + compassView.rotationX = tilt.toFloat() } /* ------------------------------------------------------------------------------------------ */