|
|
@ -848,38 +848,46 @@ public class SettingsActivity extends FoxActivity implements LanguageActivity {
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
LongClickablePreference pref_donate_fox = findPreference("pref_donate_fox");
|
|
|
|
LongClickablePreference pref_donate_fox = findPreference("pref_donate_fox");
|
|
|
|
pref_donate_fox.setOnPreferenceClickListener(p -> {
|
|
|
|
if (BuildConfig.FLAVOR.equals("play")) {
|
|
|
|
// open fox
|
|
|
|
pref_donate_fox.setOnPreferenceClickListener(p -> {
|
|
|
|
IntentHelper.openUrl(getFoxActivity(this), "https://paypal.me/fox2code");
|
|
|
|
// open fox
|
|
|
|
return true;
|
|
|
|
IntentHelper.openUrl(getFoxActivity(this), "https://paypal.me/fox2code");
|
|
|
|
});
|
|
|
|
return true;
|
|
|
|
// handle long click on pref_donate_fox
|
|
|
|
});
|
|
|
|
pref_donate_fox.setOnPreferenceLongClickListener(p -> {
|
|
|
|
// handle long click on pref_donate_fox
|
|
|
|
// copy to clipboard
|
|
|
|
pref_donate_fox.setOnPreferenceLongClickListener(p -> {
|
|
|
|
String toastText = requireContext().getString(R.string.link_copied);
|
|
|
|
// copy to clipboard
|
|
|
|
clipboard.setPrimaryClip(ClipData.newPlainText(toastText, "https://paypal.me/fox2code"));
|
|
|
|
String toastText = requireContext().getString(R.string.link_copied);
|
|
|
|
Toast.makeText(requireContext(), toastText, Toast.LENGTH_SHORT).show();
|
|
|
|
clipboard.setPrimaryClip(ClipData.newPlainText(toastText, "https://paypal.me/fox2code"));
|
|
|
|
return true;
|
|
|
|
Toast.makeText(requireContext(), toastText, Toast.LENGTH_SHORT).show();
|
|
|
|
});
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
pref_donate_fox.setVisible(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
// now handle pref_donate_androidacy
|
|
|
|
// now handle pref_donate_androidacy
|
|
|
|
LongClickablePreference pref_donate_androidacy = findPreference("pref_donate_androidacy");
|
|
|
|
LongClickablePreference pref_donate_androidacy = findPreference("pref_donate_androidacy");
|
|
|
|
pref_donate_androidacy.setOnPreferenceClickListener(p -> {
|
|
|
|
if (BuildConfig.FLAVOR.equals("play")) {
|
|
|
|
// copy FOX2CODE promo code to clipboard and toast user that they can use it for half off any subscription
|
|
|
|
pref_donate_androidacy.setOnPreferenceClickListener(p -> {
|
|
|
|
String toastText = requireContext().getString(R.string.promo_code_copied);
|
|
|
|
// copy FOX2CODE promo code to clipboard and toast user that they can use it for half off any subscription
|
|
|
|
clipboard.setPrimaryClip(ClipData.newPlainText(toastText, "FOX2CODE"));
|
|
|
|
String toastText = requireContext().getString(R.string.promo_code_copied);
|
|
|
|
Toast.makeText(requireContext(), toastText, Toast.LENGTH_SHORT).show();
|
|
|
|
clipboard.setPrimaryClip(ClipData.newPlainText(toastText, "FOX2CODE"));
|
|
|
|
// open androidacy
|
|
|
|
Toast.makeText(requireContext(), toastText, Toast.LENGTH_SHORT).show();
|
|
|
|
IntentHelper.openUrl(getFoxActivity(this), "https://www.androidacy.com/membership-join/?utm_source=foxmmm&utm_medium=app&utm_campaign=donate");
|
|
|
|
// open androidacy
|
|
|
|
return true;
|
|
|
|
IntentHelper.openUrl(getFoxActivity(this), "https://www.androidacy.com/membership-join/?utm_source=foxmmm&utm_medium=app&utm_campaign=donate");
|
|
|
|
});
|
|
|
|
return true;
|
|
|
|
// handle long click on pref_donate_androidacy
|
|
|
|
});
|
|
|
|
pref_donate_androidacy.setOnPreferenceLongClickListener(p -> {
|
|
|
|
// handle long click on pref_donate_androidacy
|
|
|
|
// copy to clipboard
|
|
|
|
pref_donate_androidacy.setOnPreferenceLongClickListener(p -> {
|
|
|
|
String toastText = requireContext().getString(R.string.link_copied);
|
|
|
|
// copy to clipboard
|
|
|
|
clipboard.setPrimaryClip(ClipData.newPlainText(toastText, "https://www.androidacy.com/membership-join/?utm_source=foxmmm&utm_medium=app&utm_campaign=donate"));
|
|
|
|
String toastText = requireContext().getString(R.string.link_copied);
|
|
|
|
Toast.makeText(requireContext(), toastText, Toast.LENGTH_SHORT).show();
|
|
|
|
clipboard.setPrimaryClip(ClipData.newPlainText(toastText, "https://www.androidacy.com/membership-join/?utm_source=foxmmm&utm_medium=app&utm_campaign=donate"));
|
|
|
|
return true;
|
|
|
|
Toast.makeText(requireContext(), toastText, Toast.LENGTH_SHORT).show();
|
|
|
|
});
|
|
|
|
return true;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
pref_donate_androidacy.setVisible(false);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void openFragment(Fragment fragment, @StringRes int title) {
|
|
|
|
private void openFragment(Fragment fragment, @StringRes int title) {
|
|
|
|