From 15e5947f1108e35bc2ec28e3b9d84b3e312d62e2 Mon Sep 17 00:00:00 2001 From: Bryson Steck Date: Sun, 23 May 2021 21:10:58 -0600 Subject: added version in about fragment --- .../java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'app/src/main/java/me/brysonsteck') diff --git a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java index d327ca9..87f3def 100644 --- a/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java +++ b/app/src/main/java/me/brysonsteck/wiimmfiwatcher/AboutFragment.java @@ -4,6 +4,8 @@ import android.annotation.SuppressLint; import android.content.res.Configuration; import android.graphics.Color; import android.os.Bundle; +import android.text.Html; +import android.text.Spanned; import android.text.method.LinkMovementMethod; import android.transition.TransitionInflater; import android.view.View; @@ -16,8 +18,6 @@ import androidx.fragment.app.Fragment; import com.google.android.material.appbar.MaterialToolbar; -import java.util.Objects; - public class AboutFragment extends Fragment { View aboutButton; MaterialToolbar toolbar; @@ -58,6 +58,7 @@ public class AboutFragment extends Fragment { TextView contact = view.findViewById(R.id.contact_text); TextView bugs = view.findViewById(R.id.bugs_text); TextView license = view.findViewById(R.id.license_text); + TextView version = view.findViewById(R.id.version_text); aboutWatcher.setText(R.string.about_watcher); @@ -82,6 +83,13 @@ public class AboutFragment extends Fragment { license.setMovementMethod(LinkMovementMethod.getInstance()); license.setText(R.string.license); + + version.setClickable(true); + version.setMovementMethod(LinkMovementMethod.getInstance()); + + Spanned version_text = Html.fromHtml(getResources().getString(R.string.version, BuildConfig.VERSION_NAME)); + + version.setText(version_text); } @Override -- cgit v1.2.3