Fixed editing message list widget

pull/204/head
M66B 3 years ago
parent 684758371a
commit 26b39566f7

@ -52,6 +52,10 @@ public class WidgetUnified extends AppWidgetProvider {
if (version <= 1550) if (version <= 1550)
semi = true; // Legacy semi = true; // Legacy
if (font == 0)
font = 2; // Default medium
if (padding == 0)
padding = 2; // Default medium
Intent view = new Intent(context, ActivityView.class); Intent view = new Intent(context, ActivityView.class);
view.setAction("folder:" + folder); view.setAction("folder:" + folder);
@ -65,13 +69,10 @@ public class WidgetUnified extends AppWidgetProvider {
RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_unified); RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_unified);
if (font > 0) views.setTextViewTextSize(R.id.title, TypedValue.COMPLEX_UNIT_SP, getFontSizeSp(font));
views.setTextViewTextSize(R.id.title, TypedValue.COMPLEX_UNIT_SP, getFontSizeSp(font));
if (padding > 0) { int px = getPaddingPx(padding, context);
int px = getPaddingPx(padding, context); views.setViewPadding(R.id.title, px, px, px, px);
views.setViewPadding(R.id.title, px, px, px, px);
}
if (name == null) if (name == null)
views.setTextViewText(R.id.title, context.getString(R.string.title_folder_unified)); views.setTextViewText(R.id.title, context.getString(R.string.title_folder_unified));

@ -146,18 +146,18 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
int idSubject = (subject_top ? R.id.tvFrom : R.id.tvSubject); int idSubject = (subject_top ? R.id.tvFrom : R.id.tvSubject);
int idAccount = (subject_top ? R.id.tvTime : R.id.tvAccount); int idAccount = (subject_top ? R.id.tvTime : R.id.tvAccount);
if (font > 0) { if (font == 0)
int sp = WidgetUnified.getFontSizeSp(font); font = 1; // Default small
views.setTextViewTextSize(idFrom, TypedValue.COMPLEX_UNIT_SP, sp);
views.setTextViewTextSize(idTime, TypedValue.COMPLEX_UNIT_SP, sp); int sp = WidgetUnified.getFontSizeSp(font);
views.setTextViewTextSize(idSubject, TypedValue.COMPLEX_UNIT_SP, sp); views.setTextViewTextSize(idFrom, TypedValue.COMPLEX_UNIT_SP, sp);
views.setTextViewTextSize(idAccount, TypedValue.COMPLEX_UNIT_SP, sp); views.setTextViewTextSize(idTime, TypedValue.COMPLEX_UNIT_SP, sp);
} views.setTextViewTextSize(idSubject, TypedValue.COMPLEX_UNIT_SP, sp);
views.setTextViewTextSize(idAccount, TypedValue.COMPLEX_UNIT_SP, sp);
if (padding > 0) {
int px = WidgetUnified.getPaddingPx(padding, context); // Default no padding
views.setViewPadding(R.id.llMessage, px, px, px, px); int px = (padding == 0 ? 0 : WidgetUnified.getPaddingPx(padding, context));
} views.setViewPadding(R.id.llMessage, px, px, px, px);
if (position >= messages.size()) if (position >= messages.size())
return views; return views;

Loading…
Cancel
Save