mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-29 05:15:13 +02:00
Show download source
This commit is contained in:
@@ -43,6 +43,7 @@ import androidx.core.widget.TextViewCompat;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
public class FragmentAbout extends FragmentBase {
|
||||
@Override
|
||||
@@ -57,8 +58,8 @@ public class FragmentAbout extends FragmentBase {
|
||||
|
||||
TextView tvVersion = view.findViewById(R.id.tvVersion);
|
||||
TextView tvRelease = view.findViewById(R.id.tvRelease);
|
||||
TextView tvDownloaded = view.findViewById(R.id.tvDownloaded);
|
||||
TextView tvUpdated = view.findViewById(R.id.tvUpdated);
|
||||
ImageButton ibUpdate = view.findViewById(R.id.ibUpdate);
|
||||
TextView tvGplV3 = view.findViewById(R.id.tvGplV3);
|
||||
LinearLayout llContributors = view.findViewById(R.id.llContributors);
|
||||
|
||||
@@ -66,6 +67,21 @@ public class FragmentAbout extends FragmentBase {
|
||||
tvVersion.setText(getString(R.string.title_version, version));
|
||||
tvRelease.setText(BuildConfig.RELEASE_NAME);
|
||||
|
||||
String fingerprint = Helper.getFingerprint(context);
|
||||
boolean play = Objects.equals(fingerprint, getString(R.string.fingerprint));
|
||||
boolean fdroid = Objects.equals(fingerprint, getString(R.string.fingerprint_fdroid));
|
||||
|
||||
String source;
|
||||
if (play)
|
||||
source = (BuildConfig.PLAY_STORE_RELEASE ? "Play store" : "GitHub");
|
||||
else if (fdroid)
|
||||
source = "F-Droid";
|
||||
else if (BuildConfig.DEBUG)
|
||||
source = "Debug";
|
||||
else
|
||||
source = "?";
|
||||
tvDownloaded.setText(getString(R.string.app_download, source));
|
||||
|
||||
long last = 0;
|
||||
try {
|
||||
PackageManager pm = context.getPackageManager();
|
||||
@@ -78,10 +94,7 @@ public class FragmentAbout extends FragmentBase {
|
||||
DateFormat DF = Helper.getDateTimeInstance(context, DateFormat.SHORT, DateFormat.SHORT);
|
||||
tvUpdated.setText(getString(R.string.app_updated, last == 0 ? "-" : DF.format(last)));
|
||||
|
||||
ibUpdate.setVisibility(
|
||||
Helper.hasValidFingerprint(context) || BuildConfig.DEBUG
|
||||
? View.VISIBLE : View.GONE);
|
||||
ibUpdate.setOnClickListener(new View.OnClickListener() {
|
||||
tvUpdated.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (BuildConfig.PLAY_STORE_RELEASE)
|
||||
|
||||
Reference in New Issue
Block a user