Initial Android app scaffold
Compose + Material 3 with dynamic color and the branding palette as static fallback, edge-to-edge drawing, SplashScreen API, and predictive back. Adaptive launcher icon includes a monochrome variant for themed icons; the mark itself is a placeholder pending icon design. No Play Services or Firebase anywhere in the dependency tree, verified against the resolved runtime classpath. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
commit
6d63d92766
26 files changed
+891
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea
|
||||
.DS_Store
|
||||
/build
|
||||
/app/build
|
||||
/captures
|
||||
.externalNativeBuild
|
||||
.cxx
|
||||
local.properties
|
||||
@@ -0,0 +1,22 @@
|
||||
# tern-android
|
||||
|
||||
Android client for [Tern](../) — see [`docs/android-client-spec.md`](docs/android-client-spec.md) and [`docs/branding-spec.md`](docs/branding-spec.md).
|
||||
|
||||
**Status: thin scaffold.** The server (IMAP sync + REST API) was the priority for this first pass, and the Android client is the last item in the build order anyway (`server-architecture-spec.md` §9, item 8). What's here:
|
||||
|
||||
- Jetpack Compose + Material 3, Kotlin, no Play Services/Firebase anywhere in the dependency tree (§7 — hard constraint).
|
||||
- Dynamic color (Material You) with the branding doc's static palette as the fallback (§2).
|
||||
- Edge-to-edge drawing, `SplashScreen` API, predictive back enabled in the manifest (§3, §6).
|
||||
- Adaptive-layout dependencies present for the list-detail scaffold (§4), not yet used.
|
||||
- Adaptive launcher icon with a **monochrome/themed variant** (§2 / branding §2) — placeholder wing mark, since the real icon design is still an open item in the branding doc.
|
||||
- `allowBackup="false"` — the mail cache shouldn't land in cloud backups (§7).
|
||||
|
||||
**Not built yet:** the list-detail mail UI, Room cache, UnifiedPush receiver + `MessagingStyle` notifications, swipe actions, biometric app-lock, first-run/account-setup flow. All of those depend on client-facing server work that also isn't finished.
|
||||
|
||||
## Building
|
||||
|
||||
```bash
|
||||
./gradlew assembleDebug
|
||||
```
|
||||
|
||||
Needs an Android SDK (`ANDROID_HOME` / `local.properties`). Version pins (AGP 8.7, Kotlin 2.0.21, Compose BOM 2024.10.01, compileSdk 35) are deliberately conservative — Android Studio may offer an AGP upgrade on first open, which is fine to accept.
|
||||
@@ -0,0 +1,75 @@
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
id("org.jetbrains.kotlin.plugin.compose")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "pl.mtps.tern"
|
||||
compileSdk = 35
|
||||
|
||||
defaultConfig {
|
||||
applicationId = "pl.mtps.tern"
|
||||
// GrapheneOS/modern-Pixel-only target (android-client-spec.md §1) —
|
||||
// no need to support old platform versions for a from-scratch app.
|
||||
minSdk = 29
|
||||
targetSdk = 35
|
||||
versionCode = 1
|
||||
versionName = "0.1.0"
|
||||
|
||||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
isMinifyEnabled = true
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
|
||||
buildFeatures {
|
||||
compose = true
|
||||
}
|
||||
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/{AL2.0,LGPL2.1}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(platform("androidx.compose:compose-bom:2024.10.01"))
|
||||
|
||||
implementation("androidx.core:core-ktx:1.13.1")
|
||||
implementation("androidx.core:core-splashscreen:1.0.1") // Android 12+ SplashScreen API (§6)
|
||||
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.8.7")
|
||||
implementation("androidx.activity:activity-compose:1.9.3")
|
||||
|
||||
implementation("androidx.compose.ui:ui")
|
||||
implementation("androidx.compose.ui:ui-graphics")
|
||||
implementation("androidx.compose.ui:ui-tooling-preview")
|
||||
implementation("androidx.compose.material3:material3")
|
||||
implementation("androidx.compose.material3.adaptive:adaptive:1.0.0")
|
||||
implementation("androidx.compose.material3.adaptive:adaptive-layout:1.0.0")
|
||||
implementation("androidx.compose.material3.adaptive:adaptive-navigation:1.0.0")
|
||||
implementation("androidx.compose.material:material-icons-core")
|
||||
|
||||
debugImplementation("androidx.compose.ui:ui-tooling")
|
||||
debugImplementation("androidx.compose.ui:ui-test-manifest")
|
||||
|
||||
testImplementation("junit:junit:4.13.2")
|
||||
androidTestImplementation(platform("androidx.compose:compose-bom:2024.10.01"))
|
||||
androidTestImplementation("androidx.test.ext:junit:1.2.1")
|
||||
androidTestImplementation("androidx.test.espresso:espresso-core:3.6.1")
|
||||
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
|
||||
}
|
||||
Vendored
+2
@@ -0,0 +1,2 @@
|
||||
# Add project-specific ProGuard rules here as the app grows.
|
||||
# https://developer.android.com/build/shrink-code
|
||||
@@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<!-- Requested contextually at runtime, not on first launch (§5). -->
|
||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||
|
||||
<application
|
||||
android:name=".TernApplication"
|
||||
android:label="@string/app_name"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:roundIcon="@mipmap/ic_launcher_round"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.Tern.Splash"
|
||||
android:enableOnBackInvokedCallback="true"
|
||||
android:allowBackup="false"
|
||||
android:fullBackupContent="false">
|
||||
|
||||
<activity
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:theme="@style/Theme.Tern.Splash"
|
||||
android:windowSoftInputMode="adjustResize"
|
||||
android:resizeableActivity="true"
|
||||
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize|keyboardHidden|uiMode">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
@@ -0,0 +1,47 @@
|
||||
package pl.mtps.tern
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.enableEdgeToEdge
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Scaffold
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
|
||||
import pl.mtps.tern.ui.theme.TernTheme
|
||||
|
||||
class MainActivity : ComponentActivity() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
installSplashScreen()
|
||||
// Draw behind status bar and gesture nav area (§3) — Scaffold below
|
||||
// handles the inset padding.
|
||||
enableEdgeToEdge()
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
setContent {
|
||||
TernTheme {
|
||||
Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->
|
||||
PlaceholderScreen(Modifier.padding(innerPadding))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun PlaceholderScreen(modifier: Modifier = Modifier) {
|
||||
Column(modifier = modifier.padding(16.dp)) {
|
||||
Text(text = "Tern", style = MaterialTheme.typography.headlineMedium)
|
||||
Text(
|
||||
text = "Scaffold only. The list-detail mail UI, UnifiedPush notifications, " +
|
||||
"and the local Room cache land in a later phase.",
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package pl.mtps.tern
|
||||
|
||||
import android.app.Application
|
||||
|
||||
class TernApplication : Application()
|
||||
@@ -0,0 +1,24 @@
|
||||
package pl.mtps.tern.ui.theme
|
||||
|
||||
import androidx.compose.ui.graphics.Color
|
||||
|
||||
// Static fallback palette from branding-spec.md §1. Only used when dynamic
|
||||
// color isn't available — when it is, the system wallpaper palette takes over
|
||||
// (android-client-spec.md §2).
|
||||
//
|
||||
// Note: the branding doc calls for deriving a full M3 tonal scheme from these
|
||||
// five seeds (via Material Theme Builder, seeding on --accent) rather than
|
||||
// hand-placing raw values into color roles. These raw values are a
|
||||
// placeholder until that generation step happens.
|
||||
|
||||
val LightText = Color(0xFF0C0A10)
|
||||
val LightBackground = Color(0xFFF4F3F7)
|
||||
val LightPrimary = Color(0xFF988FA8)
|
||||
val LightSecondary = Color(0xFFC3C7D5)
|
||||
val LightAccent = Color(0xFFF39A39)
|
||||
|
||||
val DarkText = Color(0xFFF1EFF5)
|
||||
val DarkBackground = Color(0xFF09080C)
|
||||
val DarkPrimary = Color(0xFF605770)
|
||||
val DarkSecondary = Color(0xFF2A2E3C)
|
||||
val DarkAccent = Color(0xFFC66C0C)
|
||||
@@ -0,0 +1,59 @@
|
||||
package pl.mtps.tern.ui.theme
|
||||
|
||||
import android.os.Build
|
||||
import androidx.compose.foundation.isSystemInDarkTheme
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.darkColorScheme
|
||||
import androidx.compose.material3.dynamicDarkColorScheme
|
||||
import androidx.compose.material3.dynamicLightColorScheme
|
||||
import androidx.compose.material3.lightColorScheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.platform.LocalContext
|
||||
|
||||
enum class ThemeMode { LIGHT, DARK, SYSTEM }
|
||||
|
||||
private val LightColors = lightColorScheme(
|
||||
primary = LightPrimary,
|
||||
secondary = LightSecondary,
|
||||
tertiary = LightAccent,
|
||||
background = LightBackground,
|
||||
surface = LightBackground,
|
||||
onBackground = LightText,
|
||||
onSurface = LightText,
|
||||
)
|
||||
|
||||
private val DarkColors = darkColorScheme(
|
||||
primary = DarkPrimary,
|
||||
secondary = DarkSecondary,
|
||||
tertiary = DarkAccent,
|
||||
background = DarkBackground,
|
||||
surface = DarkBackground,
|
||||
onBackground = DarkText,
|
||||
onSurface = DarkText,
|
||||
)
|
||||
|
||||
@Composable
|
||||
fun TernTheme(
|
||||
themeMode: ThemeMode = ThemeMode.SYSTEM,
|
||||
// Material You wallpaper-derived color where available (§2), static
|
||||
// brand palette otherwise.
|
||||
dynamicColor: Boolean = true,
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
val darkTheme = when (themeMode) {
|
||||
ThemeMode.LIGHT -> false
|
||||
ThemeMode.DARK -> true
|
||||
ThemeMode.SYSTEM -> isSystemInDarkTheme()
|
||||
}
|
||||
|
||||
val colorScheme = when {
|
||||
dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {
|
||||
val context = LocalContext.current
|
||||
if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)
|
||||
}
|
||||
darkTheme -> DarkColors
|
||||
else -> LightColors
|
||||
}
|
||||
|
||||
MaterialTheme(colorScheme = colorScheme, content = content)
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<!-- The "primary" token (dark theme value) from branding-spec.md §1 -->
|
||||
<path android:fillColor="#605770" android:pathData="M0,0h108v108h-108z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<!-- Placeholder mark within the adaptive-icon safe zone (branding-spec.md
|
||||
§2's wing/chevron fallback direction) — real icon design is an open
|
||||
item in that doc, this just keeps the launcher from being blank. -->
|
||||
<path
|
||||
android:fillColor="#F39A39"
|
||||
android:pathData="M54,34 L76,60 L64,60 L54,48 L44,60 L32,60 Z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="108dp"
|
||||
android:height="108dp"
|
||||
android:viewportWidth="108"
|
||||
android:viewportHeight="108">
|
||||
<!-- Themed/monochrome variant (API 33+, branding-spec.md §2) — single
|
||||
color, tinted by the system to match dynamic color at runtime. -->
|
||||
<path
|
||||
android:fillColor="#FF000000"
|
||||
android:pathData="M54,34 L76,60 L64,60 L54,48 L44,60 L32,60 Z" />
|
||||
</vector>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_monochrome" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?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" />
|
||||
<monochrome android:drawable="@drawable/ic_launcher_monochrome" />
|
||||
</adaptive-icon>
|
||||
@@ -0,0 +1,5 @@
|
||||
<resources>
|
||||
<!-- Static fallback palette from branding-spec.md §1 (light variant) —
|
||||
used pre-Compose, before dynamic color / in-app theme can apply. -->
|
||||
<color name="splash_background">#F4F3F7</color>
|
||||
</resources>
|
||||
@@ -0,0 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Tern</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,12 @@
|
||||
<resources xmlns:tools="http://schemas.android.com/tools">
|
||||
<!-- SplashScreen API needs an XML theme even though the rest of the UI
|
||||
is Compose (android-client-spec.md §6 — SplashScreen API, not a
|
||||
custom splash Activity). -->
|
||||
<style name="Theme.Tern.Splash" parent="Theme.SplashScreen">
|
||||
<item name="windowSplashScreenBackground">@color/splash_background</item>
|
||||
<item name="windowSplashScreenAnimatedIcon">@mipmap/ic_launcher</item>
|
||||
<item name="postSplashScreenTheme">@style/Theme.Tern</item>
|
||||
</style>
|
||||
|
||||
<style name="Theme.Tern" parent="android:Theme.Material.Light.NoActionBar" />
|
||||
</resources>
|
||||
@@ -0,0 +1,7 @@
|
||||
plugins {
|
||||
id("com.android.application") version "8.7.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "2.0.21" apply false
|
||||
// Kotlin 2.0+ moved the Compose compiler out of AGP into its own plugin,
|
||||
// versioned alongside Kotlin itself.
|
||||
id("org.jetbrains.kotlin.plugin.compose") version "2.0.21" apply false
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
# Android Client — Design & UI/UX Doc
|
||||
|
||||
Companion to the server architecture spec. Covers the Android client only; webapp UI/UX will be a separate doc.
|
||||
|
||||
---
|
||||
|
||||
## 1. Goals
|
||||
|
||||
- Modern, native-feeling Android app — built for the latest platform conventions, not a cross-platform shell.
|
||||
- Full support for Material You (dynamic color), light/dark/system theming, and gesture navigation.
|
||||
- Runs cleanly on GrapheneOS: no Play Services/Firebase dependency anywhere.
|
||||
|
||||
---
|
||||
|
||||
## 2. Theming
|
||||
|
||||
- **Dynamic color (Material You)**: pull the user's system wallpaper-derived color scheme via `dynamicLightColorScheme()` / `dynamicDarkColorScheme()` (Material 3). Fall back to a defined static brand palette on API levels below 12 or if dynamic color is unavailable.
|
||||
- **Theme modes**: Light / Dark / Follow system — standard three-way setting, default to "follow system."
|
||||
- **Material 3, not Material 2**: build on Jetpack Compose + Material 3 from the start. Dynamic color, adaptive layout, and current motion patterns are all designed around M3 — implementing this on the View system means re-building what M3 already gives you.
|
||||
- Consider Material 3 **Expressive** (2025 update) for shape/motion personality, so the app doesn't read as "generic M3 from 2022."
|
||||
- **Themed (monochrome) adaptive app icon** (API 33+) — so the launcher icon also tints to match the system dynamic color, not just in-app surfaces.
|
||||
|
||||
---
|
||||
|
||||
## 3. Navigation & Gestures
|
||||
|
||||
- **Edge-to-edge by default**: draw behind the status bar and gesture nav area; use Compose `Scaffold` inset handling, and explicitly pad any custom bottom sheets, FABs, or snackbars that aren't covered by it.
|
||||
- **No dependency on a bottom nav bar area as a safe zone** — assume gesture nav (no persistent system bar) is the common case.
|
||||
- **Predictive back gesture** (API 34+): implement `PredictiveBackHandler` so back-swipes show the live preview/animation. High-value here since back is core to the list → thread → back flow.
|
||||
- **Swipe actions on list rows** (archive/delete/tag): trigger from anywhere on the row, not from a screen edge — an edge-anchored swipe will conflict with the system back gesture.
|
||||
|
||||
---
|
||||
|
||||
## 4. Adaptive Layout
|
||||
|
||||
- Build **list-detail (two-pane)** layout from the start using Material 3 adaptive scaffold components — single pane on phones, list+reading-pane side by side on tablets/foldables/large screens.
|
||||
- Support **multi-window / resizable activity** — expected default behavior, not an edge case.
|
||||
- Respect system font scaling; avoid hardcoded `sp`/`dp` values that break at larger accessibility text sizes.
|
||||
|
||||
---
|
||||
|
||||
## 5. Notifications
|
||||
|
||||
- **Conversation-style notifications** (`MessagingStyle`), grouped per thread — a busy thread shouldn't produce a flood of separate notifications.
|
||||
- **Direct actions from the notification shade**: archive, mark read, and (consider) quick reply — ties into the server's rule engine/API rather than being client-only logic.
|
||||
- **Runtime `POST_NOTIFICATIONS` permission** (API 33+): request contextually (e.g. right before enabling push, or on first sync success) rather than blindly on first launch.
|
||||
- Delivery path stays as previously scoped: **UnifiedPush** as the primary transport (no FCM/Play Services), content-free payloads that just trigger a pull-sync over the authenticated API.
|
||||
|
||||
---
|
||||
|
||||
## 6. Launch & First-Run
|
||||
|
||||
- Use the Android 12+ **SplashScreen API** for a themed, consistent launch — not a custom splash `Activity`.
|
||||
- First-run flow: connect to server → add account(s) → grant notification permission (contextually, see §5) → optional app-lock setup (see §7).
|
||||
|
||||
---
|
||||
|
||||
## 7. Privacy & Security (client-side)
|
||||
|
||||
- **No Firebase/Play Services dependency**, anywhere in the dependency tree — hard constraint, not just for push. Watch for libraries that pull these in transitively (e.g. certain analytics/crash-reporting SDKs, in-app review APIs).
|
||||
- **Optional biometric/PIN app-lock** (`BiometricPrompt`) as a privacy layer independent of the account/API auth — email is sensitive, and a phone-unlock-only model may not be enough for some users.
|
||||
- Local cache (Room/SQLite) should be treated as sensitive data — standard Android app-sandboxing applies, but avoid writing anything email-related to shared/world-readable storage, logs, or backups you haven't thought through (consider `android:allowBackup` implications for a mail cache).
|
||||
|
||||
---
|
||||
|
||||
## 8. Accessibility
|
||||
|
||||
- TalkBack content descriptions on all icon-only actions (archive/delete/tag/star icons etc. — anything without a visible text label).
|
||||
- Font scaling support (§4) doubles as an accessibility requirement, not just a layout nicety.
|
||||
- Sufficient contrast/touch-target sizing — Material 3 defaults mostly cover this, but custom components (swipe actions, compact list rows) need explicit checking.
|
||||
|
||||
---
|
||||
|
||||
## 9. Background & Sync Efficiency
|
||||
|
||||
- Sync is push-driven (UnifiedPush), not polled — this already plays well with Doze/App Standby battery restrictions.
|
||||
- Push-triggered sync work should run via `WorkManager` (or a foreground service only if genuinely long-running/user-visible, e.g. active large-attachment download) rather than fighting Android's background execution limits with raw services.
|
||||
|
||||
---
|
||||
|
||||
## 10. Open Items for Later
|
||||
|
||||
- Quick-reply-from-notification: how much composition capability lives in the notification action vs. requiring opening the app — revisit once the main compose UI is designed.
|
||||
- App-lock: PIN-only fallback if biometrics aren't enrolled/available — needs its own small flow.
|
||||
- Whether swipe actions are user-configurable (e.g. left-swipe = archive vs. delete) — a preference, not a hardcoded default, likely worth adding once core UX is validated.
|
||||
@@ -0,0 +1,80 @@
|
||||
# Tern — Branding Doc
|
||||
|
||||
Name decided: **Tern**. This doc covers default color palette and icon direction; the naming shortlist that led here is kept in §4 for reference.
|
||||
|
||||
Ties into the theming decisions in the Android and webapp design docs (Android: dynamic color where available, static fallback otherwise; webapp: static palette only, decided).
|
||||
|
||||
---
|
||||
|
||||
## 1. Default Color Palette — Decided
|
||||
|
||||
Palette is set (exported from a color design tool, values below are the ones that matter — treat the original export's other syntax as noise):
|
||||
|
||||
```css
|
||||
:root[data-theme="light"] {
|
||||
--text: #0c0a10;
|
||||
--background: #f4f3f7;
|
||||
--primary: #988fa8;
|
||||
--secondary: #c3c7d5;
|
||||
--accent: #f39a39;
|
||||
}
|
||||
:root[data-theme="dark"] {
|
||||
--text: #f1eff5;
|
||||
--background: #09080c;
|
||||
--primary: #605770;
|
||||
--secondary: #2a2e3c;
|
||||
--accent: #c66c0c;
|
||||
}
|
||||
```
|
||||
|
||||
Reads as a muted violet-grey primary/secondary pair with a warm orange accent — matches the "calm, not loud" direction from the original brief well, and the orange accent avoids the sea-of-blue-mail-icons problem noted below (§2).
|
||||
|
||||
**Where each token is used, roughly:**
|
||||
- `--text` / `--background`: base page text and surface.
|
||||
- `--primary`: the app's dominant UI color — nav/sidebar surfaces, primary buttons, selected states.
|
||||
- `--secondary`: secondary surfaces — borders, dividers, unselected/inactive UI, hover backgrounds.
|
||||
- `--accent`: sparingly, for things that need to stand out from the calm primary/secondary — unread indicators, the compose button, notification badges, links.
|
||||
|
||||
**Applies to both clients:**
|
||||
- **Webapp**: this is the actual palette, consumed directly as CSS custom properties (see the webapp design doc, §4) — no generation step needed, it's already final.
|
||||
- **Android**: use this as the **static fallback palette** (API <12, or dynamic color disabled) — derive a Material 3-compatible tonal scheme from these five colors (e.g. via Material Theme Builder, feeding `--accent` in as the seed) rather than hand-placing them into Compose's color roles one at a time, so you get correctly-contrasted tonal variants (hover/pressed/disabled states, surface elevation) rather than just the five raw values. When dynamic color *is* active, the system wallpaper palette takes over as designed — this fallback only matters when it isn't available.
|
||||
|
||||
**Neutral/surface colors**: `--background`/`--secondary` already cover the two ends of a light/dark neutral scale; if more granular surface elevation levels are needed (e.g. Material 3's surface-container tiers on Android), interpolate between them rather than introducing new unrelated greys.
|
||||
|
||||
---
|
||||
|
||||
## 2. Icon Direction
|
||||
|
||||
- **Keep it a single, simple mark** — one shape, one or two colors max, works down to a 24×24 favicon and up to a 512×512 store listing without needing different detail levels.
|
||||
- **Avoid an envelope glyph** — it's the single most overused email-app icon shape (Gmail, Outlook, Apple Mail, Thunderbird, Spark, and dozens of others all use envelope variants), so it's the hardest shape to make distinctive and the easiest to blend into a phone's homescreen. With "Tern" as the name, there's a natural way out of this anyway (below).
|
||||
- **Bird mark, tied to the name**: a simple geometric tern silhouette — a forked-tail, in-flight wing shape reads clearly at small sizes and is fairly distinctive as a category (most mail-app icons are envelopes or abstract blobs, not birds). Keep it abstracted/geometric rather than a literal illustrated bird — a few clean angular strokes, not feather detail — so it holds up at 16×16 and doesn't read as twee at 512×512.
|
||||
- Alternative if the literal bird ends up feeling too cute in practice: a single wing/chevron shape alone (implying flight/motion without being a full bird), using the `--accent` orange (§1) so the icon and app color are inherently linked.
|
||||
|
||||
**Required export set** (ties to both client docs):
|
||||
- 192×192 and 512×512 standard icons (webapp manifest)
|
||||
- A **maskable** variant (safe-zone padding so it isn't clipped when the OS applies its own mask shape) for both Android and PWA install
|
||||
- A **monochrome/themed** variant (single-color silhouette, API 33+) so the Android launcher icon can tint to the system's dynamic color instead of showing your static brand color on every homescreen
|
||||
- Standard favicon sizes (16×16, 32×32) generated down from the same master mark, not redrawn separately
|
||||
|
||||
---
|
||||
|
||||
## 3. Open Items for Later
|
||||
|
||||
- **Do a real trademark/domain search for "Tern"** before treating the name as final — the check that led here (§4) was a quick sanity pass, not a clearance search.
|
||||
- Wordmark/typeface pairing for "Tern" — not addressed here, worth a short follow-up now that naming is settled.
|
||||
- Whether the icon mark shows up anywhere in the webapp UI itself (e.g. empty states, loading screens) or stays purely an app-icon/favicon asset.
|
||||
|
||||
---
|
||||
|
||||
## 4. Naming Shortlist (reference — decision already made, kept for context)
|
||||
|
||||
Other directions considered before settling on **Tern**, in case any of these end up useful later (a product line name, a subdomain, etc.). Worth knowing up front: **Postbox**, **Thunderbird**, **K-9 Mail**, **Dove**, **Spark**, **Mailbird**, **BlueMail** are all existing, actively-used email client names that were avoided.
|
||||
|
||||
- **Nook** — evokes a small, quiet, personal space rather than a busy inbox.
|
||||
- **Fen** — short, calm, slightly unusual, memorable as a wordmark.
|
||||
- **Quire** — old word for a set of folded pages (paper/letters association) without being on-the-nose "mail."
|
||||
- **Parcel** — evokes something arriving, distinct from "inbox"/"mail" clichés. (Also used by an unrelated JS build-tool project — fine for an unrelated category, but worth knowing.)
|
||||
- **Envoy** — "the thing that carries the message."
|
||||
- **Petrel** — same bird family as Tern, if a different specific bird ever appealed more.
|
||||
- **Fetch** — plain, references the IMAP-fetch mechanic directly.
|
||||
- **Relay** — technically accurate (it relays between IMAP and you), clean word, easy to pronounce in multiple languages.
|
||||
@@ -0,0 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
|
||||
android.useAndroidX=true
|
||||
kotlin.code.style=official
|
||||
android.nonTransitiveRClass=true
|
||||
Vendored
BIN
Binary file not shown.
+7
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,252 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
|
||||
' "$PWD" ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC2039,SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command:
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
||||
# and any embedded shellness will be escaped.
|
||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
||||
# treated as '${Hostname}' itself on the command line.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+94
@@ -0,0 +1,94 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
@rem SPDX-License-Identifier: Apache-2.0
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo. 1>&2
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
||||
echo. 1>&2
|
||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
||||
echo location of your Java installation. 1>&2
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -0,0 +1,18 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
dependencyResolutionManagement {
|
||||
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
}
|
||||
|
||||
rootProject.name = "tern-android"
|
||||
include(":app")
|
||||
Reference in new issue
Block a user