[Libreoffice-commits] online.git: android/lib configure.ac

2020-06-11 Thread Henry Castro (via logerrit)
 android/lib/src/main/cpp/CMakeLists.txt.in |5 +
 configure.ac   |   28 +++-
 2 files changed, 32 insertions(+), 1 deletion(-)

New commits:
commit 2eec63af299e2169d87f0563c6eb8637ac4154d4
Author: Henry Castro 
AuthorDate: Fri Jun 5 10:32:20 2020 -0400
Commit: Henry Castro 
CommitDate: Thu Jun 11 20:11:44 2020 +0200

android: add "x86_64" ABI build variant

Change-Id: I19281af5432ae5a02f26f33464ced722759a4c67
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/95609
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice 
Reviewed-by: Henry Castro 

diff --git a/android/lib/src/main/cpp/CMakeLists.txt.in 
b/android/lib/src/main/cpp/CMakeLists.txt.in
index 7715dbbdc..36b63132a 100644
--- a/android/lib/src/main/cpp/CMakeLists.txt.in
+++ b/android/lib/src/main/cpp/CMakeLists.txt.in
@@ -1,3 +1,4 @@
+
 cmake_minimum_required(VERSION 3.4.1)
 
 add_library(androidapp SHARED
@@ -34,6 +35,10 @@ elseif(${ANDROID_ABI} STREQUAL "arm64-v8a")
 set(LOBUILDDIR_ABI @LOBUILDDIR_ARM64_V8A@)
 set(POCOINCLUDE_ABI @POCOINCLUDE_ARM64_V8A@)
 set(POCOLIB_ABI @POCOLIB_ARM64_V8A@)
+elseif(${ANDROID_ABI} STREQUAL "x86_64")
+set(LOBUILDDIR_ABI @LOBUILDDIR@)
+set(POCOINCLUDE_ABI @POCOINCLUDE@)
+set(POCOLIB_ABI @POCOLIB@)
 else()
 MESSAGE(FATAL_ERROR "Cannot build for ABI ${ANDROID_ABI}, please add 
support for that.")
 endif()
diff --git a/configure.ac b/configure.ac
index 3b2edb7c1..8d9cf761a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -356,7 +356,9 @@ fi
 # to the Mac.
 # Android: We need these to setup the CMakeLists.txt properly.
 LOBUILDDIR=
-ANDROID_ABI="armeabi-v7a"
+if test -z "$ANDROID_ABI"; then
+  ANDROID_ABI="armeabi-v7a"
+fi
 LOBUILDDIR_ARM64_V8A=
 POCOINCLUDE=
 POCOINCLUDE_ARM64_V8A=
@@ -379,6 +381,13 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
fi
 
# Sanity check, just a random object file in the LibreOffice build tree 
- 64bit
+   if test "$ANDROID_ABI" = "x86_64" ; then
+   if test -f 
"$LOBUILDDIR/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then
+   AC_MSG_RESULT([$LOBUILDDIR])
+   else
+   AC_MSG_ERROR([This is not a LibreOffice 64bit core build 
directory: $LOBUILDDIR])
+   fi
+   else
if test "$ANDROID_ABI" != "armeabi-v7a" ; then
if test -f 
"$LOBUILDDIR_ARM64_V8A/workdir/LinkTarget/StaticLibrary/liblibpng.a" ; then
AC_MSG_RESULT([$LOBUILDDIR_ARM64_V8A])
@@ -386,6 +395,7 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
AC_MSG_ERROR([This is not a LibreOffice 64bit core build 
directory: $LOBUILDDIR_ARM64_V8A])
fi
fi
+   fi
fi
 
# Get the git hash of the core build
@@ -411,6 +421,13 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
fi
 
# Sanity check - 64bit
+   if test "$ANDROID_ABI" = "x86_64" ; then
+   if test -f "$POCOINCLUDE/Poco/Poco.h"; then
+   AC_MSG_RESULT([$POCOINCLUDE])
+   else
+   AC_MSG_ERROR([This is not a Poco 64bit include directory: 
$POCOINCLUDE])
+   fi
+   else
if test "$ANDROID_ABI" != "armeabi-v7a" ; then
if test -f "$POCOINCLUDE_ARM64_V8A/Poco/Poco.h"; then
AC_MSG_RESULT([$POCOINCLUDE_ARM64_V8A])
@@ -418,6 +435,7 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
AC_MSG_ERROR([This is not a Poco 64bit include directory: 
$POCOINCLUDE_ARM64_V8A])
fi
fi
+   fi
fi
 
# Sanity check
@@ -440,6 +458,13 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
fi
 
# Sanity check - 64bit
+   if test "$ANDROID_ABI" = "x86_64" ; then
+   if test -f "$POCOLIB/libPocoFoundation.a"; then
+   AC_MSG_RESULT([$POCOLIB])
+   else
+   AC_MSG_ERROR([This is not a Poco 64bit lib directory: $POCOLIB])
+   fi
+   else
if test "$ANDROID_ABI" != "armeabi-v7a" ; then
if test -f "$POCOLIB_ARM64_V8A/libPocoFoundation.a"; then
AC_MSG_RESULT([$POCOLIB_ARM64_V8A])
@@ -447,6 +472,7 @@ if test \( "$enable_iosapp" = "yes" -a `uname -s` = 
"Darwin" \) -o \( "$enable_a
AC_MSG_ERROR([This is not a Poco 64bit lib directory: 
$POCOLIB_ARM64_V8A])
fi
fi
+   fi
fi
 
# Sanity check
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] online.git: android/lib configure.ac

2020-03-17 Thread mert (via logerrit)
 android/lib/build.gradle|  
  2 
 android/lib/libSettings.gradle.in   |  
  1 
 android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java|  
 57 ++
 android/lib/src/main/java/org/libreoffice/androidlib/RateAppController.java |  
 86 ++
 android/lib/src/main/res/layout/rate_app_layout.xml |  
 28 +++
 android/lib/src/main/res/values/strings.xml |  
  3 
 configure.ac|  
 10 +
 7 files changed, 186 insertions(+), 1 deletion(-)

New commits:
commit 76f4c6de3be7c8e70c29afcadd9a1b10ab6a34bd
Author: mert 
AuthorDate: Fri Mar 13 21:21:14 2020 +0300
Commit: Jan Holesovsky 
CommitDate: Wed Mar 18 00:36:05 2020 +0100

android: added a rating dialog

Change-Id: If1fed5bff1f7b607027d01a69d09de997fae8473
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/90479
Tested-by: Jan Holesovsky 
Reviewed-by: Jan Holesovsky 

diff --git a/android/lib/build.gradle b/android/lib/build.gradle
index 8af6e8a2a..ceac6b811 100644
--- a/android/lib/build.gradle
+++ b/android/lib/build.gradle
@@ -25,6 +25,7 @@ android {
 buildTypes {
 debug {
 buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
+buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
 abiFilters = []
 abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as 
String})
@@ -33,6 +34,7 @@ android {
 }
 release {
 buildConfigField "String", "GIT_COMMIT", "\"${liboGitFullCommit}\""
+buildConfigField "boolean", "GOOGLE_PLAY_ENABLED", 
"${liboGooglePlay}"
 ndk {
 abiFilters = []
 abiFilters.addAll("${liboAndroidAbi}".split(' ').collect{it as 
String})
diff --git a/android/lib/libSettings.gradle.in 
b/android/lib/libSettings.gradle.in
index d492e0389..3b6208fb7 100644
--- a/android/lib/libSettings.gradle.in
+++ b/android/lib/libSettings.gradle.in
@@ -10,4 +10,5 @@ ext {
 liboGitFullCommit   = '@LOOLWSD_VERSION_HASH@'
 liboApplicationId   = '@ANDROID_PACKAGE_NAME@'
 liboAndroidAbi  = '@ANDROID_ABI@'
+liboGooglePlay  = '@APP_GOOGLE_PLAY@'
 }
diff --git 
a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java 
b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
index 0459b8db2..de3f5da3b 100644
--- a/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
+++ b/android/lib/src/main/java/org/libreoffice/androidlib/LOActivity.java
@@ -10,11 +10,13 @@
 package org.libreoffice.androidlib;
 
 import android.Manifest;
+import android.app.AlertDialog;
 import android.content.ClipData;
 import android.content.ClipDescription;
 import android.content.ClipboardManager;
 import android.content.ActivityNotFoundException;
 import android.content.ContentResolver;
+import android.content.DialogInterface;
 import android.content.Intent;
 import android.content.SharedPreferences;
 import android.content.pm.ApplicationInfo;
@@ -43,6 +45,7 @@ import android.webkit.ValueCallback;
 import android.webkit.WebChromeClient;
 import android.webkit.WebSettings;
 import android.webkit.WebView;
+import android.widget.RatingBar;
 import android.widget.TextView;
 import android.widget.Toast;
 
@@ -65,7 +68,6 @@ import java.util.Map;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
-import androidx.appcompat.app.AlertDialog;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.core.app.ActivityCompat;
 import androidx.core.content.ContextCompat;
@@ -101,6 +103,7 @@ public class LOActivity extends AppCompatActivity {
 private WebView mWebView;
 private SharedPreferences sPrefs;
 private Handler mMainHandler = null;
+private RateAppController rateAppController;
 
 private boolean isDocEditable = false;
 private boolean isDocDebuggable = BuildConfig.DEBUG;
@@ -263,6 +266,10 @@ public class LOActivity extends AppCompatActivity {
 
 setContentView(R.layout.lolib_activity_main);
 mProgressDialog = new ProgressDialog(this);
+if (BuildConfig.GOOGLE_PLAY_ENABLED)
+this.rateAppController = new RateAppController(this);
+else
+this.rateAppController = null;
 
 init();
 }
@@ -403,6 +410,25 @@ public class LOActivity extends AppCompatActivity {
 }
 }
 
+/** opens up the app page on Google Play */
+private void openInGooglePlay() {
+String marketUri = String.format("market://details?id=%1$s", 
getPackageName());
+String webUri = 
String.format("https://play.google.com/store/apps/details?id=%1$s;, 
getPackageName());
+
+Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(marketUri));
+if