From f7d18eae924a221f12293c3063e46b791468623f Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Thu, 6 Aug 2026 17:32:08 +0000 Subject: Widget: real launcher icon, fix double title bar, rename app to "doot" Icon: adaptive-icon vector launcher icon reusing web/static/favicon.svg's brand mark (indigo->purple gradient square, white checkmark) so the app and web dashboard visually match. minSdk 36 (per build.gradle.kts) means mipmap-anydpi-v26 alone is sufficient, no legacy PNG fallback needed. Double title bar: DashboardActivity inherited the app-wide Theme.DeviceDefault.DayNight, which has a native ActionBar, stacked on top of the new Compose TopAppBar from the last commit -- visibly two bars, showing "Doot" (static ActionBar label) above "Personal Dashboard" (the Compose bar tracking the web page's own ). Added Theme.Dashboard (NoActionBar) for the activity, and stopped tracking the WebView's document.title for the Compose bar's title text -- the dashboard is a single HTMX-swapped page (see DashboardActivity's class doc), so the title never meaningfully changes, and it was just producing a second, differently-branded piece of text. Renamed the app from "Doot Widget" to "doot" throughout (application label, widget-picker description, Settings screen heading) to match the project's actual branding. Also: the web Settings page's "Back to Dashboard" link was a plain <a href="/">, which in the WebView pushes a NEW history entry for "/" instead of reusing the one already on the stack -- so Settings <-> Home round trips kept growing the WebView back-stack ("zigzag"), and the in-app back arrow/hardware back key never actually unwound it. Now it calls history.back() when there's stack to pop, falling back to a plain navigation only if there isn't (e.g. Settings opened directly). Verified on emulator-5556: rebuilt and reinstalled, confirmed a single title bar (no native ActionBar behind the Compose one), confirmed the launcher icon renders (checked via Settings > App info, since this AVD's launcher doesn't expose an app drawer over adb), no crashes. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EZ7ikw2ukGJFTHE3bJS7zL --- android/app/src/main/AndroidManifest.xml | 6 ++++-- .../org/terst/doot/widget/ui/DashboardActivity.kt | 10 +++++++--- .../org/terst/doot/widget/ui/SettingsActivity.kt | 2 +- .../main/res/drawable/ic_launcher_background.xml | 21 +++++++++++++++++++++ .../main/res/drawable/ic_launcher_foreground.xml | 18 ++++++++++++++++++ .../src/main/res/mipmap-anydpi-v26/ic_launcher.xml | 5 +++++ .../res/mipmap-anydpi-v26/ic_launcher_round.xml | 5 +++++ android/app/src/main/res/values/strings.xml | 2 +- android/app/src/main/res/values/themes.xml | 5 +++++ 9 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 android/app/src/main/res/drawable/ic_launcher_background.xml create mode 100644 android/app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml (limited to 'android/app/src/main') diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index db97b1b..58a6062 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -6,7 +6,9 @@ <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <application - android:label="Doot Widget" + android:label="doot" + android:icon="@mipmap/ic_launcher" + android:roundIcon="@mipmap/ic_launcher_round" android:theme="@android:style/Theme.DeviceDefault.DayNight" android:allowBackup="false"> @@ -39,7 +41,7 @@ <activity android:name=".ui.DashboardActivity" android:exported="true" - android:label="Doot"> + android:theme="@style/Theme.Dashboard"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> diff --git a/android/app/src/main/java/org/terst/doot/widget/ui/DashboardActivity.kt b/android/app/src/main/java/org/terst/doot/widget/ui/DashboardActivity.kt index 159b416..c7cdfaa 100644 --- a/android/app/src/main/java/org/terst/doot/widget/ui/DashboardActivity.kt +++ b/android/app/src/main/java/org/terst/doot/widget/ui/DashboardActivity.kt @@ -59,13 +59,18 @@ class DashboardActivity : ComponentActivity() { MaterialTheme(colorScheme = darkColorScheme()) { var serverUrl by remember { mutableStateOf<String?>(null) } var canGoBack by remember { mutableStateOf(false) } - var pageTitle by remember { mutableStateOf("Doot") } val context = LocalContext.current Scaffold( topBar = { TopAppBar( - title = { Text(pageTitle) }, + // Static, not tracking the WebView's document.title: the + // dashboard is a single HTMX-swapped page (see class doc), + // so title never meaningfully changes, and showing the + // page's own <title>Personal Dashboard here just + // reads as two different app names stacked on top of + // each other. + title = { Text("doot") }, navigationIcon = { if (canGoBack) { IconButton(onClick = { webViewRef?.goBack() }) { @@ -112,7 +117,6 @@ class DashboardActivity : ComponentActivity() { override fun onPageFinished(view: WebView, url: String?) { canGoBack = view.canGoBack() - pageTitle = view.title?.takeIf { it.isNotBlank() } ?: "Doot" } } } diff --git a/android/app/src/main/java/org/terst/doot/widget/ui/SettingsActivity.kt b/android/app/src/main/java/org/terst/doot/widget/ui/SettingsActivity.kt index 9b77621..50f51ac 100644 --- a/android/app/src/main/java/org/terst/doot/widget/ui/SettingsActivity.kt +++ b/android/app/src/main/java/org/terst/doot/widget/ui/SettingsActivity.kt @@ -161,7 +161,7 @@ fun SettingsScreen( .padding(24.dp), verticalArrangement = Arrangement.spacedBy(16.dp, Alignment.CenterVertically) ) { - Text("Doot Widget", style = MaterialTheme.typography.headlineMedium) + Text("doot", style = MaterialTheme.typography.headlineMedium) Text( "Enter your doot server URL and the WIDGET_TOKEN from your .env file.", style = MaterialTheme.typography.bodyMedium, diff --git a/android/app/src/main/res/drawable/ic_launcher_background.xml b/android/app/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000..5642471 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,21 @@ + + + + + + + + + diff --git a/android/app/src/main/res/drawable/ic_launcher_foreground.xml b/android/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..25c2105 --- /dev/null +++ b/android/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..6b78462 --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml new file mode 100644 index 0000000..6b78462 --- /dev/null +++ b/android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 2e4e6fc..7224a8a 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,4 +1,4 @@ - Doot Widget + doot diff --git a/android/app/src/main/res/values/themes.xml b/android/app/src/main/res/values/themes.xml index ef88823..0a3e5d3 100644 --- a/android/app/src/main/res/values/themes.xml +++ b/android/app/src/main/res/values/themes.xml @@ -8,4 +8,9 @@ true @android:color/transparent + + +