Show download source

pull/194/merge
M66B 3 years ago
parent bc42e826ad
commit 0115333611

@ -43,6 +43,7 @@ import androidx.core.widget.TextViewCompat;
import java.text.DateFormat; import java.text.DateFormat;
import java.util.List; import java.util.List;
import java.util.Objects;
public class FragmentAbout extends FragmentBase { public class FragmentAbout extends FragmentBase {
@Override @Override
@ -57,8 +58,8 @@ public class FragmentAbout extends FragmentBase {
TextView tvVersion = view.findViewById(R.id.tvVersion); TextView tvVersion = view.findViewById(R.id.tvVersion);
TextView tvRelease = view.findViewById(R.id.tvRelease); TextView tvRelease = view.findViewById(R.id.tvRelease);
TextView tvDownloaded = view.findViewById(R.id.tvDownloaded);
TextView tvUpdated = view.findViewById(R.id.tvUpdated); TextView tvUpdated = view.findViewById(R.id.tvUpdated);
ImageButton ibUpdate = view.findViewById(R.id.ibUpdate);
TextView tvGplV3 = view.findViewById(R.id.tvGplV3); TextView tvGplV3 = view.findViewById(R.id.tvGplV3);
LinearLayout llContributors = view.findViewById(R.id.llContributors); LinearLayout llContributors = view.findViewById(R.id.llContributors);
@ -66,6 +67,21 @@ public class FragmentAbout extends FragmentBase {
tvVersion.setText(getString(R.string.title_version, version)); tvVersion.setText(getString(R.string.title_version, version));
tvRelease.setText(BuildConfig.RELEASE_NAME); 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; long last = 0;
try { try {
PackageManager pm = context.getPackageManager(); PackageManager pm = context.getPackageManager();
@ -78,10 +94,7 @@ public class FragmentAbout extends FragmentBase {
DateFormat DF = Helper.getDateTimeInstance(context, DateFormat.SHORT, DateFormat.SHORT); DateFormat DF = Helper.getDateTimeInstance(context, DateFormat.SHORT, DateFormat.SHORT);
tvUpdated.setText(getString(R.string.app_updated, last == 0 ? "-" : DF.format(last))); tvUpdated.setText(getString(R.string.app_updated, last == 0 ? "-" : DF.format(last)));
ibUpdate.setVisibility( tvUpdated.setOnClickListener(new View.OnClickListener() {
Helper.hasValidFingerprint(context) || BuildConfig.DEBUG
? View.VISIBLE : View.GONE);
ibUpdate.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
if (BuildConfig.PLAY_STORE_RELEASE) if (BuildConfig.PLAY_STORE_RELEASE)

@ -25,52 +25,53 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="6dp" android:layout_marginStart="6dp"
android:layout_marginEnd="12dp"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:text="Dinosaur" android:text="Dinosaur"
android:textAppearance="@style/TextAppearance.AppCompat.Medium" android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="italic" android:textStyle="italic"
app:layout_constraintEnd_toStartOf="@+id/ibUpdate" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/tvVersion" app:layout_constraintStart_toEndOf="@id/tvVersion"
app:layout_constraintTop_toTopOf="@id/tvVersion" /> app:layout_constraintTop_toTopOf="@id/tvVersion" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvDownloaded"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="12dp"
android:text="@string/app_download"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRelease" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvUpdated" android:id="@+id/tvUpdated"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp" android:layout_marginHorizontal="12dp"
android:background="?android:attr/selectableItemBackground"
android:drawableEnd="@drawable/twotone_cached_24"
android:drawablePadding="6dp"
android:text="@string/app_updated" android:text="@string/app_updated"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibUpdate" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRelease" /> app:layout_constraintTop_toBottomOf="@id/tvDownloaded" />
<eu.faircode.email.FixedTextView <eu.faircode.email.FixedTextView
android:id="@+id/tvCopyright" android:id="@+id/tvCopyright"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="12dp" android:layout_marginHorizontal="12dp"
android:layout_marginTop="12dp" android:layout_marginTop="12dp"
android:text="@string/app_copyright" android:text="@string/app_copyright"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibUpdate" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvUpdated" /> app:layout_constraintTop_toBottomOf="@id/tvUpdated" />
<eu.faircode.email.FixedImageButton
android:id="@+id/ibUpdate"
android:layout_width="36dp"
android:layout_height="36dp"
android:layout_marginEnd="12dp"
android:background="?android:attr/selectableItemBackgroundBorderless"
android:contentDescription="@string/title_more"
android:padding="6dp"
android:scaleType="fitCenter"
app:layout_constraintBottom_toBottomOf="@+id/tvUpdated"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvVersion"
app:srcCompat="@drawable/twotone_cached_24" />
<eu.faircode.email.ScrollViewEx <eu.faircode.email.ScrollViewEx
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="0dp"

@ -12,6 +12,7 @@
<string name="app_exit">Go \'back\' again to exit</string> <string name="app_exit">Go \'back\' again to exit</string>
<string name="app_cake">Insufficient storage space left</string> <string name="app_cake">Insufficient storage space left</string>
<string name="app_updated">Last update: %1$s</string> <string name="app_updated">Last update: %1$s</string>
<string name="app_download">Downloaded from: %1$s</string>
<string name="channel_service">Receive</string> <string name="channel_service">Receive</string>
<string name="channel_send">Send</string> <string name="channel_send">Send</string>
@ -2211,6 +2212,7 @@
</string-array> </string-array>
<string name="fingerprint" translatable="false">17BA15C1AF55D925F98B99CEA4375D4CDF4C174B</string> <string name="fingerprint" translatable="false">17BA15C1AF55D925F98B99CEA4375D4CDF4C174B</string>
<string name="fingerprint_fdroid" translatable="false">77CD40058858DC3A38523E01C227A39AA019F88B</string>
<string name="fingerprint_amazon" translatable="false">200D0AA43A8ADBC7BB8237023C1553F4753CA7D2</string> <string name="fingerprint_amazon" translatable="false">200D0AA43A8ADBC7BB8237023C1553F4753CA7D2</string>
<string name="public_key" translatable="false">MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtFbxEbzL8u5accPGgBw/XdyiSS5BBE6ZQ9ELpKyJ/OQN+kdYniCAOw3lsQ/GuJScy4Y2HobqbBgLL8GLHG+Yu2EHC9dLjA3v2Mc25vvnfn86BsrpQvz1poN2n+roTBdq09FWbtebJ8m0hDBVmtfRi7RhTKIL4No3kodLhksdnucKjcFheubebWKgpmvbmw7NwuELhaZmyhw8WTtnQ4rZPMhjY1JJZgzwNExXgD7zzg4pJPkuQlfkuRkkvBpHpi3C7VDnYjrBlLHngI4wv3wxQBVwJqlvAT9PmX8dOVnTsWWdJdLQBZVWphuqVY54kjBIovN+o8w03WjsV9QiOQq+XwIDAQAB</string> <string name="public_key" translatable="false">MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAtFbxEbzL8u5accPGgBw/XdyiSS5BBE6ZQ9ELpKyJ/OQN+kdYniCAOw3lsQ/GuJScy4Y2HobqbBgLL8GLHG+Yu2EHC9dLjA3v2Mc25vvnfn86BsrpQvz1poN2n+roTBdq09FWbtebJ8m0hDBVmtfRi7RhTKIL4No3kodLhksdnucKjcFheubebWKgpmvbmw7NwuELhaZmyhw8WTtnQ4rZPMhjY1JJZgzwNExXgD7zzg4pJPkuQlfkuRkkvBpHpi3C7VDnYjrBlLHngI4wv3wxQBVwJqlvAT9PmX8dOVnTsWWdJdLQBZVWphuqVY54kjBIovN+o8w03WjsV9QiOQq+XwIDAQAB</string>
</resources> </resources>

Loading…
Cancel
Save