From 2a6115f6d933f107d2813f1ab8f627be5fc7c982 Mon Sep 17 00:00:00 2001 From: sk Date: Thu, 26 Jan 2023 15:01:41 +0100 Subject: [PATCH] add server version to settings closes sk22#376 --- .../org/joinmastodon/android/fragments/SettingsFragment.java | 2 ++ mastodon/src/main/res/values/strings_sk.xml | 1 + 2 files changed, 3 insertions(+) diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java index ecf92e488..72fa7e407 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/SettingsFragment.java @@ -9,6 +9,7 @@ import android.graphics.Canvas; import android.graphics.Rect; import android.os.Build; import android.os.Bundle; +import android.text.TextUtils; import android.util.LruCache; import android.util.TypedValue; import android.view.Gravity; @@ -269,6 +270,7 @@ public class SettingsFragment extends MastodonToolbarFragment{ items.add(new TextItem(R.string.settings_tos, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+session.domain+"/terms"), R.drawable.ic_fluent_open_24_regular)); items.add(new TextItem(R.string.settings_privacy_policy, ()->UiUtils.launchWebBrowser(getActivity(), "https://"+session.domain+"/terms"), R.drawable.ic_fluent_open_24_regular)); items.add(new TextItem(R.string.log_out, this::confirmLogOut, R.drawable.ic_fluent_sign_out_24_regular)); + if (!TextUtils.isEmpty(instance.version)) items.add(new SmallTextItem(getString(R.string.sk_settings_server_version, instance.version))); items.add(new HeaderItem(R.string.sk_instance_features)); items.add(new SwitchItem(R.string.sk_settings_support_local_only, 0, GlobalUserPreferences.accountsWithLocalOnlySupport.contains(accountID), i->{ diff --git a/mastodon/src/main/res/values/strings_sk.xml b/mastodon/src/main/res/values/strings_sk.xml index 1c64f572b..60900f2ed 100644 --- a/mastodon/src/main/res/values/strings_sk.xml +++ b/mastodon/src/main/res/values/strings_sk.xml @@ -249,4 +249,5 @@ reported Users signing up New reports + Server version: %s \ No newline at end of file