Added purchase support button

pull/207/head
M66B 2 years ago
parent e7bcdef7b4
commit d730ed8909

@ -65,6 +65,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
private TextView tvPriceHint;
private TextView tvFamilyHint;
private TextView tvRestoreHint;
private Button btnSupport;
private Button btnConsume;
private ImageView ivConnected;
@ -94,6 +95,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
tvPriceHint = view.findViewById(R.id.tvPriceHint);
tvFamilyHint = view.findViewById(R.id.tvFamilyHint);
tvRestoreHint = view.findViewById(R.id.tvRestoreHint);
btnSupport = view.findViewById(R.id.btnSupport);
btnConsume = view.findViewById(R.id.btnConsume);
ivConnected = view.findViewById(R.id.ivConnected);
@ -160,6 +162,13 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
}
});
btnSupport.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Helper.view(v.getContext(), Helper.getSupportUri(v.getContext()), false);
}
});
btnConsume.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
@ -188,6 +197,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha
? View.VISIBLE : View.GONE);
tvFamilyHint.setVisibility(play ? View.VISIBLE : View.GONE);
tvRestoreHint.setVisibility(play ? View.VISIBLE : View.GONE);
btnSupport.setVisibility(play ? View.VISIBLE : View.GONE);
btnConsume.setEnabled(false);
btnConsume.setVisibility(ActivityBilling.isTesting(getContext()) ? View.VISIBLE : View.GONE);
ivConnected.setVisibility(View.GONE);

@ -194,6 +194,18 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvFamilyHint" />
<Button
android:id="@+id/btnSupport"
style="?android:attr/buttonStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:drawableEnd="@drawable/twotone_support_24"
android:drawablePadding="6dp"
android:text="@string/menu_faq"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRestoreHint" />
<Button
android:id="@+id/btnConsume"
style="?android:attr/buttonStyleSmall"
@ -202,7 +214,7 @@
android:layout_marginTop="12dp"
android:text="Consume"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvRestoreHint" />
app:layout_constraintTop_toBottomOf="@id/btnSupport" />
<eu.faircode.email.FixedImageView
android:id="@+id/ivConnected"

Loading…
Cancel
Save