From 95c35deb905e0d49eeec640bc1ef5e687d24d8f3 Mon Sep 17 00:00:00 2001 From: vanous Date: Sat, 24 Oct 2020 21:55:48 +0200 Subject: [PATCH] Add version to About screen --- .../gadgetbridge/activities/AboutActivity.java | 5 +++++ app/src/main/res/layout/activity_about.xml | 7 ++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AboutActivity.java b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AboutActivity.java index 590fb23d9..fcd0290d5 100644 --- a/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AboutActivity.java +++ b/app/src/main/java/nodomain/freeyourgadget/gadgetbridge/activities/AboutActivity.java @@ -20,6 +20,7 @@ package nodomain.freeyourgadget.gadgetbridge.activities; import android.os.Bundle; import android.text.method.LinkMovementMethod; import android.widget.TextView; +import nodomain.freeyourgadget.gadgetbridge.BuildConfig; import nodomain.freeyourgadget.gadgetbridge.R; @@ -29,6 +30,10 @@ public class AboutActivity extends AbstractGBActivity { protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_about); + TextView about_version = findViewById(R.id.about_version); + String versionName = BuildConfig.VERSION_NAME; + about_version.setText(String.format(getString(R.string.about_version), versionName)); + TextView link1 = findViewById(R.id.links1); link1.setMovementMethod(LinkMovementMethod.getInstance()); TextView link2 = findViewById(R.id.links2); diff --git a/app/src/main/res/layout/activity_about.xml b/app/src/main/res/layout/activity_about.xml index c735b7202..fc442e051 100644 --- a/app/src/main/res/layout/activity_about.xml +++ b/app/src/main/res/layout/activity_about.xml @@ -12,7 +12,7 @@ android:layout_centerInParent="true" android:alpha="0.1" android:contentDescription="@string/icon_placeholder" - android:tint="?attr/textColorPrimary" + app:tint="?attr/textColorPrimary" app:srcCompat="@drawable/gadgetbridge_img" /> + + Code: https://codeberg.org/Freeyourgadget/Gadgetbridge F-Droid: https://f-droid.org/packages/nodomain.freeyourgadget.gadgetbridge/ About + Version %s About Gadgetbridge Cloudless copylefted libre replacement for closed source Android gadget apps from vendors. Core Team (in order of first code contribution)