Added check for updates button in about

pull/194/head
M66B 4 years ago
parent e6b569f7eb
commit 4eb91ca061

@ -31,6 +31,7 @@ import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageButton;
import android.widget.LinearLayout;
import android.widget.TextView;
@ -51,12 +52,26 @@ public class FragmentAbout extends FragmentBase {
TextView tvVersion = view.findViewById(R.id.tvVersion);
TextView tvRelease = view.findViewById(R.id.tvRelease);
ImageButton ibUpdate = view.findViewById(R.id.ibUpdate);
TextView tvGplV3 = view.findViewById(R.id.tvGplV3);
LinearLayout llContributors = view.findViewById(R.id.llContributors);
tvVersion.setText(getString(R.string.title_version, BuildConfig.VERSION_NAME));
tvRelease.setText(BuildConfig.RELEASE_NAME);
ibUpdate.setVisibility(
Helper.hasValidFingerprint(getContext()) || BuildConfig.DEBUG
? View.VISIBLE : View.GONE);
ibUpdate.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (BuildConfig.PLAY_STORE_RELEASE)
Helper.view(v.getContext(), Helper.getIntentRate(v.getContext()));
else
onMenuChangelog();
}
});
tvGplV3.setPaintFlags(tvGplV3.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);
tvGplV3.setOnClickListener(new View.OnClickListener() {
@Override

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
android:pathData="M19,8l-4,4h3c0,3.31 -2.69,6 -6,6 -1.01,0 -1.97,-0.25 -2.8,-0.7l-1.46,1.46C8.97,19.54 10.43,20 12,20c4.42,0 8,-3.58 8,-8h3l-4,-4zM6,12c0,-3.31 2.69,-6 6,-6 1.01,0 1.97,0.25 2.8,0.7l1.46,-1.46C15.03,4.46 13.57,4 12,4c-4.42,0 -8,3.58 -8,8H1l4,4 4,-4H6z"/>
</vector>

@ -13,6 +13,7 @@
android:layout_marginStart="12dp"
android:layout_marginTop="12dp"
android:layout_marginEnd="12dp"
android:lines="1"
android:text="Version 1.234"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textIsSelectable="true"
@ -21,26 +22,43 @@
<eu.faircode.email.FixedTextView
android:id="@+id/tvRelease"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="6dp"
android:ellipsize="end"
android:singleLine="true"
android:text="Dinosaur"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textStyle="italic"
app:layout_constraintEnd_toStartOf="@+id/ibUpdate"
app:layout_constraintStart_toEndOf="@id/tvVersion"
app:layout_constraintTop_toTopOf="@id/tvVersion" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvCopyright"
android:layout_width="wrap_content"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:layout_marginEnd="12dp"
android:text="@string/app_copyright"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toStartOf="@+id/ibUpdate"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvVersion" />
<ImageButton
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/tvCopyright"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tvVersion"
app:srcCompat="@drawable/twotone_cached_24" />
<eu.faircode.email.ScrollViewEx
android:layout_width="match_parent"
android:layout_height="0dp"

Loading…
Cancel
Save