From a19cc26ccacb465be51b7a88ecb9507edaebb297 Mon Sep 17 00:00:00 2001 From: M66B Date: Sun, 23 May 2021 17:57:45 +0200 Subject: [PATCH] Added notice about no Play store --- .../java/eu/faircode/email/FragmentPro.java | 19 ++++++++++++------- app/src/main/res/layout/fragment_pro.xml | 13 ++++++++++++- app/src/main/res/values/strings.xml | 1 + 3 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentPro.java b/app/src/main/java/eu/faircode/email/FragmentPro.java index deaa2cfc30..ceace6c4f6 100644 --- a/app/src/main/java/eu/faircode/email/FragmentPro.java +++ b/app/src/main/java/eu/faircode/email/FragmentPro.java @@ -58,6 +58,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha private TextView tvList; private Button btnPurchase; private ImageView ivExternal; + private TextView tvNoPlay; private TextView tvPrice; private TextView tvPriceHint; private TextView tvFamilyHint; @@ -85,6 +86,7 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha tvList = view.findViewById(R.id.tvList); btnPurchase = view.findViewById(R.id.btnPurchase); ivExternal = view.findViewById(R.id.ivExternal); + tvNoPlay = view.findViewById(R.id.tvNoPlay); tvPrice = view.findViewById(R.id.tvPrice); tvPriceHint = view.findViewById(R.id.tvPriceHint); tvFamilyHint = view.findViewById(R.id.tvFamilyHint); @@ -99,16 +101,10 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha .putExtra("navigate", true)); } }); - btnBackup.setVisibility(View.GONE); tvInfo.setText(getString(R.string.title_pro_info) .replaceAll("^\\s+", "").replaceAll("\\s+", " ")); - long now = new Date().getTime(); - long banner_hidden = prefs.getLong("banner_hidden", 0); - cbHide.setChecked(banner_hidden > 0 && now < banner_hidden); - cbHide.setText(getString(R.string.title_pro_hide, HIDE_BANNER)); - cbHide.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { @@ -170,12 +166,21 @@ public class FragmentPro extends FragmentBase implements SharedPreferences.OnSha boolean play = (Helper.isPlayStoreInstall() || ActivityBilling.isTesting(getContext())); + long now = new Date().getTime(); + long banner_hidden = prefs.getLong("banner_hidden", 0); + cbHide.setChecked(banner_hidden > 0 && now < banner_hidden); + cbHide.setText(getString(R.string.title_pro_hide, HIDE_BANNER)); + tvPending.setVisibility(View.GONE); tvActivated.setVisibility(View.GONE); + btnBackup.setVisibility(View.GONE); cbHide.setVisibility(View.GONE); btnPurchase.setEnabled(!play); - tvPrice.setVisibility(View.GONE); ivExternal.setVisibility(play ? View.GONE : View.VISIBLE); + tvPrice.setVisibility(View.GONE); + tvNoPlay.setVisibility( + BuildConfig.PLAY_STORE_RELEASE && !Helper.hasPlayStore(getContext()) + ? View.VISIBLE : View.GONE); tvFamilyHint.setVisibility(play ? View.VISIBLE : View.GONE); tvRestoreHint.setVisibility(play ? View.VISIBLE : View.GONE); btnConsume.setEnabled(false); diff --git a/app/src/main/res/layout/fragment_pro.xml b/app/src/main/res/layout/fragment_pro.xml index 30a388c819..88af38a0d0 100644 --- a/app/src/main/res/layout/fragment_pro.xml +++ b/app/src/main/res/layout/fragment_pro.xml @@ -94,6 +94,17 @@ app:layout_constraintTop_toTopOf="@+id/btnPurchase" app:srcCompat="@drawable/twotone_open_in_new_24" /> + + + app:layout_constraintTop_toBottomOf="@+id/tvNoPlay" /> List of pro features Buy %1$s (one-time purchase) + Play Store was not found Developing FairEmail took literally thousands of hours and, despite that, most of the features are free to use. FairEmail takes your privacy seriously and doesn\'t show ads and doesn\'t use tracking or analytics to earn money.