From edbc9420e1245a3228522ce3883dd4afd26538bf Mon Sep 17 00:00:00 2001 From: MrLetsplay Date: Tue, 3 Oct 2023 14:59:20 +0200 Subject: [PATCH] Show version in about, Update version, Fix links in about --- app/.gitignore | 4 +++- app/build.gradle | 2 +- .../code_guard/fragment/AboutFragment.java | 9 +++++++++ app/src/main/res/layout/fragment_about.xml | 9 +++++++-- app/src/main/res/values/strings.xml | 4 ++-- 5 files changed, 22 insertions(+), 6 deletions(-) diff --git a/app/.gitignore b/app/.gitignore index 42afabf..2bdf0f6 100644 --- a/app/.gitignore +++ b/app/.gitignore @@ -1 +1,3 @@ -/build \ No newline at end of file +/build +/debug +/release \ No newline at end of file diff --git a/app/build.gradle b/app/build.gradle index 2917da1..134d981 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,7 @@ android { minSdk 21 targetSdk 34 versionCode 1 - versionName "1.0" + versionName "1.0.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/com/cringe_studios/code_guard/fragment/AboutFragment.java b/app/src/main/java/com/cringe_studios/code_guard/fragment/AboutFragment.java index 665fb2a..a4b8180 100644 --- a/app/src/main/java/com/cringe_studios/code_guard/fragment/AboutFragment.java +++ b/app/src/main/java/com/cringe_studios/code_guard/fragment/AboutFragment.java @@ -1,5 +1,7 @@ package com.cringe_studios.code_guard.fragment; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; @@ -24,6 +26,13 @@ public class AboutFragment extends NamedFragment { @Override public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { binding = FragmentAboutBinding.inflate(inflater); + try { + PackageManager manager = requireContext().getPackageManager(); + PackageInfo info = null; + info = manager.getPackageInfo(requireContext().getPackageName(), 0); + String version = info.versionName; + binding.appVersion.setText(version); + } catch (PackageManager.NameNotFoundException ignored) {} return binding.getRoot(); } } diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index bf9c91e..af6bce1 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -91,6 +91,7 @@ android:layout_marginTop="10dp" android:layout_marginEnd="10dp" android:textAlignment="center" + android:autoLink="email" android:text="@string/mail_to" /> + android:autoLink="web" + android:text="@string/appcode_link" /> Documentation GNU General Public License, version 3.0 Mail: info@code-guard.com - https://git.cringe-studios.com/CringeStudios/Code-Guard - https://git.cringe-studios.com/CringeStudios/Code-Guard + https://git.cringe-studios.com/CringeStudios/Code-Guard + https://code-guard.com/#4 https://git.cringe-studios.com/CringeStudios/Code-Guard https://git.cringe-studios.com/CringeStudios/Code-Guard The icon pack doesn\'t contain any icons