android/Bootstrap/Makefile.shared                                |    2 -
 android/Makefile                                                 |    4 +-
 android/source/build.gradle                                      |    3 -
 android/source/res/values-de/strings.xml                         |    2 -
 android/source/res/values-tr/strings.xml                         |    1 
 android/source/res/values/strings.xml                            |    2 -
 android/source/src/java/org/libreoffice/AboutDialogFragment.java |   18 
++++++----
 7 files changed, 16 insertions(+), 16 deletions(-)

New commits:
commit f9b9e702465b4de29153b49e077c70a0ad78c89d
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Nov 15 13:26:38 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Nov 15 18:26:41 2023 +0100

    android: Add button to open privacy URL
    
    In the About dialog, add a "Privacy Policy"
    button when a privacy URL is set, i.e.
    the `--with-privacy-policy-url=<URL>` autogen
    option is used.
    Clicking the button will fire an Intent
    to open that URL.
    
    Use a custom build config field as described at [1]
    to make the privacy policy URL available to
    the Java code.
    
    [1] 
https://developer.android.com/build/gradle-tips#share-custom-fields-and-resource-values-with-your-app-code
    
    Change-Id: I6e1a9aff885e4ce132284f49e722b3343fc51b79
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159445
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index ffb2c16a832d..682c98709630 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -113,5 +113,6 @@ liboSettings.gradle: $(BUILDDIR)/config_build.mk 
$(BUILDDIR)/config_host.mk
                && echo "    minSdkVersion = $(ANDROID_API_LEVEL)" \
                && echo "    versionCode project.hasProperty('cmdVersionCode') 
? cmdVersionCode.toInteger() : $(if $(versionCode),$(versionCode),1)" \
                && echo "    versionName 
'$(LIBO_VERSION_MAJOR).$(LIBO_VERSION_MINOR).$(LIBO_VERSION_MICRO).$(LIBO_VERSION_PATCH)$(LIBO_VERSION_SUFFIX)$(LIBO_VERSION_SUFFIX_SUFFIX)/$(shell
 cd $(SRCDIR) && git log -1 --format=%h)/$(OOO_VENDOR)'" \
+               && echo "    buildConfigField('String', 'PRIVACY_POLICY_URL', 
'\"$(PRIVACY_POLICY_URL)\"')" \
                && echo "}" \
        ) > $@
diff --git a/android/source/res/values-de/strings.xml 
b/android/source/res/values-de/strings.xml
index 88fdbaedd73d..bd979b78f8ae 100644
--- a/android/source/res/values-de/strings.xml
+++ b/android/source/res/values-de/strings.xml
@@ -13,6 +13,7 @@
 
     <string name="about_license">Lizenz anzeigen</string>
     <string name="about_notice">Hinweise anzeigen</string>
+    <string name="about_privacy_policy">Datenschutzerklärung</string>
 
     <string name="new_textdocument">Neues Textdokument</string>
     <string name="new_presentation">Neue Präsentation</string>
diff --git a/android/source/res/values/strings.xml 
b/android/source/res/values/strings.xml
index 77bfc8c110e0..d2262406136e 100644
--- a/android/source/res/values/strings.xml
+++ b/android/source/res/values/strings.xml
@@ -13,6 +13,7 @@
 
     <string name="about_license">Show License</string>
     <string name="about_notice">Show Notice</string>
+    <string name="about_privacy_policy">Privacy Policy</string>
 
     <string name="create_file">Create New File</string>
     <string name="new_textdocument">New Text Document</string>
diff --git a/android/source/src/java/org/libreoffice/AboutDialogFragment.java 
b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
index 17c43787e619..4abf9c14a35f 100644
--- a/android/source/src/java/org/libreoffice/AboutDialogFragment.java
+++ b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
@@ -88,6 +88,17 @@ public class AboutDialogFragment extends DialogFragment {
                     }
                 });
 
+        // when privacy policy URL is set (via 
'--with-privacy-policy-url=<url>' autogen option),
+        // add button to open that URL
+        final String privacyUrl = BuildConfig.PRIVACY_POLICY_URL;
+        if (!privacyUrl.isEmpty() && privacyUrl != "undefined") {
+            builder.setNeutralButton(R.string.about_privacy_policy, 
(DialogInterface dialog, int id) -> {
+                Intent openPrivacyUrlIntent = new Intent(Intent.ACTION_VIEW, 
Uri.parse(privacyUrl));
+                startActivity(openPrivacyUrlIntent);
+                dialog.dismiss();
+            });
+        }
+
         return builder.create();
     }
 
commit 1d7b1e2d4099aac15e695696e6a0640d6e01e23f
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Wed Nov 15 13:16:26 2023 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Wed Nov 15 18:26:33 2023 +0100

    android: Drop "More Info" item in "About" dialog
    
    Drop the "More Info" button from the dialog, which
    opened a sample document with more information
    about LibreOffice.
    
    There's already a link to the website, and the
    "neutral" button in that dialog will be reintroduced
    to show the privacy policy instead, if set.
    (An `AlertDialog` has at most 3 buttons.)
    
    Change-Id: Ib760daba1ed6f8cfc26eefc7412553bf97c77d70
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159444
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/android/Bootstrap/Makefile.shared 
b/android/Bootstrap/Makefile.shared
index 951ee1450ec7..ffb2c16a832d 100644
--- a/android/Bootstrap/Makefile.shared
+++ b/android/Bootstrap/Makefile.shared
@@ -100,7 +100,6 @@ liboSettings.gradle: $(BUILDDIR)/config_build.mk 
$(BUILDDIR)/config_host.mk
                && echo "    liboSharedResFolder = 
