shared(nearby): apply toggle+radius filtering in KMP builder; app(nearby): pass toggles to builder and dialog
- shared: buildNearbyEntries(...) now accepts showKlotter/showWiki/showDm/showFornsok and filters by per-layer radii (Wiki/DM/Fornsok) while keeping Klotter visible outside 20 m (label falls back to “Okänt klotter”). Sorting by distance remains. - app: NearbyDialog signature includes toggles and forwards them to the shared builder. - app: call site updated to pass toggles; behavior unified across platforms. - No Material dependencies added; Android build stays green.
This commit is contained in:
@@ -839,6 +839,10 @@ private fun KlottrApp(
|
||||
dmRadius = dmRadius,
|
||||
forn = nearbyFornsok,
|
||||
fornsokRadius = fornsokRadius,
|
||||
showKlotter = showKlotter, // [NY]
|
||||
showWiki = showWiki, // [NY]
|
||||
showDm = showDm, // [NY]
|
||||
showFornsok = showFornsok, // [NY]
|
||||
onOpenAction = { action ->
|
||||
when (action) {
|
||||
is FoundOpenAction.Klotter ->
|
||||
@@ -1318,6 +1322,10 @@ private fun NearbyDialog(
|
||||
dmRadius: Int,
|
||||
forn: List<FornsokItem>,
|
||||
fornsokRadius: Int,
|
||||
showKlotter: Boolean, // [NY]
|
||||
showWiki: Boolean, // [NY]
|
||||
showDm: Boolean, // [NY]
|
||||
showFornsok: Boolean, // [NY]
|
||||
onOpenAction: (FoundOpenAction) -> Unit, // Enhetlig callback
|
||||
onMarkedFound: () -> Unit,
|
||||
onClose: () -> Unit
|
||||
@@ -1348,6 +1356,10 @@ private fun NearbyDialog(
|
||||
dmRadius = dmRadius,
|
||||
fornsokRadius = fornsokRadius,
|
||||
defaultKlotterRadiusM = Config.DEFAULT_KLOTTER_RADIUS_M,
|
||||
showKlotter = showKlotter, // [NY]
|
||||
showWiki = showWiki, // [NY]
|
||||
showDm = showDm, // [NY]
|
||||
showFornsok = showFornsok, // [NY]
|
||||
knownKlotterLabel = { id -> knownKlotterLabels[id] }
|
||||
)
|
||||
} else emptyList()
|
||||
|
||||
Reference in New Issue
Block a user