RF Sentinel (RFSentinel): free, open-source police detector app for Android. Spots police body cams, Flock ALPR cameras, AirTag trackers, Remote ID drones, smart glasses and fake cell towers from Bluetooth LE and WiFi. No root.
Kotlin airtagalprandroidandroid-autoanti-surveillancebluetooth-low-energybody-cameracounter-surveillancedrone-detectionflock-safetyimsi-catcher-detectorpolice-detectorpolice-scannerprivacyremote-idrtl-sdrsdrsurveillance-detectiontracker-detectionwifi
GUI rework: filter chips with live counts and a readable selected state in every theme, List/Radar toggle, start/stop with icons; map: device filter chips (same rules as the list) and self-centering that follows you until you pan
CIS-C03b8eb42ae688
diff --git a/app/src/main/java/com/rfsentinel/app/MainActivity.kt b/app/src/main/java/com/rfsentinel/app/MainActivity.ktindex 8e90281..2e98591 100644--- a/app/src/main/java/com/rfsentinel/app/MainActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/MainActivity.kt@@ -50,11 +50,10 @@ class MainActivity : AppCompatActivity() {private const val WHITELIST_COLOR = 0xFF6B7B80.toInt()}- private enum class Filter { ALL, FLAGGED, TRACKERS, DRONES, NEW, ESP32, FAVORITES, BLE, WIFI }-private lateinit var binding: ActivityMainBindingprivate lateinit var adapter: DeviceAdapter- private var filter = Filter.ALL+ private var filter = com.rfsentinel.app.ui.DeviceFilter.ALL+ private val filterChips = HashMap<com.rfsentinel.app.ui.DeviceFilter, com.google.android.material.chip.Chip>()private var query = ""private var deviceCount = 0private var flaggedCount = 0@@ -93,8 +92,11 @@ class MainActivity : AppCompatActivity() {binding.startStopButton.setOnClickListener {if (ScanForegroundService.isRunning) stopScanning() else requestPermissionsAndStart()}- binding.viewToggleButton.setOnClickListener {- Prefs.setRadarView(this, !Prefs.radarView(this))+ styleViewToggle()+ binding.viewToggle.check(if (Prefs.radarView(this)) R.id.viewRadarButton else R.id.viewListButton)+ binding.viewToggle.addOnButtonCheckedListener { _, id, checked ->+ if (!checked) return@addOnButtonCheckedListener+ Prefs.setRadarView(this, id == R.id.viewRadarButton)applyViewMode()}binding.mapButton.setOnClickListener {@@ -107,20 +109,7 @@ class MainActivity : AppCompatActivity() {else if ((dy < -8 || !rv.canScrollVertically(-1)) && !binding.mapButton.isExtended) binding.mapButton.extend()}})- binding.filterChips.setOnCheckedStateChangeListener { _, ids ->- filter = when (ids.firstOrNull()) {- R.id.chipFlagged -> Filter.FLAGGED- R.id.chipTrackers -> Filter.TRACKERS- R.id.chipDrones -> Filter.DRONES- R.id.chipNew -> Filter.NEW- R.id.chipEsp -> Filter.ESP32- R.id.chipFavorites -> Filter.FAVORITES- R.id.chipBle -> Filter.BLE- R.id.chipWifi -> Filter.WIFI- else -> Filter.ALL- }- render()- }+ setupFilterChips()// Debug builds only: made-up devices for screenshots (see DemoData).if (BuildConfig.DEBUG && intent.getBooleanExtra("demo", false)) {@@ -179,13 +168,57 @@ class MainActivity : AppCompatActivity() {val radar = Prefs.radarView(this)binding.radarView.visibility = if (radar) View.VISIBLE else View.GONEbinding.recyclerView.visibility = if (radar) View.GONE else View.VISIBLE- binding.viewToggleButton.text = if (radar) "List view" else "Radar view"if (!binding.mapButton.isExtended) binding.mapButton.extend()}+ /** Filter chips from [com.rfsentinel.app.ui.DeviceFilter] (same rules as the map), counts filled in by render(). */+ private fun setupFilterChips() {+ for (f in com.rfsentinel.app.ui.DeviceFilter.entries) {+ val chip = com.google.android.material.chip.Chip(this, null, com.google.android.material.R.attr.chipStyle).apply {+ id = View.generateViewId()+ text = f.label+ isCheckable = true+ com.rfsentinel.app.ui.ChipStyle.apply(this)+ }+ filterChips[f] = chip+ binding.filterChips.addView(chip)+ if (f == filter) chip.isChecked = true+ }+ binding.filterChips.setOnCheckedStateChangeListener { _, ids ->+ filter = filterChips.entries.firstOrNull { it.value.id == ids.firstOrNull() }?.key ?: return@setOnCheckedStateChangeListener+ render()+ }+ }++ /** List / radar toggle: the selected half filled with the theme highlight. */+ private fun styleViewToggle() {+ val (accent, onAccent) = com.rfsentinel.app.ui.ChipStyle.accent(this)+ val text = com.rfsentinel.app.ui.ChipStyle.onSurface(this)+ val checked = intArrayOf(android.R.attr.state_checked)+ val none = intArrayOf()+ for (b in listOf(binding.viewListButton, binding.viewRadarButton)) {+ b.backgroundTintList = android.content.res.ColorStateList(arrayOf(checked, none), intArrayOf(accent, 0x00000000))+ b.iconTint = android.content.res.ColorStateList(arrayOf(checked, none), intArrayOf(onAccent, text))+ b.strokeColor = android.content.res.ColorStateList.valueOf(accent)+ }+ }++ private var shownRunning: Boolean? = null+private fun updateStatus() {val running = ScanForegroundService.isRunning || demoMode- binding.startStopButton.text = if (running) "Stop scanning" else "Start scanning"+ if (shownRunning != running) {+ shownRunning = running+ // Start: theme highlight with a play icon; Stop: red with a stop icon.+ val (accent, onAccent) = com.rfsentinel.app.ui.ChipStyle.accent(this)+ val red = com.rfsentinel.app.ui.ThemeManager.ink(this, 0xFFB3261E.toInt())+ binding.startStopButton.text = if (running) "Stop scanning" else "Start scanning"+ binding.startStopButton.setIconResource(if (running) R.drawable.ic_car_stop else R.drawable.ic_car_play)+ binding.startStopButton.backgroundTintList = android.content.res.ColorStateList.valueOf(if (running) red else accent)+ val fg = if (running) 0xFFFFFFFF.toInt() else onAccent+ binding.startStopButton.setTextColor(fg)+ binding.startStopButton.iconTint = android.content.res.ColorStateList.valueOf(fg)+ }binding.statusText.text = when {!running -> "Idle - tap Start to listen for nearby devices"!bluetoothOn() && !demoMode -> "Scanning WiFi only - turn on Bluetooth for BLE (picked up automatically)"@@ -226,7 +259,13 @@ class MainActivity : AppCompatActivity() {updateBanner(flagged, threshold)updateStatus()- val visible = all.filter { matchesFilter(it) && matchesQuery(it) }+ // Live counts on the chips ("Trackers 2"); empty filters stay unlabelled.+ for ((f, chip) in filterChips) {+ val n = all.count { f.matches(it) }+ val label = if (f == com.rfsentinel.app.ui.DeviceFilter.ALL || n > 0) "${f.label} $n" else f.label+ if (chip.text != label) chip.text = label+ }+ val visible = all.filter { filter.matches(it) && matchesQuery(it) }.sortedWith(compareByDescending<DeviceRegistry.Snapshot> { it.best != null && !WhitelistCache.contains(it.mac) }.thenByDescending { it.following }@@ -256,19 +295,6 @@ class MainActivity : AppCompatActivity() {}}- private fun matchesFilter(s: DeviceRegistry.Snapshot): Boolean = when (filter) {- Filter.ALL -> true- Filter.FLAGGED -> s.best != null && !WhitelistCache.contains(s.mac)- Filter.TRACKERS -> s.hits.any { it.category == Category.TRACKER } ||- s.deviceType.contains("tracker", true) || s.deviceType.contains("Find My", true)- Filter.DRONES -> s.hits.any { it.category == Category.DRONE } || s.remoteId != null- Filter.NEW -> s.isNew- Filter.ESP32 -> com.rfsentinel.app.esp.HeardBy.esp.recent(s.mac)- Filter.FAVORITES -> Favorites.contains(s.mac)- Filter.BLE -> Advert.Source.BLE in s.sources- Filter.WIFI -> Advert.Source.WIFI in s.sources- }-private fun matchesQuery(s: DeviceRegistry.Snapshot): Boolean {if (query.isBlank()) return trueval q = query.trim()diff --git a/app/src/main/java/com/rfsentinel/app/ui/ChipStyle.kt b/app/src/main/java/com/rfsentinel/app/ui/ChipStyle.ktnew file mode 100644index 0000000..b35302e--- /dev/null+++ b/app/src/main/java/com/rfsentinel/app/ui/ChipStyle.kt@@ -0,0 +1,52 @@+package com.rfsentinel.app.ui++import android.content.Context+import android.content.res.ColorStateList+import android.util.TypedValue+import com.google.android.material.chip.Chip+import com.rfsentinel.app.R++/**+ * One look for the filter chips everywhere (list and map), readable in every+ * theme: the selected chip is filled with the theme's highlight colour, the+ * others are outlined in the text colour. Replaces the stock choice chips,+ * whose selected state was dark teal on near-black in the dark theme.+ */+object ChipStyle {++ /** The theme's highlight colour and the text colour on it. */+ fun accent(context: Context): Pair<Int, Int> {+ val accent = attr(context, R.attr.rfAccent) ?: attr(context, androidx.appcompat.R.attr.colorPrimary) ?: 0xFF0B5C63.toInt()+ val on = attr(context, R.attr.rfOnAccent) ?: attr(context, com.google.android.material.R.attr.colorOnPrimary) ?: 0xFFFFFFFF.toInt()+ return ThemeManager.ink(context, accent) to on+ }++ fun onSurface(context: Context): Int =+ attr(context, com.google.android.material.R.attr.colorOnSurface) ?: attr(context, android.R.attr.textColorPrimary) ?: 0xFF888888.toInt()++ /** [overMap]: unselected chips get a solid background so they read on any map. */+ fun apply(chip: Chip, overMap: Boolean = false) {+ val ctx = chip.context+ val (accent, onAccent) = accent(ctx)+ val text = onSurface(ctx)+ val checked = intArrayOf(android.R.attr.state_checked)+ val none = intArrayOf()+ val idle = if (overMap) (attr(ctx, com.google.android.material.R.attr.colorSurface) ?: attr(ctx, android.R.attr.colorBackground)+ ?: 0xFF202020.toInt()) or 0xF0000000.toInt() else 0x00000000+ chip.chipBackgroundColor = ColorStateList(arrayOf(checked, none), intArrayOf(accent, idle))+ if (overMap) chip.elevation = 3f * ctx.resources.displayMetrics.density+ chip.setTextColor(ColorStateList(arrayOf(checked, none), intArrayOf(onAccent, text)))+ chip.chipStrokeColor = ColorStateList(arrayOf(checked, none), intArrayOf(accent, (text and 0x00FFFFFF) or 0x66000000))+ chip.chipStrokeWidth = 1.5f * ctx.resources.displayMetrics.density+ chip.isCheckedIconVisible = false+ chip.setEnsureMinTouchTargetSize(true)+ chip.typeface = android.graphics.Typeface.create(chip.typeface, android.graphics.Typeface.BOLD)+ }++ private fun attr(context: Context, id: Int): Int? {+ val tv = TypedValue()+ if (!context.theme.resolveAttribute(id, tv, true)) return null+ return if (tv.type in TypedValue.TYPE_FIRST_COLOR_INT..TypedValue.TYPE_LAST_COLOR_INT) tv.data+ else runCatching { context.getColor(tv.resourceId) }.getOrNull()+ }+}diff --git a/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt b/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.ktnew file mode 100644index 0000000..3e5c57b--- /dev/null+++ b/app/src/main/java/com/rfsentinel/app/ui/DeviceFilter.kt@@ -0,0 +1,37 @@+package com.rfsentinel.app.ui++import com.rfsentinel.app.data.Favorites+import com.rfsentinel.app.data.WhitelistCache+import com.rfsentinel.app.detect.Advert+import com.rfsentinel.app.detect.Category+import com.rfsentinel.app.service.DeviceRegistry++/** The device filters shared by the list and the map, so both pick the same devices. */+enum class DeviceFilter(val label: String) {+ ALL("All"),+ FLAGGED("Flagged"),+ TRACKERS("Trackers"),+ DRONES("Drones"),+ NEW("New"),+ ESP32("ESP32"),+ FAVORITES("Favorites"),+ BLE("Bluetooth"),+ WIFI("WiFi");++ fun matches(s: DeviceRegistry.Snapshot): Boolean = when (this) {+ ALL -> true+ FLAGGED -> s.best != null && !WhitelistCache.contains(s.mac)+ TRACKERS -> s.hits.any { it.category == Category.TRACKER } ||+ s.deviceType.contains("tracker", true) || s.deviceType.contains("Find My", true)+ DRONES -> s.hits.any { it.category == Category.DRONE } || s.remoteId != null+ NEW -> s.isNew+ ESP32 -> com.rfsentinel.app.esp.HeardBy.esp.recent(s.mac)+ FAVORITES -> Favorites.contains(s.mac)+ BLE -> Advert.Source.BLE in s.sources+ WIFI -> Advert.Source.WIFI in s.sources+ }++ companion object {+ fun parse(name: String?) = entries.firstOrNull { it.name == name } ?: ALL+ }+}diff --git a/app/src/main/java/com/rfsentinel/app/ui/MapActivity.kt b/app/src/main/java/com/rfsentinel/app/ui/MapActivity.ktindex 53b5433..1cf76a9 100644--- a/app/src/main/java/com/rfsentinel/app/ui/MapActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/ui/MapActivity.kt@@ -75,8 +75,12 @@ class MapActivity : AppCompatActivity() {private lateinit var binding: ActivityMapBindingprivate var tripId: Long? = nullprivate var trip: TripEntity? = null- private var showAll = true+ /** Which devices the map shows (live: every filter; a saved trace: all or flagged). */+ private var filter = DeviceFilter.ALL+ private val filterChips = HashMap<DeviceFilter, com.google.android.material.chip.Chip>()private var centeredOnce = false+ /** The map keeps your position centred until you pan it yourself. */+ private var following = falseprivate val trace = Polyline()private val pins = FolderOverlay()@@ -110,14 +114,16 @@ class MapActivity : AppCompatActivity() {setupMap()binding.map.post { drawKnownAlpr() }// Every device heard around you by default (same colours as the list and radar).- showAll = com.rfsentinel.app.util.Prefs.mapShowAll(this)- binding.showAllChip.isChecked = showAll- binding.showAllChip.setOnCheckedChangeListener { _, checked ->- showAll = checked- com.rfsentinel.app.util.Prefs.setMapShowAll(this, checked)- if (tripId != null) loadTrip() else renderLive()+ setupFilterChips()+ styleFollowButton()+ // Outlined "Traces" in the theme highlight (the stock dark teal was unreadable on dark themes).+ ChipStyle.accent(this).first.let { accent ->+ binding.tracesButton.setTextColor(accent)+ binding.tracesButton.strokeColor = android.content.res.ColorStateList.valueOf(accent)+ }+ binding.centerButton.setOnClickListener {+ if (tripId == null) setFollow(true) else centerOnMe()}- binding.centerButton.setOnClickListener { centerOnMe() }binding.tracesButton.setOnClickListener { startActivity(Intent(this, TripsActivity::class.java)) }if (tripId == null) {@@ -156,7 +162,11 @@ class MapActivity : AppCompatActivity() {map.overlays.add(drones)// Redraw the camera layer for the visible area after panning / zooming.map.addMapListener(object : org.osmdroid.events.MapListener {- override fun onScroll(event: org.osmdroid.events.ScrollEvent?) = false.also { drawKnownAlprSoon() }+ override fun onScroll(event: org.osmdroid.events.ScrollEvent?) = false.also {+ drawKnownAlprSoon()+ // osmdroid stops following when you drag the map: show that on the button.+ if (following && !myLocation.isFollowLocationEnabled) setFollow(false)+ }override fun onZoom(event: org.osmdroid.events.ZoomEvent?) = false.also {drawKnownAlprSoon()// The fan-out of stacked dots depends on the zoom.@@ -169,8 +179,10 @@ class MapActivity : AppCompatActivity() {if (Permissions.granted(this, android.Manifest.permission.ACCESS_FINE_LOCATION)) {myLocation.enableMyLocation()if (tripId == null) {+ // Live map: keep your position centred from the first fix until you pan away.+ setFollow(true)myLocation.runOnFirstFix {- runOnUiThread { if (!centeredOnce) { centeredOnce = true; centerOnMe() } }+ runOnUiThread { if (!centeredOnce) { centeredOnce = true; if (following) centerOnMe() } }}}}@@ -201,6 +213,61 @@ class MapActivity : AppCompatActivity() {super.onDestroy()}+ private fun setupFilterChips() {+ val options = if (tripId == null) DeviceFilter.entries else listOf(DeviceFilter.ALL, DeviceFilter.FLAGGED)+ filter = DeviceFilter.parse(com.rfsentinel.app.util.Prefs.mapFilter(this)).takeIf { it in options } ?: DeviceFilter.ALL+ val group = binding.mapFilterChips+ for (f in options) {+ val chip = com.google.android.material.chip.Chip(this, null, com.google.android.material.R.attr.chipStyle).apply {+ id = View.generateViewId()+ text = f.label+ isCheckable = true+ isCheckedIconVisible = false+ ChipStyle.apply(this, overMap = true)+ }+ filterChips[f] = chip+ group.addView(chip)+ if (f == filter) chip.isChecked = true+ }+ group.setOnCheckedStateChangeListener { _, ids ->+ val picked = filterChips.entries.firstOrNull { it.value.id == ids.firstOrNull() }?.key ?: return@setOnCheckedStateChangeListener+ filter = picked+ com.rfsentinel.app.util.Prefs.setMapFilter(this, picked.name)+ if (tripId != null) loadTrip() else renderLive()+ }+ }++ /** Chip labels with how many devices each filter would show ("Trackers 2"). */+ private fun updateFilterCounts(devices: List<DeviceRegistry.Snapshot>) {+ val placed = devices.filter { it.bestPosition != null }+ for ((f, chip) in filterChips) {+ val n = placed.count { f.matches(it) }+ chip.text = if (f == DeviceFilter.ALL || n > 0) "${f.label} $n" else f.label+ }+ }++ /** Turns following on (re-centres now and keeps you centred) or off (after you pan). */+ private fun setFollow(on: Boolean) {+ following = on+ if (on) {+ myLocation.enableFollowLocation()+ centerOnMe()+ } else {+ myLocation.disableFollowLocation()+ }+ styleFollowButton()+ }++ /** Filled with the theme highlight while following, plain otherwise. */+ private fun styleFollowButton() {+ val on = following+ val (accent, onAccent) = ChipStyle.accent(this)+ val plain = 0xFFFFFFFF.toInt()+ binding.centerButton.backgroundTintList = android.content.res.ColorStateList.valueOf(if (on) accent else plain)+ binding.centerButton.imageTintList = android.content.res.ColorStateList.valueOf(if (on) onAccent else 0xFF0B5C63.toInt())+ binding.centerButton.contentDescription = if (on) "Following your position" else "Follow my position"+ }+private fun centerOnMe() {val fix = myLocation.myLocation?: TripRecorder.livePoints().lastOrNull()?.let { GeoPoint(it.lat, it.lon) }@@ -213,7 +280,11 @@ class MapActivity : AppCompatActivity() {private fun renderLive() {val recording = TripRecorder.isRecordingbinding.recordButton.text = if (recording) "Stop recording" else "Record trace"- binding.recordButton.setBackgroundColor(if (recording) 0xFFB3261E.toInt() else 0xFF0B5C63.toInt())+ val (accent, onAccent) = ChipStyle.accent(this)+ binding.recordButton.backgroundTintList = android.content.res.ColorStateList.valueOf(if (recording) 0xFFB3261E.toInt() else accent)+ val recordFg = if (recording) 0xFFFFFFFF.toInt() else onAccent+ binding.recordButton.setTextColor(recordFg)+ binding.recordButton.iconTint = android.content.res.ColorStateList.valueOf(recordFg)trace.setPoints(TripRecorder.livePoints().map { GeoPoint(it.lat, it.lon) })@@ -222,7 +293,7 @@ class MapActivity : AppCompatActivity() {val drawn = devices.mapNotNull { s ->val pos = s.bestPosition ?: return@mapNotNull nullval flagged = DeviceColors.isFlagged(s)- if (!flagged && !showAll) return@mapNotNull null+ if (!filter.matches(s)) return@mapNotNull nullval best = s.bestPin(s.mac, pos.lat, pos.lon,@@ -238,6 +309,7 @@ class MapActivity : AppCompatActivity() {)}drawPins(drawn)+ updateFilterCounts(devices)drawDrones(devices.filter { it.remoteId?.hasPosition == true })val positioned = devices.count { it.bestPosition != null }@@ -252,7 +324,7 @@ class MapActivity : AppCompatActivity() {)}positioned == 0 -> "Scanning · waiting for GPS to place devices"- else -> "Scanning · ${drawn.size} on map" + if (!showAll) " (flagged only - tap All devices)" else ""+ else -> "Scanning · ${drawn.size} on map" + if (filter != DeviceFilter.ALL) " (${filter.label} only)" else ""}binding.statusText.background.mutate().setTint(if (recording) 0xFFB3261E.toInt() else 0xCC0B5C63.toInt())binding.map.invalidate()@@ -321,7 +393,7 @@ class MapActivity : AppCompatActivity() {val points = dao.points(id).map { GeoPoint(it.lat, it.lon) }val devices = dao.devices(id)trace.setPoints(points)- drawPins(devices.filter { it.lat != null && (it.flagged || showAll) }.map { it.toPin() })+ drawPins(devices.filter { it.lat != null && (it.flagged || filter == DeviceFilter.ALL) }.map { it.toPin() })val mins = ((t.endTime ?: System.currentTimeMillis()) - t.startTime) / 60000binding.statusText.text = String.format(Locale.US, "%s\n%s · %d:%02d · %.2f km · %s (%d flagged)",diff --git a/app/src/main/java/com/rfsentinel/app/util/Prefs.kt b/app/src/main/java/com/rfsentinel/app/util/Prefs.ktindex 3796d19..76e81a5 100644--- a/app/src/main/java/com/rfsentinel/app/util/Prefs.kt+++ b/app/src/main/java/com/rfsentinel/app/util/Prefs.kt@@ -106,10 +106,13 @@ object Prefs {/** Fetch known cameras for the map area on screen (and around you in the car) automatically. */fun autoCameras(context: Context): Boolean = bool(context, "auto_cameras", true)fun setAutoCameras(context: Context, value: Boolean) = setBool(context, "auto_cameras", value)- /** Map: every device heard (true) or flagged ones only. */- fun mapShowAll(context: Context): Boolean = bool(context, "map_show_all", true)- fun setMapShowAll(context: Context, value: Boolean) = setBool(context, "map_show_all", value)- /** Last destinations picked in the car (newest first, kept on this phone only). */+ /**+ * Map device filter (a [com.rfsentinel.app.ui.DeviceFilter] name). Older+ * versions had only "all devices" on/off: off becomes Flagged.+ */+ fun mapFilter(context: Context): String =+ sp(context).getString("map_filter", null) ?: if (bool(context, "map_show_all", true)) "ALL" else "FLAGGED"+ fun setMapFilter(context: Context, name: String) = sp(context).edit { putString("map_filter", name) } /** Last destinations picked in the car (newest first, kept on this phone only). */fun recentDestinations(context: Context): List<com.rfsentinel.app.nav.OsmRouting.Destination> = runCatching {val json = sp(context).getString("recent_destinations", null) ?: return emptyList()com.google.gson.Gson().fromJson(json, Array<com.rfsentinel.app.nav.OsmRouting.Destination>::class.java).toList()diff --git a/app/src/main/res/drawable/ic_radar.xml b/app/src/main/res/drawable/ic_radar.xmlnew file mode 100644index 0000000..e83e21c--- /dev/null+++ b/app/src/main/res/drawable/ic_radar.xml@@ -0,0 +1,21 @@+<vector xmlns:android="http://schemas.android.com/apk/res/android"+ android:width="24dp"+ android:height="24dp"+ android:viewportWidth="24"+ android:viewportHeight="24">+ <!-- Radar: rings, a sweep line and a blip -->+ <path+ android:fillColor="@android:color/transparent"+ android:strokeColor="#FFFFFFFF"+ android:strokeWidth="1.8"+ android:pathData="M12,3a9,9 0,1 0,0.01 0z M12,7.5a4.5,4.5 0,1 0,0.01 0z" />+ <path+ android:fillColor="@android:color/transparent"+ android:strokeColor="#FFFFFFFF"+ android:strokeLineCap="round"+ android:strokeWidth="1.8"+ android:pathData="M12,12 L18.4,5.6" />+ <path+ android:fillColor="#FFFFFFFF"+ android:pathData="M16.2,14.6m-1.4,0a1.4,1.4 0,1 1,2.8 0a1.4,1.4 0,1 1,-2.8 0" />+</vector>diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xmlindex ef5142c..6be521a 100644--- a/app/src/main/res/layout/activity_main.xml+++ b/app/src/main/res/layout/activity_main.xml@@ -60,103 +60,66 @@<LinearLayoutandroid:layout_width="match_parent"android:layout_height="wrap_content"+ android:gravity="center_vertical"android:orientation="horizontal">- <Button+ <com.google.android.material.button.MaterialButtonandroid:id="@+id/startStopButton"android:layout_width="0dp"android:layout_height="wrap_content"- android:layout_marginEnd="4dp"+ android:layout_marginEnd="8dp"android:layout_weight="1"- android:text="Start scanning" />-- <Button- android:id="@+id/viewToggleButton"- style="@style/Widget.MaterialComponents.Button.OutlinedButton"- android:layout_width="0dp"+ android:minHeight="52dp"+ android:text="Start scanning"+ app:icon="@drawable/ic_car_play"+ app:iconGravity="textStart" />++ <!-- List / radar: a two-way toggle reads clearer than one button naming the other view. -->+ <com.google.android.material.button.MaterialButtonToggleGroup+ android:id="@+id/viewToggle"+ android:layout_width="wrap_content"android:layout_height="wrap_content"- android:layout_marginStart="4dp"- android:layout_weight="1"- android:text="Radar view" />+ app:selectionRequired="true"+ app:singleSelection="true">++ <com.google.android.material.button.MaterialButton+ android:id="@+id/viewListButton"+ style="@style/Widget.MaterialComponents.Button.OutlinedButton"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:contentDescription="List view"+ android:minWidth="56dp"+ android:minHeight="52dp"+ app:icon="@drawable/ic_car_list"+ app:iconPadding="0dp" />++ <com.google.android.material.button.MaterialButton+ android:id="@+id/viewRadarButton"+ style="@style/Widget.MaterialComponents.Button.OutlinedButton"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ android:contentDescription="Radar view"+ android:minWidth="56dp"+ android:minHeight="52dp"+ app:icon="@drawable/ic_radar"+ app:iconPadding="0dp" />+ </com.google.android.material.button.MaterialButtonToggleGroup></LinearLayout>+ <!-- Device filters (built in code from DeviceFilter, with live counts). --><HorizontalScrollViewandroid:layout_width="match_parent"android:layout_height="wrap_content"+ android:layout_marginTop="4dp"android:scrollbars="none"><com.google.android.material.chip.ChipGroupandroid:id="@+id/filterChips"android:layout_width="wrap_content"android:layout_height="wrap_content"- app:checkedChip="@id/chipAll"app:selectionRequired="true"app:singleLine="true"- app:singleSelection="true">-- <com.google.android.material.chip.Chip- android:id="@+id/chipAll"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="All" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipFlagged"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="Flagged" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipTrackers"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="Trackers" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipDrones"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="Drones" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipNew"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="New" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipEsp"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="ESP32" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipFavorites"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="Favorites" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipBle"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="Bluetooth" />-- <com.google.android.material.chip.Chip- android:id="@+id/chipWifi"- style="@style/Widget.MaterialComponents.Chip.Choice"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="WiFi" />- </com.google.android.material.chip.ChipGroup>+ app:singleSelection="true" /></HorizontalScrollView><FrameLayoutdiff --git a/app/src/main/res/layout/activity_map.xml b/app/src/main/res/layout/activity_map.xmlindex 189a9c8..147b053 100644--- a/app/src/main/res/layout/activity_map.xml+++ b/app/src/main/res/layout/activity_map.xml@@ -44,24 +44,49 @@app:trackThickness="6dp" /></LinearLayout>+ <!-- Bottom: follow button, device filter chips, controls -->+ <LinearLayout+ android:id="@+id/bottomPanel"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:layout_gravity="bottom"+ android:orientation="vertical">+<com.google.android.material.floatingactionbutton.FloatingActionButtonandroid:id="@+id/centerButton"android:layout_width="wrap_content"android:layout_height="wrap_content"- android:layout_gravity="end|bottom"+ android:layout_gravity="end"android:layout_marginEnd="14dp"- android:layout_marginBottom="84dp"- android:contentDescription="Center on my position"+ android:layout_marginBottom="8dp"+ android:contentDescription="Follow my position"android:src="@drawable/ic_my_location"app:fabSize="mini"app:tint="#FFFFFF" />+ <HorizontalScrollView+ android:id="@+id/mapFilterScroll"+ android:layout_width="match_parent"+ android:layout_height="wrap_content"+ android:clipToPadding="false"+ android:paddingStart="8dp"+ android:paddingEnd="8dp"+ android:scrollbars="none">++ <com.google.android.material.chip.ChipGroup+ android:id="@+id/mapFilterChips"+ android:layout_width="wrap_content"+ android:layout_height="wrap_content"+ app:selectionRequired="true"+ app:singleLine="true"+ app:singleSelection="true" />+ </HorizontalScrollView>+<!-- Bottom controls --><LinearLayoutandroid:id="@+id/controls"android:layout_width="match_parent"android:layout_height="wrap_content"- android:layout_gravity="bottom"android:background="?android:attr/colorBackground"android:gravity="center_vertical"android:orientation="horizontal"@@ -84,15 +109,8 @@style="@style/Widget.MaterialComponents.Button.OutlinedButton"android:layout_width="0dp"android:layout_height="wrap_content"- android:layout_marginEnd="4dp"android:layout_weight="1"android:text="Traces" />-- <com.google.android.material.chip.Chip- android:id="@+id/showAllChip"- style="@style/Widget.MaterialComponents.Chip.Filter"- android:layout_width="wrap_content"- android:layout_height="wrap_content"- android:text="All devices" />+ </LinearLayout></LinearLayout></FrameLayout>diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xmlindex ee85cf5..4a184ae 100644--- a/app/src/main/res/values-night/colors.xml+++ b/app/src/main/res/values-night/colors.xml@@ -1,4 +1,6 @@<resources>+ <color name="brand_highlight">#4DD0C4</color>+ <color name="brand_on_highlight">#00201D</color><color name="scope">#80CBC4</color><color name="scope_text">#AAB2DFDB</color><color name="trace">#FF8A5B</color>diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xmlindex 1bf715f..41756dd 100644--- a/app/src/main/res/values/attrs.xml+++ b/app/src/main/res/values/attrs.xml@@ -7,4 +7,8 @@<!-- Action bar colours for the styled themes. --><attr name="rfBarColor" format="color" /><attr name="rfTitleColor" format="color" />+ <!-- Highlight for selected chips and toggles, readable on the theme background+ (the styled themes fall back to colorPrimary / colorOnPrimary). -->+ <attr name="rfAccent" format="color" />+ <attr name="rfOnAccent" format="color" /></resources>diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xmlindex 164db64..f7e1b32 100644--- a/app/src/main/res/values/colors.xml+++ b/app/src/main/res/values/colors.xml@@ -2,6 +2,9 @@<color name="brand_primary">#0B5C63</color><color name="brand_primary_dark">#073F44</color><color name="brand_accent">#E0622D</color>+ <!-- Selected chips / toggles: dark teal on light backgrounds, light teal on dark ones. -->+ <color name="brand_highlight">#0B5C63</color>+ <color name="brand_on_highlight">#FFFFFF</color><color name="ic_launcher_background">#0B5C63</color><color name="match_tag_bg">#C8431A</color>diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xmlindex 4b0851e..e1524b6 100644--- a/app/src/main/res/values/themes.xml+++ b/app/src/main/res/values/themes.xml@@ -11,6 +11,8 @@<item name="rfScopeColor">@color/scope</item><item name="rfScopeTextColor">@color/scope_text</item><item name="rfTraceColor">@color/trace</item>+ <item name="rfAccent">@color/brand_highlight</item>+ <item name="rfOnAccent">@color/brand_on_highlight</item></style><!-- Material You: Material 3 components; colours come from the wallpaper@@ -46,17 +48,9 @@<item name="rfScopeColor">@color/dedsec_green</item><item name="rfScopeTextColor">@color/dedsec_green</item><item name="rfTraceColor">@color/dedsec_magenta</item>- <!-- Cut corners on buttons, chips and cards: terminal / street-art edges. -->- <item name="shapeAppearanceSmallComponent">@style/DedSec.Cut</item>- <item name="shapeAppearanceMediumComponent">@style/DedSec.Cut</item><item name="colorAccent">@color/dedsec_magenta</item></style>- <style name="DedSec.Cut" parent="">- <item name="cornerFamily">cut</item>- <item name="cornerSize">7dp</item>- </style>-<style name="DedSec.ActionBar" parent="Widget.MaterialComponents.ActionBar.Solid"><item name="background">@color/dedsec_black</item><item name="titleTextStyle">@style/DedSec.ActionBarTitle</item>