tdf#131567 android: added version number in about dialog

also included git-hashes

Change-Id: Ia1d7f7f14b4c560ad7e47fd7a2f459e0da60e3d1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91951
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
mert 2020-04-09 11:19:10 +03:00 committed by Andras Timar
parent 2ccb0c2b0a
commit 30a01c0b21
4 changed files with 14 additions and 4 deletions

View file

@ -8,6 +8,9 @@ ext {
liboHasBranding = '@APP_HAS_BRANDING@'
liboBrandingDir = '@APP_BRANDING_DIR@'
liboAndroidAbi = '@ANDROID_ABI@'
liboOVersionHash = '@LOOLWSD_VERSION_HASH@'
liboCoreVersionHash = '@CORE_VERSION_HASH@'
}
android.defaultConfig {
applicationId '@ANDROID_PACKAGE_NAME@'

View file

@ -22,6 +22,8 @@ android {
resValue "string", "app_name", "${liboAppName} Debug"
resValue "string", "vendor", "${liboVendor}"
resValue "string", "info_url", "${liboInfoURL}"
resValue "string", "online_version_hash", "${liboOVersionHash}"
resValue "string", "core_version_hash", "${liboCoreVersionHash}"
resValue "string", "image_draw_header", "@drawable/drawer_header"
manifestPlaceholders = [ appIcon: "${liboLauncherIcon}" ]
buildConfigField "boolean", "APP_HAS_BRANDING", "${liboHasBranding}"
@ -37,6 +39,8 @@ android {
resValue "string", "app_name", "${liboAppName}"
resValue "string", "vendor", "${liboVendor}"
resValue "string", "info_url", "${liboInfoURL}"
resValue "string", "online_version_hash", "${liboOVersionHash}"
resValue "string", "core_version_hash", "${liboCoreVersionHash}"
if (file("src/main/res/drawable/drawer_header_brand.png").exists()) {
resValue "string", "image_draw_header", "@drawable/drawer_header_brand"
} else {

View file

@ -52,11 +52,14 @@ public class AboutDialogFragment extends DialogFragment {
{
String versionName = getActivity().getPackageManager()
.getPackageInfo(getActivity().getPackageName(), 0).versionName;
String[] tokens = versionName.split("/");
if (tokens.length >= 2)
String onlineVersionHash = getString(R.string.online_version_hash);
String coreVersionHash = getString(R.string.core_version_hash);
if (!onlineVersionHash.isEmpty() && !coreVersionHash.isEmpty() && !versionName.isEmpty())
{
String version = String.format(versionView.getText().toString().replace("\n", "<br/>"),
tokens[0], "<a href=\"https://hub.libreoffice.org/git-online/" + tokens[1] + "\">" + tokens[1] + "</a>");
versionName, "<a href=\"https://hub.libreoffice.org/git-online/" + onlineVersionHash + "\">" + onlineVersionHash + "</a>",
"<a href=\"https://hub.libreoffice.org/git-core/" + coreVersionHash + "\">" + coreVersionHash + "</a>");
@SuppressWarnings("deprecation") // since 24 with additional option parameter
Spanned versionString = Html.fromHtml(version);
versionView.setText(versionString);

View file

@ -2,7 +2,7 @@
<!--string name="app_name" definition is deliberately missing here, it is filled in in build.gradle.-->
<string name="app_name_settings">Settings</string>
<string name="app_version">Version: %1$s, Build ID: %2$s</string>
<string name="app_version">Version: %1$s\nonline git-hash: %2$s\ncore git-hash: %3$s</string>
<string name="app_description">$APP_NAME is a modern, easy-to-use, open source productivity suite for word processing, spreadsheets, presentations and more.</string>
<string name="app_vendor">This release was supplied by $VENDOR.</string>