Added notice about no Play store

This commit is contained in:
M66B 2021-05-23 17:57:45 +02:00
parent 689d26f19c
commit a19cc26cca
3 changed files with 25 additions and 8 deletions

View File

@ -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);

View File

@ -94,6 +94,17 @@
app:layout_constraintTop_toTopOf="@+id/btnPurchase"
app:srcCompat="@drawable/twotone_open_in_new_24" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvNoPlay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_pro_no_play"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
android:textColor="?attr/colorWarning"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnPurchase" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvPrice"
android:layout_width="wrap_content"
@ -102,7 +113,7 @@
android:text="5 euro (once only)"
android:textAppearance="@style/TextAppearance.AppCompat.Medium"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnPurchase" />
app:layout_constraintTop_toBottomOf="@+id/tvNoPlay" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvHint"

View File

@ -1535,6 +1535,7 @@
<string name="title_pro_list">List of pro features</string>
<string name="title_pro_purchase">Buy</string>
<string name="title_pro_one_time">%1$s (one-time purchase)</string>
<string name="title_pro_no_play">Play Store was not found</string>
<string name="title_pro_info">
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.