android: Add possibility to brand the launcher icon.

Change-Id: I6cd531aab698236287eb7c20146caa61e34e8450
Reviewed-on: https://gerrit.libreoffice.org/84328
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Tested-by: Jan Holesovsky <kendy@collabora.com>
distro/collabora/code-4.2.0-3
Jan Holesovsky 2019-12-03 11:56:10 +01:00
parent 5f9e088fe6
commit d87f06adef
6 changed files with 15 additions and 1 deletions

View File

@ -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

View File

@ -4,6 +4,7 @@ ext {
liboAppName = '@APP_NAME@'
liboVendor = '@VENDOR@'
liboInfoURL = '@INFO_URL@'
liboLauncherIcon = '@mipmap/@APP_IC_LAUNCHER@'
}
android.defaultConfig {
applicationId '@ANDROID_PACKAGE_NAME@'

View File

@ -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"
}

View File

@ -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">

View File

@ -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"],
[

View File

@ -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