[Libreoffice-commits] online.git: android/app configure.ac loleaflet/Makefile.am

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Tue Dec 3 13:35:06 UTC 2019


 android/app/.gitignore                   |    7 +++++++
 android/app/appSettings.gradle.in        |    1 +
 android/app/build.gradle                 |    2 ++
 android/app/src/main/AndroidManifest.xml |    2 +-
 configure.ac                             |    3 +++
 loleaflet/Makefile.am                    |    1 +
 6 files changed, 15 insertions(+), 1 deletion(-)

New commits:
commit d87f06adef2de107ed83dcfd28c152d3297ca8b5
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Tue Dec 3 11:56:10 2019 +0100
Commit:     Jan Holesovsky <kendy at collabora.com>
CommitDate: Tue Dec 3 14:34:47 2019 +0100

    android: Add possibility to brand the launcher icon.
    
    Change-Id: I6cd531aab698236287eb7c20146caa61e34e8450
    Reviewed-on: https://gerrit.libreoffice.org/84328
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>
    Tested-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/android/app/.gitignore b/android/app/.gitignore
index 0e5159da5..827faa729 100644
--- a/android/app/.gitignore
+++ b/android/app/.gitignore
@@ -2,3 +2,10 @@
 /app.iml
 /build
 /appSettings.gradle
+/src/main/res/drawable/ic_launcher_brand.xml
+/src/main/res/mipmap-anydpi-v26/ic_launcher_brand.xml
+/src/main/res/mipmap-hdpi/ic_launcher_brand.png
+/src/main/res/mipmap-mdpi/ic_launcher_brand.png
+/src/main/res/mipmap-xhdpi/ic_launcher_brand.png
+/src/main/res/mipmap-xxhdpi/ic_launcher_brand.png
+/src/main/res/mipmap-xxxhdpi/ic_launcher_brand.png
diff --git a/android/app/appSettings.gradle.in b/android/app/appSettings.gradle.in
index 960ceee9e..e1f9662bc 100644
--- a/android/app/appSettings.gradle.in
+++ b/android/app/appSettings.gradle.in
@@ -4,6 +4,7 @@ ext {
     liboAppName         = '@APP_NAME@'
     liboVendor          = '@VENDOR@'
     liboInfoURL         = '@INFO_URL@'
+    liboLauncherIcon    = '@mipmap/@APP_IC_LAUNCHER@'
 }
 android.defaultConfig {
     applicationId '@ANDROID_PACKAGE_NAME@'
diff --git a/android/app/build.gradle b/android/app/build.gradle
index aae9c4bc0..80fe4a55a 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -15,6 +15,7 @@ android {
             resValue "string", "app_name", "${liboAppName} Debug"
             resValue "string", "vendor", "${liboVendor}"
             resValue "string", "info_url", "${liboInfoURL}"
+            manifestPlaceholders = [ appIcon: "${liboLauncherIcon}" ]
             ndk {
                 //abiFilters "x86", "armeabi-v7a", "armeabi"
                 abiFilters "armeabi-v7a"
@@ -27,6 +28,7 @@ android {
             resValue "string", "app_name", "${liboAppName}"
             resValue "string", "vendor", "${liboVendor}"
             resValue "string", "info_url", "${liboInfoURL}"
+            manifestPlaceholders = [ appIcon: "${liboLauncherIcon}" ]
             ndk {
                 abiFilters "armeabi-v7a"
             }
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index ae17c0878..fb584befd 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -18,7 +18,7 @@
     <application
         android:name=".LibreOfficeApplication"
         android:allowBackup="true"
-        android:icon="@mipmap/ic_launcher"
+        android:icon="${appIcon}"
         android:label="@string/app_name"
         android:supportsRtl="true"
         android:theme="@style/LibreOfficeTheme">
diff --git a/configure.ac b/configure.ac
index 9f4ca7af1..2aaf5c96f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -841,10 +841,13 @@ AC_CONFIG_LINKS([loleaflet/package.json:loleaflet/package.json])
 AC_LINK_FILES([loleaflet/archived-packages], [loleaflet/archived-packages])
 
 APP_BRANDING_DIR=
+APP_IC_LAUNCHER="ic_launcher"
 if test "$with_app_branding" != no -a -d "$with_app_branding"; then
     APP_BRANDING_DIR="$with_app_branding"
+    APP_IC_LAUNCHER="ic_launcher_brand"
 fi
 AC_SUBST(APP_BRANDING_DIR)
+AC_SUBST(APP_IC_LAUNCHER)
 
 AS_IF([test "$ENABLE_IOSAPP" = "true"],
       [
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index c412f71a3..e903d59fd 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -167,6 +167,7 @@ if ENABLE_ANDROIDAPP
 	@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/branding.css" "$(APP_BRANDING_DIR)/branding.js" $(abs_top_srcdir)/android/lib/src/main/assets/dist/ ; else touch $(abs_top_srcdir)/android/lib/src/main/assets/dist/branding.css ; fi
 	@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)"/images/*.svg $(abs_top_srcdir)/android/lib/src/main/assets/dist/images/ ; fi
 	@if test -d "$(APP_BRANDING_DIR)" ; then cp -a "$(APP_BRANDING_DIR)/images/toolbar-bg-logo.svg" $(abs_top_srcdir)/android/lib/src/main/assets/dist/images/toolbar-bg.svg ; fi
+	@if test -d "$(APP_BRANDING_DIR)/android" ; then for I in `cd "$(APP_BRANDING_DIR)/android" && find . -type f` ; do mkdir -p $(abs_top_srcdir)/android/lib/src/main/res/`dirname $$I` ; cp -a "$(APP_BRANDING_DIR)/android/$$I" "$(abs_top_srcdir)/android/app/src/main/res/$$I" ; done ; fi
 	@echo
 	@echo "Copied JS, HTML and CSS to the Android project (android/lib/src/main/assets/dist)."
 	@echo


More information about the Libreoffice-commits mailing list