'$(LIBO_SHARE_RESOURCE_FOLDER)'" \
                && echo "    liboUREJavaFolder   = 
'$(LIBO_URE_SHARE_JAVA_FOLDER)'" \
                && echo "    liboShareJavaFolder = '$(LIBO_SHARE_JAVA_FOLDER)'" 
\
-               && echo "    liboExampleDocument = '$(if 
$(exampleDocument),$(exampleDocument),$(SRC_ROOT)/android/default-document/example.odt)'"
 \
                && echo "    liboVersionMajor    = '$(LIBO_VERSION_MAJOR)'" \
                && echo "    liboVersionMinor    = '$(LIBO_VERSION_MINOR)'" \
                && echo "    liboGitFullCommit   = '$(shell cd $(SRCDIR) && git 
log -1 --format=%H)'" \
diff --git a/android/Makefile b/android/Makefile
index 796f8092959b..a0a7231f7b07 100644
--- a/android/Makefile
+++ b/android/Makefile
@@ -13,10 +13,10 @@ include 
$(module_directory)/../solenv/gbuild/partial_build.mk
 .PHONY: sign
 
 SIGNED_APK := $(BUILDDIR)/android/source/bin/LibreOfficeViewer.apk
-RELEASE_APK_USAGE := echo; echo "Usage: make versionCode=<version_num+1> 
exampleDocument=</absolute/path/example.odt> key=<key_name> release-apk"
+RELEASE_APK_USAGE := echo; echo "Usage: make versionCode=<version_num+1> 
key=<key_name> release-apk"
 
 release-apk: build
-       # versionCode and key are mandatory, exampleDocument is not
+       # versionCode and key are mandatory
        @if test -z "$(versionCode)" ; then $(RELEASE_APK_USAGE) ; exit 1 ; fi
        @if test -z "$(key)" ; then $(RELEASE_APK_USAGE) ; exit 1 ; fi
 
diff --git a/android/source/build.gradle b/android/source/build.gradle
index f207ddedf267..1ae292ba1006 100644
--- a/android/source/build.gradle
+++ b/android/source/build.gradle
@@ -197,9 +197,6 @@ task copyAppResources(type: Copy) {
         rename "LICENSE", "license.txt"
         rename "NOTICE", "notice.txt"
     }
-    from("${liboExampleDocument}") {
-        rename ".*", "example.odt"
-    }
 }
 
 task createFullConfig(type: Copy) {
diff --git a/android/source/res/values-de/strings.xml 
b/android/source/res/values-de/strings.xml
index 30dd48ceb16e..88fdbaedd73d 100644
--- a/android/source/res/values-de/strings.xml
+++ b/android/source/res/values-de/strings.xml
@@ -13,7 +13,6 @@
 
     <string name="about_license">Lizenz anzeigen</string>
     <string name="about_notice">Hinweise anzeigen</string>
-    <string name="about_moreinfo">Weitere Informationen</string>
 
     <string name="new_textdocument">Neues Textdokument</string>
     <string name="new_presentation">Neue Präsentation</string>
diff --git a/android/source/res/values-tr/strings.xml 
b/android/source/res/values-tr/strings.xml
index ec7274c8cca6..ef0722f035cd 100644
--- a/android/source/res/values-tr/strings.xml
+++ b/android/source/res/values-tr/strings.xml
@@ -13,7 +13,6 @@
 
     <string name="about_license">Lisansı Görüntüle</string>
     <string name="about_notice">Bildiriyi Görüntüle</string>
-    <string name="about_moreinfo">Daha Fazla Bilgi</string>
 
     <string name="new_textdocument">Yeni Kelime İşlemci</string>
     <string name="new_presentation">Yeni Sunum</string>
diff --git a/android/source/res/values/strings.xml 
b/android/source/res/values/strings.xml
index 37ed16e4503c..77bfc8c110e0 100644
--- a/android/source/res/values/strings.xml
+++ b/android/source/res/values/strings.xml
@@ -13,7 +13,6 @@
 
     <string name="about_license">Show License</string>
     <string name="about_notice">Show Notice</string>
-    <string name="about_moreinfo">More Info</string>
 
     <string name="create_file">Create New File</string>
     <string name="new_textdocument">New Text Document</string>
diff --git a/android/source/src/java/org/libreoffice/AboutDialogFragment.java 
b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
index 9695d1e9d650..17c43787e619 100644
--- a/android/source/src/java/org/libreoffice/AboutDialogFragment.java
+++ b/android/source/src/java/org/libreoffice/AboutDialogFragment.java
@@ -86,13 +86,6 @@ public class AboutDialogFragment extends DialogFragment {
                         loadFromAbout(R.raw.notice);
                         dialog.dismiss();
                     }
-                })
-                .setNeutralButton(R.string.about_moreinfo, new 
DialogInterface.OnClickListener() {
-                    @Override
-                    public void onClick(DialogInterface dialog, int id) {
-                        loadFromAbout(R.raw.example);
-                        dialog.dismiss();
-                    }
                 });
 
         return builder.create();

Reply via email to