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
Main screen: themes with a banner tuck it under a see-through title bar; no Idle note in the visual style (the Start button says it)
CIS-C03af0aac3404f
diff --git a/app/src/main/java/com/rfsentinel/app/MainActivity.kt b/app/src/main/java/com/rfsentinel/app/MainActivity.ktindex d8df408..adf55d9 100644--- a/app/src/main/java/com/rfsentinel/app/MainActivity.kt+++ b/app/src/main/java/com/rfsentinel/app/MainActivity.kt@@ -79,9 +79,26 @@ class MainActivity : AppCompatActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)+ // Styled themes with a banner: the title bar sits over the banner's top, so the banner takes less room.+ val tucked = hasThemeHeader()+ if (tucked) supportRequestWindowFeature(androidx.appcompat.app.AppCompatDelegate.FEATURE_SUPPORT_ACTION_BAR_OVERLAY)binding = ActivityMainBinding.inflate(layoutInflater)setContentView(binding.root)binding.root.applySystemBarInsets()+ if (tucked) supportActionBar?.apply {+ // A soft dark fade keeps the title and icons readable over the art.+ setBackgroundDrawable(android.graphics.drawable.GradientDrawable(android.graphics.drawable.GradientDrawable.Orientation.TOP_BOTTOM,+ intArrayOf(0xD9000000.toInt(), 0x80000000.toInt(), 0x00000000)))+ elevation = 0f+ }+ if (tucked) {+ // The content is still laid out below the title bar: pull the banner up under it.+ val tv = android.util.TypedValue()+ val bar = if (theme.resolveAttribute(androidx.appcompat.R.attr.actionBarSize, tv, true))+ android.util.TypedValue.complexToDimensionPixelSize(tv.data, resources.displayMetrics) else 0+ binding.root.clipToPadding = false+ (binding.themedHeader.layoutParams as android.view.ViewGroup.MarginLayoutParams).topMargin = -bar+ }applyThemeHeader()adapter = DeviceAdapter(@@ -218,6 +235,13 @@ class MainActivity : AppCompatActivity() {}+ /** True when [applyThemeHeader] shows a header: a styled theme's wordmark or a custom theme's banner. */+ private fun hasThemeHeader(): Boolean {+ val theme = com.rfsentinel.app.ui.ThemeManager.current(this)+ return com.rfsentinel.app.ui.ThemeManager.headerStyle(this) != null ||+ (theme == com.rfsentinel.app.ui.ThemeManager.AppTheme.CUSTOM && com.rfsentinel.app.ui.ThemeManager.hasBanner(this))+ }+/** Styled themes: their own title, animated wordmark and the user's banner image. */private fun applyThemeHeader() {val theme = com.rfsentinel.app.ui.ThemeManager.current(this)diff --git a/app/src/main/java/com/rfsentinel/app/ui/StatusPanel.kt b/app/src/main/java/com/rfsentinel/app/ui/StatusPanel.ktindex 0ed7ecb..dc7b5b1 100644--- a/app/src/main/java/com/rfsentinel/app/ui/StatusPanel.kt+++ b/app/src/main/java/com/rfsentinel/app/ui/StatusPanel.kt@@ -10,7 +10,7 @@ import android.widget.LinearLayoutimport android.widget.TextView/**- * The main screen's status in the visual style: a warning chip when there is one, and the USB / ESP32+ * The main screen's status in the visual style: a warning chip while scanning when there is one, and the USB / ESP32* hardware. The hardware starts folded into one thin strip of chips (a coloured dot for its state and,* for the WiFi adapter and the RTL-SDR, its packets per second); tap the strip to unfold a card per* device with a line of its rate. ✕ hides the hardware until one of them changes state.@@ -84,7 +84,8 @@ class StatusPanel(private val context: Context) {/** [running]: scanning; [warning]: a fake-cell or restarted-scan note; [hardware]: the non-blank hardware status lines. */fun update(running: Boolean, warning: String?, hardware: List<Hardware>) {val grey = (ChipStyle.onSurface(context) and 0x00FFFFFF) or 0x99000000.toInt()- val shown = if (!running) "Idle - tap Start to listen for nearby devices" else warning?.let { "⚠ $it" }+ // Idle needs no note here: the Start button says it.+ val shown = if (!running) null else warning?.let { "⚠ $it" }note.visibility = if (shown != null) View.VISIBLE else View.GONEif (shown != null) {VisualMode.text(note, shown)diff --git a/app/src/test/java/com/rfsentinel/app/ui/StatusPanelTest.kt b/app/src/test/java/com/rfsentinel/app/ui/StatusPanelTest.ktindex 6068718..03949cf 100644--- a/app/src/test/java/com/rfsentinel/app/ui/StatusPanelTest.kt+++ b/app/src/test/java/com/rfsentinel/app/ui/StatusPanelTest.kt@@ -63,10 +63,10 @@ class StatusPanelTest {}@Test- fun warningAndIdleNote() {+ fun warningOnlyWhileScanning() {val p = StatusPanel(ctx).also { it.root.visibility = View.VISIBLE }p.update(running = false, warning = null, hardware = emptyList())- assertEquals(listOf("Idle - tap Start to listen for nearby devices"), shownTexts(p.root))+ assertEquals(emptyList<String>(), shownTexts(p.root))p.update(running = true, warning = "Bluetooth scan restarted", hardware = emptyList())assertEquals(listOf("⚠ Bluetooth scan restarted"), shownTexts(p.root))}