show build number, if set

Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
This commit is contained in:
tobiasKaminsky 2019-06-12 09:41:27 +02:00
parent 6f70ebd3a1
commit 6678226472
No known key found for this signature in database
GPG key ID: 0E00D4D47D0C5AF7
3 changed files with 14 additions and 1 deletions

View file

@ -44,6 +44,7 @@ import android.preference.PreferenceCategory;
import android.preference.PreferenceManager;
import android.preference.PreferenceScreen;
import android.preference.SwitchPreference;
import android.text.TextUtils;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
@ -220,7 +221,16 @@ public class SettingsActivity extends PreferenceActivity
Preference pAboutApp = findPreference("about_app");
if (pAboutApp != null) {
pAboutApp.setTitle(String.format(getString(R.string.about_android), getString(R.string.app_name)));
pAboutApp.setSummary(String.format(getString(R.string.about_version), appVersion));
String buildNumber = getResources().getString(R.string.buildNumber);
if (TextUtils.isEmpty(buildNumber)) {
pAboutApp.setSummary(String.format(getString(R.string.about_version), appVersion));
} else {
pAboutApp.setSummary(String.format(getString(R.string.about_version_with_build),
appVersion,
buildNumber));
}
}
// license

View file

@ -144,6 +144,8 @@
<string name="dev_link">https://download.nextcloud.com/android/dev/nextcloud-dev-</string>
<string name="dev_latest">https://download.nextcloud.com/android/dev/latest</string>
<string name="dev_changelog">https://github.com/nextcloud/android/raw/dev/CHANGELOG.md</string>
<string name="buildNumber" translatable="false"></string>
</resources>

View file

@ -2,6 +2,7 @@
<resources>
<string name="about_android">%1$s Android app</string>
<string name="about_version">version %1$s</string>
<string name="about_version_with_build">version %1$s, build #%2$s</string>
<string name="actionbar_sync">Refresh account</string>
<string name="actionbar_open_with">Open with</string>
<string name="actionbar_mkdir">New folder</string>