From a41b370ea4a0e9ac1805c4cb424cd185edf177c3 Mon Sep 17 00:00:00 2001 From: zefutoff Date: Thu, 8 Oct 2026 21:43:46 +0200 Subject: [PATCH 1/2] feat: add application visual identity --- CHANGELOG.md | 1 + ROADMAP.md | 2 +- .../unofficial/VisualIdentityManifestTest.kt | 74 +++++++++++++++++++ app/src/main/AndroidManifest.xml | 5 +- .../unofficial/MainActivity.kt | 2 +- .../res/drawable/ic_launcher_foreground.xml | 31 ++++++++ .../res/drawable/ic_launcher_monochrome.xml | 34 +++++++++ .../main/res/drawable/ic_qs_grammalecte.xml | 25 ++++++- .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 ++ .../res/mipmap-anydpi-v33/ic_launcher.xml | 6 ++ .../main/res/mipmap-anydpi/ic_launcher.xml | 23 ++++++ app/src/main/res/values-night/colors.xml | 1 + app/src/main/res/values-night/styles.xml | 15 +++- app/src/main/res/values/colors.xml | 3 + app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/styles.xml | 15 +++- 16 files changed, 235 insertions(+), 8 deletions(-) create mode 100644 app/src/androidTest/kotlin/fr/grammalecteandroid/unofficial/VisualIdentityManifestTest.kt create mode 100644 app/src/main/res/drawable/ic_launcher_foreground.xml create mode 100644 app/src/main/res/drawable/ic_launcher_monochrome.xml create mode 100644 app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml create mode 100644 app/src/main/res/mipmap-anydpi/ic_launcher.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index eebce43..9d4f1db 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), - Versioned JSON import/export for non-sensitive correction preferences, using Android's system document picker without storage permissions; the personal dictionary is intentionally excluded. - Dedicated correction status screen showing the native Android spell-checker and Grammalecte IME activation/selection state, with direct access to the relevant system settings. - First-run setup guide explaining the three correction modes, showing live activation state and providing direct access to the relevant Android settings; the guide is shown once automatically and remains available from the main screen. +- Application visual identity with adaptive and themed launcher icons, a matching Quick Settings icon, branded accent colors and a concise launcher label. ### Changed diff --git a/ROADMAP.md b/ROADMAP.md index dcb154e..c5fae2b 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -88,7 +88,7 @@ Exit criterion: correction remains usable in common editable applications even w ## Phase 4 — Product polish -- [ ] Application icon and visual identity +- [x] Application icon and visual identity - [x] Improve first-run setup - [x] Explain the three correction modes in-app - [ ] Improve accessibility of the application UI diff --git a/app/src/androidTest/kotlin/fr/grammalecteandroid/unofficial/VisualIdentityManifestTest.kt b/app/src/androidTest/kotlin/fr/grammalecteandroid/unofficial/VisualIdentityManifestTest.kt new file mode 100644 index 0000000..f1e16ed --- /dev/null +++ b/app/src/androidTest/kotlin/fr/grammalecteandroid/unofficial/VisualIdentityManifestTest.kt @@ -0,0 +1,74 @@ +package fr.grammalecteandroid.unofficial + +import android.content.ComponentName +import android.content.Context +import android.content.pm.PackageManager +import androidx.test.core.app.ApplicationProvider +import androidx.test.ext.junit.runners.AndroidJUnit4 +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNotNull +import org.junit.Test +import org.junit.runner.RunWith + +@RunWith(AndroidJUnit4::class) +class VisualIdentityManifestTest { + @Suppress("DEPRECATION") + @Test + fun visualIdentityResourcesAreWiredToAndroidComponents() { + val context = + ApplicationProvider.getApplicationContext() + + val packageManager = + context.packageManager + + val application = + packageManager.getApplicationInfo( + context.packageName, + PackageManager.GET_META_DATA, + ) + + assertEquals( + R.mipmap.ic_launcher, + application.icon, + ) + + assertNotNull( + application.loadIcon( + packageManager, + ), + ) + + assertEquals( + "Grammalecte Android (non officiel)", + application.loadLabel(packageManager).toString(), + ) + + val mainActivity = + packageManager.getActivityInfo( + ComponentName( + context, + MainActivity::class.java, + ), + PackageManager.GET_META_DATA, + ) + + assertEquals( + "Grammalecte", + mainActivity.loadLabel(packageManager).toString(), + ) + + val tileService = + packageManager.getServiceInfo( + ComponentName( + context, + GrammalecteTileService::class.java, + ), + PackageManager.GET_META_DATA, + ) + + assertEquals( + R.drawable.ic_qs_grammalecte, + tileService.icon, + ) + } +} diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index faec563..6eea1e6 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,7 +2,9 @@ @@ -24,7 +26,8 @@ + android:exported="true" + android:label="@string/launcher_name"> diff --git a/app/src/main/kotlin/fr/grammalecteandroid/unofficial/MainActivity.kt b/app/src/main/kotlin/fr/grammalecteandroid/unofficial/MainActivity.kt index 9b88a91..6fa7b01 100644 --- a/app/src/main/kotlin/fr/grammalecteandroid/unofficial/MainActivity.kt +++ b/app/src/main/kotlin/fr/grammalecteandroid/unofficial/MainActivity.kt @@ -78,7 +78,7 @@ class MainActivity : ) setTextColor( - getColor(R.color.surface_text), + getColor(R.color.brand_primary), ) }, matchWrapParams(), diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml new file mode 100644 index 0000000..997ccd6 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_foreground.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher_monochrome.xml b/app/src/main/res/drawable/ic_launcher_monochrome.xml new file mode 100644 index 0000000..2dbb91a --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher_monochrome.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_qs_grammalecte.xml b/app/src/main/res/drawable/ic_qs_grammalecte.xml index 5255b0e..91221ff 100644 --- a/app/src/main/res/drawable/ic_qs_grammalecte.xml +++ b/app/src/main/res/drawable/ic_qs_grammalecte.xml @@ -4,7 +4,30 @@ android:height="24dp" android:viewportWidth="24" android:viewportHeight="24"> + + + + + + + + + + android:pathData="M11.5,17L14,19.5L19,14L20.5,15.5L14,22L10,18Z" /> diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..3e765ce --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml new file mode 100644 index 0000000..f3b45f7 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v33/ic_launcher.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/app/src/main/res/mipmap-anydpi/ic_launcher.xml b/app/src/main/res/mipmap-anydpi/ic_launcher.xml new file mode 100644 index 0000000..0c135b8 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi/ic_launcher.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index a2f576d..d006952 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -4,4 +4,5 @@ #FF242428 #FFF1F1F1 #FFC4C4CC + #FFC7D2FE diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index f9a32a2..a5c9f99 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -6,7 +6,13 @@ @color/surface_background @color/surface_background @color/surface_text - + + @color/brand_primary + @color/brand_primary + @color/surface_background + @color/surface_background + false + false + + @color/brand_primary + @color/brand_primary + @color/surface_background + false + false diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index bf9d215..6ba5813 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -4,4 +4,7 @@ #FFE9E9EC #FF202124 #FF5F6368 + #FF4338CA + #FF4338CA + #FF22C55E diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 55161b5..fe4b3a2 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,6 +1,7 @@ Grammalecte Android (non officiel) + Grammalecte Grammalecte Android Correcteur français local basé sur Grammalecte. Aucun texte n’est envoyé sur Internet. Pour l’activer : Paramètres Android → Système → Langues et saisie → Correcteur orthographique, puis choisissez Grammalecte Android. diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 575c1ef..3a10820 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -6,7 +6,13 @@ @color/surface_background @color/surface_background @color/surface_text - + + @color/brand_primary + @color/brand_primary + @color/surface_background + @color/surface_background + true + true + + @color/brand_primary + @color/brand_primary + @color/surface_background + true + true From fb6fd4f66f2380bcf84788f67873d8f187eaf7cc Mon Sep 17 00:00:00 2001 From: zefutoff Date: Thu, 8 Oct 2026 21:51:04 +0200 Subject: [PATCH 2/2] fix: support API 26 theme resources --- app/src/main/res/values-night/styles.xml | 4 ++-- app/src/main/res/values/styles.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/res/values-night/styles.xml b/app/src/main/res/values-night/styles.xml index a5c9f99..a5e34eb 100644 --- a/app/src/main/res/values-night/styles.xml +++ b/app/src/main/res/values-night/styles.xml @@ -12,7 +12,7 @@ @color/surface_background @color/surface_background false - false + + diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 3a10820..17b8954 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -12,7 +12,7 @@ @color/surface_background @color/surface_background true - true + +