[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c63f178a300: Make the Emacs icon ``adaptive''
From: |
Po Lu |
Subject: |
master c63f178a300: Make the Emacs icon ``adaptive'' |
Date: |
Mon, 21 Aug 2023 02:40:08 -0400 (EDT) |
branch: master
commit c63f178a3008be5f735580817ebab008bbc5257b
Author: Po Lu <luangruo@yahoo.com>
Commit: Po Lu <luangruo@yahoo.com>
Make the Emacs icon ``adaptive''
* java/AndroidManifest.xml.in (EmacsApplication): Set icon to
@mipmap/emacs_icon.
* java/org/gnu/emacs/EmacsService.java (onStartCommand): Pick a
better name for the persistent notification channel.
* java/res/drawable/emacs_background.xml:
* java/res/drawable/emacs_foreground.xml:
* java/res/mipmap/emacs_icon.png:
* java/res/mipmap-v26/emacs_icon.xml: New files, comprising an
``adaptive icon'' required by some Android launchers.
---
java/AndroidManifest.xml.in | 2 +-
java/org/gnu/emacs/EmacsService.java | 2 +-
java/res/drawable/emacs_background.xml | 42 ++++++++++++++++++++++++++
java/res/drawable/emacs_foreground.xml | 53 +++++++++++++++++++++++++++++++++
java/res/mipmap-v26/emacs_icon.xml | 23 ++++++++++++++
java/res/mipmap/emacs_icon.png | Bin 0 -> 13462 bytes
6 files changed, 120 insertions(+), 2 deletions(-)
diff --git a/java/AndroidManifest.xml.in b/java/AndroidManifest.xml.in
index b9cda401c9d..2cbcdbc3e5b 100644
--- a/java/AndroidManifest.xml.in
+++ b/java/AndroidManifest.xml.in
@@ -76,7 +76,7 @@ along with GNU Emacs. If not, see
<https://www.gnu.org/licenses/>. -->
<application android:name="org.gnu.emacs.EmacsApplication"
android:label="Emacs"
- android:icon="@drawable/emacs"
+ android:icon="@mipmap/emacs_icon"
android:hardwareAccelerated="true"
android:supportsRtl="true"
android:theme="@style/EmacsStyle"
diff --git a/java/org/gnu/emacs/EmacsService.java
b/java/org/gnu/emacs/EmacsService.java
index 19ce67c59b7..404796cd08c 100644
--- a/java/org/gnu/emacs/EmacsService.java
+++ b/java/org/gnu/emacs/EmacsService.java
@@ -171,7 +171,7 @@ public final class EmacsService extends Service
+ " may disable it if you want;"
+ " see (emacs)Android Environment.");
channel
- = new NotificationChannel ("emacs", "Emacs persistent notification",
+ = new NotificationChannel ("emacs", "Emacs Background Service",
NotificationManager.IMPORTANCE_DEFAULT);
manager.createNotificationChannel (channel);
notification = (new Notification.Builder (this, "emacs")
diff --git a/java/res/drawable/emacs_background.xml
b/java/res/drawable/emacs_background.xml
new file mode 100644
index 00000000000..c4562d754d5
--- /dev/null
+++ b/java/res/drawable/emacs_background.xml
@@ -0,0 +1,42 @@
+<!-- Adaptive icon for Emacs.
+
+Copyright (C) 2023 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
+
+<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="512"
+ android:viewportHeight="512">
+ <path
+ android:pathData="M-4.99,-5.79h521.12v526.76h-521.12z"
+ android:strokeWidth="10.6667">
+ <aapt:attr name="android:fillColor">
+ <gradient
+ android:startX="0"
+ android:startY="0"
+ android:endX="512"
+ android:endY="512"
+ android:type="linear">
+ <item android:offset="0" android:color="#FF8381C5"/>
+ <item android:offset="0.34" android:color="#FE806BBC"/>
+ <item android:offset="1" android:color="#FDA52ECB"/>
+ </gradient>
+ </aapt:attr>
+ </path>
+</vector>
diff --git a/java/res/drawable/emacs_foreground.xml
b/java/res/drawable/emacs_foreground.xml
new file mode 100644
index 00000000000..ff9e854d038
--- /dev/null
+++ b/java/res/drawable/emacs_foreground.xml
@@ -0,0 +1,53 @@
+<!-- Adaptive icon for Emacs.
+
+Copyright (C) 2023 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
+
+<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="512"
+ android:viewportHeight="512">
+ <group android:scaleX="0.6"
+ android:scaleY="0.6"
+ android:translateX="102.4"
+ android:translateY="102.4">
+ <path
+ android:pathData="M0,0h512v512h-512z">
+ <aapt:attr name="android:fillColor">
+ <gradient
+ android:startX="-0"
+ android:startY="256"
+ android:endX="512"
+ android:endY="256"
+ android:type="linear">
+ <item android:offset="1" android:color="#00000000"/>
+ <item android:offset="1" android:color="#FF5B2A85"/>
+ </gradient>
+ </aapt:attr>
+ </path>
+ <path
+ android:pathData="m174.83,422.11c0,0 19.74,1.4 45.13,-0.84 10.28,-0.91
49.33,-4.74 78.52,-11.14 0,0 35.59,-7.62 54.63,-14.63 19.92,-7.34 30.76,-13.57
35.64,-22.4 -0.21,-1.81 1.5,-8.22 -7.68,-12.08 -23.49,-9.85 -50.73,-8.07
-104.63,-9.21 -59.78,-2.05 -79.66,-12.06 -90.26,-20.12 -10.16,-8.18
-5.05,-30.79 38.47,-50.71 21.92,-10.61 107.87,-30.19 107.87,-30.19
-28.95,-14.31 -82.92,-39.46 -94.01,-44.89 -9.73,-4.76 -25.3,-11.94
-28.68,-20.61 -3.83,-8.33 9.04,-15.51 16.22,-17.56 23.14,-6 [...]
+ android:strokeLineJoin="miter"
+ android:strokeWidth="0"
+ android:fillColor="#ffffff"
+ android:strokeColor="#000000"
+ android:fillType="evenOdd"
+ android:strokeLineCap="butt"/>
+ </group>
+</vector>
diff --git a/java/res/mipmap-v26/emacs_icon.xml
b/java/res/mipmap-v26/emacs_icon.xml
new file mode 100644
index 00000000000..9f070e3f3d2
--- /dev/null
+++ b/java/res/mipmap-v26/emacs_icon.xml
@@ -0,0 +1,23 @@
+<!-- Adaptive icon for Emacs.
+
+Copyright (C) 2023 Free Software Foundation, Inc.
+
+This file is part of GNU Emacs.
+
+GNU Emacs is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+GNU Emacs is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. -->
+
+<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
+ <background android:drawable="@drawable/emacs_background"/>
+ <foreground android:drawable="@drawable/emacs_foreground"/>
+</adaptive-icon>
diff --git a/java/res/mipmap/emacs_icon.png b/java/res/mipmap/emacs_icon.png
new file mode 100644
index 00000000000..9ab43d704be
Binary files /dev/null and b/java/res/mipmap/emacs_icon.png differ
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master c63f178a300: Make the Emacs icon ``adaptive'',
Po Lu <=