Restore purchase

pull/184/head
M66B 4 years ago
parent a9d435bc2f
commit ee4c738942

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

@ -124,6 +124,17 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvHint" />
<eu.faircode.email.FixedTextView
android:id="@+id/tvRestoreHint"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:text="@string/title_pro_restore"
android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textColor="?android:attr/textColorLink"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPriceHint" />
<Button
android:id="@+id/btnCheck"
style="?android:attr/buttonStyleSmall"
@ -132,6 +143,6 @@
android:layout_marginTop="12dp"
android:text="@string/title_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvPriceHint" />
app:layout_constraintTop_toBottomOf="@id/tvRestoreHint" />
</androidx.constraintlayout.widget.ConstraintLayout>
</eu.faircode.email.ScrollViewEx>

@ -1349,6 +1349,7 @@
<string name="title_pro_hide">Hide small message for %1$d weeks</string>
<string name="title_pro_hint">Buying pro features will allow you to use all current and future pro features, will keep this app maintained, and supported.</string>
<string name="title_pro_price">Why are the pro features so expensive?</string>
<string name="title_pro_restore">How can I restore a purchase?</string>
<string name="title_pro_pending">Purchase pending</string>
<string name="title_pro_activated">All pro features are activated</string>
<string name="title_pro_valid">All pro features activated</string>

Loading…
Cancel
Save