diff --git a/app/src/main/java/eu/faircode/email/FragmentAbout.java b/app/src/main/java/eu/faircode/email/FragmentAbout.java index ac4bce9e6a..69097bf5f4 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAbout.java +++ b/app/src/main/java/eu/faircode/email/FragmentAbout.java @@ -20,6 +20,8 @@ package eu.faircode.email; */ import android.content.Context; +import android.content.pm.PackageInfo; +import android.content.pm.PackageManager; import android.graphics.Paint; import android.net.Uri; import android.os.Bundle; @@ -39,6 +41,7 @@ import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.core.widget.TextViewCompat; +import java.text.DateFormat; import java.util.List; public class FragmentAbout extends FragmentBase { @@ -52,6 +55,7 @@ public class FragmentAbout extends FragmentBase { TextView tvVersion = view.findViewById(R.id.tvVersion); TextView tvRelease = view.findViewById(R.id.tvRelease); + 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); @@ -59,6 +63,18 @@ public class FragmentAbout extends FragmentBase { tvVersion.setText(getString(R.string.title_version, BuildConfig.VERSION_NAME)); tvRelease.setText(BuildConfig.RELEASE_NAME); + long last = 0; + try { + PackageManager pm = getContext().getPackageManager(); + PackageInfo pi = pm.getPackageInfo(BuildConfig.APPLICATION_ID, 0); + last = pi.lastUpdateTime; + } catch (Throwable ex) { + Log.e(ex); + } + + DateFormat DF = Helper.getDateTimeInstance(getContext(), DateFormat.SHORT, DateFormat.SHORT); + tvUpdated.setText(getString(R.string.app_updated, last == 0 ? "-" : DF.format(last))); + ibUpdate.setVisibility( Helper.hasValidFingerprint(getContext()) || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); diff --git a/app/src/main/res/layout/fragment_about.xml b/app/src/main/res/layout/fragment_about.xml index a3c8215c24..d164b2bd8c 100644 --- a/app/src/main/res/layout/fragment_about.xml +++ b/app/src/main/res/layout/fragment_about.xml @@ -34,16 +34,28 @@ app:layout_constraintStart_toEndOf="@id/tvVersion" app:layout_constraintTop_toTopOf="@id/tvVersion" /> + + + app:layout_constraintTop_toBottomOf="@id/tvUpdated" /> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 39af37616d..4a464d6f12 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -9,6 +9,7 @@ FairEmail is not supported on this device because bugs in Android cause crashes Go \'back\' again to exit Insufficient storage space left + Last update: %1$s Receive Send