Account avatars is a pro feature

pull/215/head
M66B 4 months ago
parent 5d82358663
commit 3dc30e1727

@ -78,7 +78,7 @@ This app starts a foreground service with a low-priority status bar notification
All pro features are convenience or advanced features.
* Account/identity/folder colors
* Account/identity/folder colors/avatars
* Colored stars
* Notification settings (sounds) per account/folder/sender (requires Android 8 Oreo)
* Configurable notification actions

@ -89,7 +89,7 @@ This app starts a foreground service with a low-priority status bar notification
All pro features are convenience or advanced features.
* Account/identity/folder colors
* Account/identity/folder colors/avatars
* Colored stars ([instructions](https://m66b.github.io/FairEmail/#faq107))
* Notification settings (sounds) per account/folder/sender (requires Android 8 Oreo) ([instructions](https://m66b.github.io/FairEmail/#faq145))
* Configurable notification actions

@ -89,6 +89,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
private LifecycleOwner owner;
private LayoutInflater inflater;
private boolean pro;
private int dp24;
private int colorStripeWidth;
private int colorWarning;
@ -217,7 +218,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
vwColor.setBackgroundColor(account.color == null ? Color.TRANSPARENT : account.color);
vwColor.setVisibility(ActivityBilling.isPro(context) ? View.VISIBLE : View.INVISIBLE);
if (account.avatar == null)
if (account.avatar == null || !pro)
ivAvatar.setVisibility(hasAvatars ? View.INVISIBLE : View.GONE);
else {
Bundle args = new Bundle();
@ -962,6 +963,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
this.owner = parentFragment.getViewLifecycleOwner();
this.inflater = LayoutInflater.from(context);
this.pro = ActivityBilling.isPro(context);
this.dp24 = Helper.dp2pixels(context, 24);
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
@ -1011,6 +1013,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new DiffCallback(items, filtered), false);
hasAvatars = false;
if (pro)
for (TupleAccountFolder account : accounts)
if (account.avatar != null) {
hasAvatars = true;

@ -2057,8 +2057,14 @@ public class FragmentAccount extends FragmentBase {
}
private void onImageSelected(Uri uri) {
try {
final Context context = getContext();
if (!ActivityBilling.isPro(context)) {
startActivity(new Intent(context, ActivityBilling.class));
return;
}
try {
NoStreamException.check(uri, context);
context.getContentResolver().takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);

@ -1094,8 +1094,14 @@ public class FragmentPop extends FragmentBase {
}
private void onImageSelected(Uri uri) {
try {
final Context context = getContext();
if (!ActivityBilling.isPro(context)) {
startActivity(new Intent(context, ActivityBilling.class));
return;
}
try {
NoStreamException.check(uri, context);
context.getContentResolver().takePersistableUriPermission(uri, Intent.FLAG_GRANT_READ_URI_PERMISSION);

Loading…
Cancel
Save