Your phone, on your command. Gotcha is world's first fully on-device AI copilot for Android that turns natural language into real device actions — safely.
feat: Update appearance settings and improve visual consistency by refining text explanations and adjusting color values
Durganshu Mishra28b25338391c
diff --git a/app/src/main/java/com/gotcha/ui/AppearanceScreen.kt b/app/src/main/java/com/gotcha/ui/AppearanceScreen.ktindex b2426fd..c092ad5 100644--- a/app/src/main/java/com/gotcha/ui/AppearanceScreen.kt+++ b/app/src/main/java/com/gotcha/ui/AppearanceScreen.kt@@ -94,19 +94,25 @@ fun AppearanceScreen(HorizontalDivider(thickness = 1.dp)- Text(- text = tierExplanation(tier),- style = MaterialTheme.typography.bodySmall,- color = MaterialTheme.colorScheme.onSurfaceVariant- )+ tierExplanation(tier)?.let { note ->+ Text(+ text = note,+ style = MaterialTheme.typography.bodySmall,+ color = MaterialTheme.colorScheme.onSurfaceVariant+ )+ }}}-/** Says what this device is actually doing, rather than what the theme wishes it did. */-private fun tierExplanation(tier: GlassTier): String = when (tier) {+/**+ * Says what this device is doing, but only when that differs from what the theme+ * was designed to do. Live blur is the normal case on anything from API 31, and+ * announcing the default is noise on a page whose job is choosing a theme.+ */+private fun tierExplanation(tier: GlassTier): String? = when (tier) {GlassTier.SOLID -> "Battery saver is on, so the theme is drawn flat until it's off."- GlassTier.LIVE -> "Panels blur what's behind them."GlassTier.STATIC -> "Live blur isn't available on this device, so panels use a fixed frost."+ GlassTier.LIVE -> null}private const val TILES_PER_ROW = 2diff --git a/app/src/main/java/com/gotcha/ui/theme/Backdrop.kt b/app/src/main/java/com/gotcha/ui/theme/Backdrop.ktindex 5dd3944..e034def 100644--- a/app/src/main/java/com/gotcha/ui/theme/Backdrop.kt+++ b/app/src/main/java/com/gotcha/ui/theme/Backdrop.kt@@ -166,8 +166,16 @@ private val Facets = listOf(listOf(0.78f to 0.72f, 1f to 0.34f, 1f to 1f))-/** Varied so adjacent shards separate; the glass over them does the softening. */-private val FacetAlpha = listOf(0.92f, 0.62f, 1f, 0.52f, 0.84f, 0.58f, 0.96f)+/**+ * Per-facet opacity, ordered against the colour each facet draws.+ *+ * The ramp's warm end is far lighter than its violet end, so painting coral and+ * salmon at the same strength as violet put shards on screen that were brighter+ * than the text over them — measured 1.53:1, which is not readable by any+ * standard. The light stops are held well back so every shard stays a dark+ * ground for type; the geometry reads from hue, not from brightness.+ */+private val FacetAlpha = listOf(0.95f, 0.75f, 0.50f, 0.35f, 0.30f, 0.65f, 0.55f)private fun DrawScope.drawFacets(stops: List<Color>) {if (stops.isEmpty()) returndiff --git a/app/src/main/java/com/gotcha/ui/theme/Color.kt b/app/src/main/java/com/gotcha/ui/theme/Color.ktindex 85b05de..5e435e0 100644--- a/app/src/main/java/com/gotcha/ui/theme/Color.kt+++ b/app/src/main/java/com/gotcha/ui/theme/Color.kt@@ -87,8 +87,8 @@ val NocturneGround = Color(0xFF0A050E)val NocturnePanel = Color(0x8F1A1020)val NocturnePanelHigh = Color(0x40FFFFFF)val NocturneInk = Color(0xFFF7EAF1)-val NocturneInkDim = Color(0xFFB69EC0)-val NocturneOutline = Color(0xFF4A3355)+val NocturneInkDim = Color(0xFFD7C6E0)+val NocturneOutline = Color(0xFF6B5478)val NocturneOnSalmon = Color(0xFF3D0A16)val NocturneSalmonContainer = Color(0xFF5C1A2A)val NocturneMagentaContainer = Color(0xFF3A1140)diff --git a/app/src/main/java/com/gotcha/ui/theme/GlassTier.kt b/app/src/main/java/com/gotcha/ui/theme/GlassTier.ktindex 796316a..73e5ad6 100644--- a/app/src/main/java/com/gotcha/ui/theme/GlassTier.kt+++ b/app/src/main/java/com/gotcha/ui/theme/GlassTier.kt@@ -7,7 +7,6 @@ import android.content.Intentimport android.content.IntentFilterimport android.os.Buildimport android.os.PowerManager-import android.view.WindowManagerimport androidx.compose.runtime.Composableimport androidx.compose.runtime.DisposableEffectimport androidx.compose.runtime.getValue@@ -17,7 +16,6 @@ import androidx.compose.runtime.setValueimport androidx.compose.runtime.staticCompositionLocalOfimport androidx.compose.ui.platform.LocalContextimport androidx.core.content.ContextCompat-import java.util.function.Consumer/*** How much of the glass this device can actually make.@@ -45,10 +43,16 @@ enum class GlassTier {val LocalGlassTier = staticCompositionLocalOf { GlassTier.STATIC }/**- * Resolves the tier and keeps it current. Two of the inputs flip while the app- * is running — battery saver, and the system-wide blur toggle in developer- * options — so both are observed rather than sampled once at startup.+ * Resolves the tier and keeps it current. Battery saver flips while the app is+ * running, so it is observed rather than sampled once at startup.*+ * The blur test is deliberately just the API level. This used to ask+ * `WindowManager.isCrossWindowBlurEnabled()`, which is a different capability:+ * it reports whether a *window* may blur what is behind it — the+ * `setBackgroundBlurRadius` path — and OEMs routinely ship with it off. Our+ * backdrop uses `Modifier.blur`, a RenderEffect inside our own window, which+ * works on any hardware-accelerated device from API 31 regardless. The wrong+ * question told modern phones they could not do something they do fine.*/@Composablefun rememberGlassTier(): GlassTier {@@ -73,11 +77,7 @@ fun rememberGlassTier(): GlassTier {onDispose { runCatching { context.unregisterReceiver(receiver) } }}- var blurAvailable by remember { mutableStateOf(systemBlurEnabled(context)) }- DisposableEffect(context) {- val listener = crossWindowBlurListener(context) { blurAvailable = it }- onDispose { listener?.invoke() }- }+ val canBlur = Build.VERSION.SDK_INT >= Build.VERSION_CODES.Sval lowRam = remember(context) {(context.getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager).isLowRamDevice@@ -85,30 +85,7 @@ fun rememberGlassTier(): GlassTier {return when {powerSaving -> GlassTier.SOLID- blurAvailable && !lowRam -> GlassTier.LIVE+ canBlur && !lowRam -> GlassTier.LIVEelse -> GlassTier.STATIC}}--/** Whether the platform will render blur at all right now. API 31+ only. */-private fun systemBlurEnabled(context: Context): Boolean {- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return false- val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager- return wm.isCrossWindowBlurEnabled-}--/**- * Subscribes to the platform blur toggle, returning the un-subscribe call — or- * null on Android 11, where the toggle does not exist and the answer can never- * change.- */-private fun crossWindowBlurListener(- context: Context,- onChange: (Boolean) -> Unit-): (() -> Unit)? {- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.S) return null- val wm = context.getSystemService(Context.WINDOW_SERVICE) as WindowManager- val listener = Consumer<Boolean> { enabled -> onChange(enabled) }- wm.addCrossWindowBlurEnabledListener(listener)- return { wm.removeCrossWindowBlurEnabledListener(listener) }-}diff --git a/app/src/main/java/com/gotcha/ui/theme/Skin.kt b/app/src/main/java/com/gotcha/ui/theme/Skin.ktindex bf23aee..e9ff137 100644--- a/app/src/main/java/com/gotcha/ui/theme/Skin.kt+++ b/app/src/main/java/com/gotcha/ui/theme/Skin.kt@@ -319,7 +319,8 @@ object Skins {wallpaper = listOf(BrandViolet, BrandMagenta, BrandRose, BrandCoral, BrandSalmon),frost = 18.dp,grain = 0.06f,- scrim = 0.10f,+ // Enough veil to keep every shard behind the text rather than beside it.+ scrim = 0.18f,corner = 20.dp)