A tiny friend in your Mac's notch and on your iPhone that keeps an eye on your AI coding agents: Claude Code, Codex, Cursor, Gemini CLI, Antigravity and more. Approve from the notch or your Lock Screen.
Swift ai-agentsanthropicantigravityclaudeclaude-codecodexcursordynamic-islandgemini-cliiosiphonlinuxmacosmacos-appmenubar-appnotchopen-sourceswiftswiftuiwindows
Look: the theme follows the choice and the phone (status bar icons, window background, Material You)
Claude12b5f815b257
diff --git a/android/app/src/main/kotlin/com/coucou/android/MainActivity.kt b/android/app/src/main/kotlin/com/coucou/android/MainActivity.ktindex 1996f6e8..ddb948c2 100644--- a/android/app/src/main/kotlin/com/coucou/android/MainActivity.kt+++ b/android/app/src/main/kotlin/com/coucou/android/MainActivity.kt@@ -150,9 +150,14 @@ class MainActivity : ComponentActivity() {}model.resume()setContent {- CoucouTheme {- // The app is dark only: the status bar icons are always light.- SideEffect { WindowCompat.getInsetsController(window, window.decorView).isAppearanceLightStatusBars = false }+ CoucouTheme(model.settings.theme, model.settings.dynamicColour) {+ // Dark icons on a light page; the camera screen is black in both themes, so its icons are light.+ val lightPage = !tokens().isDark && screen != Screen.SCAN+ SideEffect {+ val bars = WindowCompat.getInsetsController(window, window.decorView)+ bars.isAppearanceLightStatusBars = lightPage+ bars.isAppearanceLightNavigationBars = lightPage+ }Surface(Modifier.fillMaxSize(), color = MaterialTheme.colorScheme.background) {Box(Modifier.fillMaxSize().windowInsetsPadding(if (screen == Screen.HOME || screen == Screen.SCAN) WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal + WindowInsetsSides.Bottom) else WindowInsets.safeDrawing)) {val tabs = Nav.tabs()diff --git a/android/app/src/main/kotlin/com/coucou/android/ui/Theme.kt b/android/app/src/main/kotlin/com/coucou/android/ui/Theme.ktindex 9cb71837..1e7d73e3 100644--- a/android/app/src/main/kotlin/com/coucou/android/ui/Theme.kt+++ b/android/app/src/main/kotlin/com/coucou/android/ui/Theme.kt@@ -1,27 +1,37 @@package com.coucou.android.ui+import android.os.Build+import androidx.compose.foundation.isSystemInDarkThemeimport androidx.compose.foundation.layout.fillMaxWidthimport androidx.compose.material3.Cardimport androidx.compose.material3.CardDefaultsimport androidx.compose.material3.ColorSchemeimport androidx.compose.material3.MaterialThemeimport androidx.compose.material3.darkColorScheme+import androidx.compose.material3.dynamicDarkColorScheme+import androidx.compose.material3.dynamicLightColorScheme+import androidx.compose.material3.lightColorSchemeimport androidx.compose.runtime.Composableimport androidx.compose.runtime.CompositionLocalProviderimport androidx.compose.ui.Modifierimport androidx.compose.ui.graphics.Color+import androidx.compose.ui.graphics.toArgb+import androidx.compose.ui.platform.LocalContextimport androidx.compose.ui.unit.dpimport com.coucou.android.core.Paletteimport com.coucou.android.core.StatusPalette+import com.coucou.android.core.ThemeChoice+import com.coucou.android.core.ThemePolicyimport com.coucou.android.core.Tokens/**- * The look of the Coucou website (docs/site.css): near-black page, slightly lighter cards with a thin- * border, soft blue accent, rounded corners and pill-shaped buttons. Mochi itself is untouched.+ * The look of the Coucou website (docs/site.css): a near-black page (or a pale one in the light theme), slightly lighter cards with a+ * thin border, soft blue accent, rounded corners and pill-shaped buttons. Mochi itself is untouched.*/private fun scheme(p: Palette, t: Tokens): ColorScheme {// Surfaces and text come from the tokens, the accent from Palette.- return darkColorScheme().copy(+ val base = if (t.isDark) darkColorScheme() else lightColorScheme()+ return base.copy(background = Color(t.bg), surface = Color(t.bg),surfaceVariant = Color(t.panel), surfaceContainer = Color(t.panel),onBackground = Color(t.text), onSurface = Color(t.text), onSurfaceVariant = Color(t.textDim),@@ -30,7 +40,19 @@ private fun scheme(p: Palette, t: Tokens): ColorScheme {)}-private val Dark = scheme(Palette.DARK, Tokens.DARK)+private fun Color.argb(): Long = toArgb().toLong() and 0xFFFFFFFFL++/** The tokens of the phone's own colours (Material You): surfaces, text and buttons from [cs]; the state and link colours stay ours. */+private fun fromDynamic(base: Tokens, cs: ColorScheme) = base.copy(+ bg = cs.surface.argb(), panel = cs.surfaceContainer.argb(), panel2 = cs.surfaceContainerHigh.argb(), line = cs.outlineVariant.argb(),+ text = cs.onSurface.argb(), textDim = cs.onSurfaceVariant.argb(), textFaint = cs.outline.argb(),+ primaryButton = cs.primary.argb(), onPrimaryButton = cs.onPrimary.argb(), secondaryButton = cs.secondaryContainer.argb(),+ danger = cs.error.argb(),+ hero = cs.surfaceContainerHigh.argb(), sheet = cs.surfaceContainerHigh.argb(),+ heroText = cs.onSurface.argb(), heroTextDim = cs.onSurfaceVariant.argb(),+ heroPrimary = cs.primary.argb(), heroOnPrimary = cs.onPrimary.argb(), heroButton = cs.secondaryContainer.argb(),+ heroLine = cs.outlineVariant.argb(),+)/** Link status colours (the dot next to "Connected"). */object StatusColors {@@ -39,10 +61,23 @@ object StatusColors {val offline = Color(StatusPalette.OFFLINE)}+/**+ * The theme: light, dark or the phone's own ([theme]), and optionally the phone's own colours ([dynamic], Android 12 and later).+ * Mochi, his colours and the state colours are the same in both.+ */@Composable-fun CoucouTheme(content: @Composable () -> Unit) {- CompositionLocalProvider(LocalTokens provides Tokens.DARK) {- MaterialTheme(colorScheme = Dark, content = content)+fun CoucouTheme(theme: ThemeChoice = ThemeChoice.SYSTEM, dynamic: Boolean = false, content: @Composable () -> Unit) {+ val dark = ThemePolicy.dark(theme, isSystemInDarkTheme())+ val context = LocalContext.current+ var tokens = if (dark) Tokens.DARK else Tokens.LIGHT+ var colours = scheme(if (dark) Palette.DARK else Palette.LIGHT, tokens)+ if (dynamic && ThemePolicy.dynamicAvailable(Build.VERSION.SDK_INT)) {+ val cs = if (dark) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)+ tokens = fromDynamic(tokens, cs)+ colours = cs+ }+ CompositionLocalProvider(LocalTokens provides tokens) {+ MaterialTheme(colorScheme = colours, content = content)}}diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xmlindex 262aec0a..bde5ba49 100644--- a/android/app/src/main/res/values/themes.xml+++ b/android/app/src/main/res/values/themes.xml@@ -1,7 +1,7 @@<?xml version="1.0" encoding="utf-8"?><resources>- <!-- Dark only (the UI itself is Compose). -->- <style name="Theme.Coucou" parent="android:Theme.DeviceDefault">+ <!-- Light or dark with the phone until Compose draws (the UI itself is Compose, with its own Theme setting). -->+ <style name="Theme.Coucou" parent="android:Theme.DeviceDefault.DayNight"><item name="android:windowActionBar">false</item><item name="android:windowNoTitle">true</item></style>