0841a0a33f
A 140dp draggable bubble shows the same map / tier scrim / user dot / ALPR dots that the in-app circle does, on top of any other app, while scanning is on. Tap = brings the host app forward; drag = repositions. - Manifest: add SYSTEM_ALERT_WINDOW (special-access — granted via system Settings page, not the runtime prompt). - Settings: add overlayEnabled flag (default off) + a "Display over other apps" section in SettingsScreen. Flipping the toggle to on fires Settings.ACTION_MANAGE_OVERLAY_PERMISSION so the user can grant via the system page; if they deny or revoke, the OverlayMgr re-checks canDrawOverlays() at every show() call and silently no-ops, no crash. - New OverlayManager: owns the WindowManager view at TYPE_APPLICATION_OVERLAY with FLAG_NOT_FOCUSABLE | FLAG_NOT_TOUCH_MODAL so touches outside the bubble pass through and the bubble never steals IME focus. Custom OverlayOwner implementing LifecycleOwner + SavedStateRegistryOwner since LifecycleService doesn't satisfy SSR (Compose's ComposeView requires both via the view tree). - Drag/tap handler at the View layer: rawX/rawY math for the drag, TAP_SLOP_PX guard to discriminate tap from drag, tap launches MainActivity (FLAG_ACTIVITY_NEW_TASK | SINGLE_TOP). - New OverlayBubble composable: smaller (140dp) self-contained version of the in-app threat circle that pulls running/threat/location/ mapPoints/proximity from the same companion StateFlows. Shared dot-drawable helper extracted into ui/MarkerIcons.kt. - DetectionService observes settings.overlayEnabled in beginScanning and toggles the overlay; endScanning hides it.
68 lines
1.6 KiB
Kotlin
68 lines
1.6 KiB
Kotlin
plugins {
|
|
alias(libs.plugins.android.application)
|
|
alias(libs.plugins.kotlin.android)
|
|
alias(libs.plugins.kotlin.compose)
|
|
}
|
|
|
|
android {
|
|
namespace = "org.soulstone.overwatch"
|
|
compileSdk = 35
|
|
|
|
defaultConfig {
|
|
applicationId = "org.soulstone.overwatch"
|
|
minSdk = 26
|
|
targetSdk = 35
|
|
versionCode = 12
|
|
versionName = "0.3.0"
|
|
}
|
|
|
|
buildTypes {
|
|
release {
|
|
isMinifyEnabled = false
|
|
proguardFiles(
|
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
|
"proguard-rules.pro"
|
|
)
|
|
}
|
|
}
|
|
|
|
compileOptions {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
}
|
|
|
|
kotlin {
|
|
jvmToolchain(17)
|
|
}
|
|
|
|
buildFeatures {
|
|
compose = true
|
|
buildConfig = true
|
|
}
|
|
|
|
packaging {
|
|
resources {
|
|
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation(libs.androidx.core.ktx)
|
|
implementation(libs.androidx.lifecycle.runtime.ktx)
|
|
implementation(libs.androidx.lifecycle.service)
|
|
implementation(libs.androidx.activity.compose)
|
|
|
|
implementation(platform(libs.androidx.compose.bom))
|
|
implementation(libs.androidx.compose.ui)
|
|
implementation(libs.androidx.compose.ui.graphics)
|
|
implementation(libs.androidx.compose.ui.tooling.preview)
|
|
implementation(libs.androidx.compose.material3)
|
|
implementation(libs.androidx.compose.material.icons.extended)
|
|
|
|
implementation(libs.play.services.location)
|
|
implementation(libs.osmdroid.android)
|
|
|
|
debugImplementation(libs.androidx.compose.ui.tooling)
|
|
}
|