mirror of
https://github.com/M66B/FairEmail.git
synced 2026-04-04 16:16:33 +02:00
Optionally show widget stripe
This commit is contained in:
@@ -54,6 +54,7 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
|
||||
private int colorWidgetRead;
|
||||
private int colorSeparator;
|
||||
private boolean pro;
|
||||
private boolean hasColor;
|
||||
private List<TupleMessageWidget> messages = new ArrayList<>();
|
||||
|
||||
WidgetUnifiedRemoteViewsFactory(final Context context, Intent intent) {
|
||||
@@ -100,6 +101,14 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
|
||||
} finally {
|
||||
db.endTransaction();
|
||||
}
|
||||
|
||||
hasColor = false;
|
||||
if (account < 0)
|
||||
for (TupleMessageWidget message : messages)
|
||||
if (message.accountColor != null) {
|
||||
hasColor = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -135,7 +144,7 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
|
||||
int colorBackground =
|
||||
(message.accountColor == null || !pro ? colorSeparator : message.accountColor);
|
||||
views.setInt(R.id.stripe, "setBackgroundColor", colorBackground);
|
||||
views.setViewVisibility(R.id.stripe, account < 0 && color_stripe ? View.VISIBLE : View.GONE);
|
||||
views.setViewVisibility(R.id.stripe, hasColor && color_stripe ? View.VISIBLE : View.GONE);
|
||||
|
||||
SpannableString ssFrom = new SpannableString(pro
|
||||
? MessageHelper.formatAddressesShort(message.from)
|
||||
|
||||
Reference in New Issue
Block a user