diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2023-11-30 12:54:54 +0100 |
---|---|---|
committer | Michael Weghorn <m.weghorn@posteo.de> | 2023-11-30 14:40:08 +0100 |
commit | 3ee963afc7dfae473d5368e88a2caa847f7450f8 (patch) | |
tree | 8156ecff1df09cea4310a817afc046c555460415 /android | |
parent | 4958e21332c19a8bc1704ff71489c2c991efb05c (diff) |
android: Simplify vendor info handling for about dialog
Similar to
Change-Id: Iaa78f5a6020bea4ed80a1b41d3b23cc8d313813c
Author: Michael Weghorn <m.weghorn@posteo.de>
Date: Thu Nov 30 12:00:52 2023 +0100
android: Simplify version info handling for about dialog
, also simplify the handling of the vendor info text by
retrieving the text from the string resource right away.
Change-Id: I7d56b1814454be2bc8d13e01265f0a0db6d865be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160147
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'android')
-rw-r--r-- | android/source/res/layout/about.xml | 1 | ||||
-rw-r--r-- | android/source/src/java/org/libreoffice/AboutDialogFragment.java | 8 |
2 files changed, 3 insertions, 6 deletions
diff --git a/android/source/res/layout/about.xml b/android/source/res/layout/about.xml index 8cce41cf076d..30f1ed3d95ae 100644 --- a/android/source/res/layout/about.xml +++ b/android/source/res/layout/about.xml @@ -38,7 +38,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:textIsSelectable="true" - android:text="@string/app_vendor" android:textSize="18sp"/> </LinearLayout> </ScrollView> diff --git a/android/source/src/java/org/libreoffice/AboutDialogFragment.java b/android/source/src/java/org/libreoffice/AboutDialogFragment.java index de2e48ffbdde..b215ab5e7601 100644 --- a/android/source/src/java/org/libreoffice/AboutDialogFragment.java +++ b/android/source/src/java/org/libreoffice/AboutDialogFragment.java @@ -40,8 +40,7 @@ public class AboutDialogFragment extends DialogFragment { int defaultColor = textView.getTextColors().getDefaultColor(); textView.setTextColor(defaultColor); - // Take care of placeholders in the version and vendor text views. - TextView vendorView = messageView.findViewById(R.id.about_vendor); + // Take care of placeholders and set text in version and vendor text views. try { String versionName = getActivity().getPackageManager() @@ -55,8 +54,8 @@ public class AboutDialogFragment extends DialogFragment { TextView versionView = messageView.findViewById(R.id.about_version); versionView.setText(versionString); versionView.setMovementMethod(LinkMovementMethod.getInstance()); - String vendor = vendorView.getText().toString(); - vendor = vendor.replace("$VENDOR", tokens[2]); + TextView vendorView = messageView.findViewById(R.id.about_vendor); + String vendor = getString(R.string.app_vendor).replace("$VENDOR", tokens[2]); vendorView.setText(vendor); } else @@ -64,7 +63,6 @@ public class AboutDialogFragment extends DialogFragment { } catch (PackageManager.NameNotFoundException e) { - vendorView.setText(""); } AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); |