summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--android/app/src/main/AndroidManifest.xml6
-rw-r--r--android/app/src/main/java/org/terst/doot/widget/ui/DashboardActivity.kt10
-rw-r--r--android/app/src/main/java/org/terst/doot/widget/ui/SettingsActivity.kt2
-rw-r--r--android/app/src/main/res/drawable/ic_launcher_background.xml21
-rw-r--r--android/app/src/main/res/drawable/ic_launcher_foreground.xml18
-rw-r--r--android/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml5
-rw-r--r--android/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml5
-rw-r--r--android/app/src/main/res/values/strings.xml2
-rw-r--r--android/app/src/main/res/values/themes.xml5
-rw-r--r--web/templates/settings.html2
10 files changed, 68 insertions, 8 deletions
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</title> 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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Same indigo->purple gradient as web/static/favicon.svg -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:aapt="http://schemas.android.com/aapt"
+ android:width="108dp"
+ android:height="108dp"
+ android:viewportWidth="108"
+ android:viewportHeight="108">
+ <path android:pathData="M0,0h108v108h-108z">
+ <aapt:attr name="android:fillColor">
+ <gradient
+ android:type="linear"
+ android:startX="0"
+ android:startY="0"
+ android:endX="108"
+ android:endY="108"
+ android:startColor="#6366f1"
+ android:endColor="#a855f7" />
+ </aapt:attr>
+ </path>
+</vector>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- The favicon.svg checkmark (M30,50 L45,65 L70,35 in a 100x100 viewport),
+ scaled 1:1.08 into this 108x108 adaptive-icon foreground layer. Already
+ sits well inside the safe zone (inner 72dp) since the source path's
+ bounding box only spans the middle 40% of its viewport. -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:width="108dp"
+ android:height="108dp"
+ android:viewportWidth="108"
+ android:viewportHeight="108">
+ <path
+ android:pathData="M32.4,54 L48.6,70.2 L75.6,37.8"
+ android:strokeColor="#FFFFFF"
+ android:strokeWidth="10.8"
+ android:strokeLineCap="round"
+ android:strokeLineJoin="round"
+ android:fillColor="#00000000" />
+</vector>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@drawable/ic_launcher_background" />
+ <foreground android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>
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 @@
+<?xml version="1.0" encoding="utf-8"?>
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@drawable/ic_launcher_background" />
+ <foreground android:drawable="@drawable/ic_launcher_foreground" />
+</adaptive-icon>
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 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">Doot Widget</string>
+ <string name="app_name">doot</string>
</resources>
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 @@
<item name="android:windowNoTitle">true</item>
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
+
+ <!-- DashboardActivity draws its own Compose TopAppBar; without this, the
+ app-wide DayNight theme's native ActionBar renders as a second bar
+ above it. -->
+ <style name="Theme.Dashboard" parent="android:Theme.DeviceDefault.NoActionBar" />
</resources>
diff --git a/web/templates/settings.html b/web/templates/settings.html
index 3bb143c..9c1869f 100644
--- a/web/templates/settings.html
+++ b/web/templates/settings.html
@@ -15,7 +15,7 @@
</head>
<body class="bg-slate-950 text-slate-200 min-h-screen p-4 sm:p-8" hx-headers='{"X-CSRF-Token": "{{.CSRFToken}}"}'>
<div class="max-w-4xl mx-auto">
- <a href="/" class="inline-block mb-6 text-slate-400 hover:text-white transition-colors">&larr; Back to Dashboard</a>
+ <a href="/" onclick="if (window.history.length > 1) { history.back(); return false; }" class="inline-block mb-6 text-slate-400 hover:text-white transition-colors">&larr; Back to Dashboard</a>
<h1 class="text-4xl font-light text-white mb-2 tracking-tight">Settings</h1>
<p class="text-slate-400 mb-10">Configure feature toggles and data sources.</p>