From d730ed8909258a1fbbc2dd4df511affef048bd93 Mon Sep 17 00:00:00 2001 From: M66B Date: Wed, 4 May 2022 16:41:31 +0200 Subject: [PATCH] Added purchase support button --- .../main/java/eu/faircode/email/FragmentPro.java | 10 ++++++++++ app/src/main/res/layout/fragment_pro.xml | 14 +++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentPro.java b/app/src/main/java/eu/faircode/email/FragmentPro.java index 902824c610..2c9ca3d59d 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPro.java +++ b/app/src/main/java/eu/faircode/email/FragmentPro.java @@ -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); diff --git a/app/src/main/res/layout/fragment_pro.xml b/app/src/main/res/layout/fragment_pro.xml index f2310eecf0..136448b553 100644 --- a/app/src/main/res/layout/fragment_pro.xml +++ b/app/src/main/res/layout/fragment_pro.xml @@ -194,6 +194,18 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvFamilyHint" /> +