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)
semi = true; // Legacy
if (font == 0)
font = 2; // Default medium
if (padding == 0)
padding = 2; // Default medium
Intent view = new Intent(context, ActivityView.class);
view.setAction("folder:" + folder);
@ -65,13 +69,10 @@ public class WidgetUnified extends AppWidgetProvider {
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);
views.setViewPadding(R.id.title, px, px, px, px);
}
int px = getPaddingPx(padding, context);
views.setViewPadding(R.id.title, px, px, px, px);
if (name == null)
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 idAccount = (subject_top ? R.id.tvTime : R.id.tvAccount);
if (font > 0) {
int sp = WidgetUnified.getFontSizeSp(font);
views.setTextViewTextSize(idFrom, 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);
views.setViewPadding(R.id.llMessage, px, px, px, px);
}
if (font == 0)
font = 1; // Default small
int sp = WidgetUnified.getFontSizeSp(font);
views.setTextViewTextSize(idFrom, 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);
// Default no padding
int px = (padding == 0 ? 0 : WidgetUnified.getPaddingPx(padding, context));
views.setViewPadding(R.id.llMessage, px, px, px, px);
if (position >= messages.size())
return views;

Loading…
Cancel
Save