From ee4c73894285094b6b912ca7c28eb7afe08b87e8 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 23 Aug 2020 10:11:39 +0200 Subject: [PATCH] Restore purchase --- .../main/java/eu/faircode/email/FragmentPro.java | 11 +++++++++++ app/src/main/res/layout/fragment_pro.xml | 13 ++++++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 24 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 4f55b1182b..0d2b0c46ca 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPro.java +++ b/app/src/main/java/eu/faircode/email/FragmentPro.java @@ -50,6 +50,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha private TextView tvPrice; private ImageView ivExternal; private TextView tvPriceHint; + private TextView tvRestoreHint; private Button btnCheck; @Override @@ -71,6 +72,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha tvPrice = view.findViewById(R.id.tvPrice); ivExternal = view.findViewById(R.id.ivExternal); tvPriceHint = view.findViewById(R.id.tvPriceHint); + tvRestoreHint = view.findViewById(R.id.tvRestoreHint); btnCheck = view.findViewById(R.id.btnCheck); @@ -114,6 +116,14 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha } }); + tvRestoreHint.setPaintFlags(tvRestoreHint.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); + tvRestoreHint.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View view) { + Helper.viewFAQ(getContext(), 117); + } + }); + btnCheck.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { @@ -127,6 +137,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha cbHide.setVisibility(View.GONE); btnPurchase.setEnabled(!Helper.isPlayStoreInstall()); tvPrice.setText(null); + tvRestoreHint.setVisibility(Helper.isPlayStoreInstall() || BuildConfig.DEBUG ? View.VISIBLE : View.GONE); btnCheck.setEnabled(false); btnCheck.setVisibility(Helper.isPlayStoreInstall() && debug ? View.VISIBLE : View.GONE); diff --git a/app/src/main/res/layout/fragment_pro.xml b/app/src/main/res/layout/fragment_pro.xml index 34a813da66..2d5fb9ef3d 100644 --- a/app/src/main/res/layout/fragment_pro.xml +++ b/app/src/main/res/layout/fragment_pro.xml @@ -124,6 +124,17 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvHint" /> + +