mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 04:35:57 +00:00
Optionally show widget stripe
This commit is contained in:
parent
32782b8684
commit
1158d895a5
1 changed files with 10 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue