1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-28 02:37:16 +00:00

Fixed widget incompatibility (2)

This commit is contained in:
M66B 2024-03-05 18:20:58 +01:00
parent ea304dddae
commit 248fb4ad2d

View file

@ -199,14 +199,16 @@ public class WidgetUnifiedRemoteViewsFactory implements RemoteViewsService.Remot
int sp = WidgetUnified.getFontSizeSp(font); int sp = WidgetUnified.getFontSizeSp(font);
int cpx = (int) (sp * context.getResources().getDisplayMetrics().scaledDensity); int cpx = (int) (sp * context.getResources().getDisplayMetrics().scaledDensity);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
views.setViewLayoutHeight(ivFrom, cpx, TypedValue.COMPLEX_UNIT_PX); views.setViewLayoutHeight(ivFrom, cpx, TypedValue.COMPLEX_UNIT_PX);
views.setViewLayoutWidth(ivFrom, cpx, TypedValue.COMPLEX_UNIT_PX); views.setViewLayoutWidth(ivFrom, cpx, TypedValue.COMPLEX_UNIT_PX);
}
views.setTextViewTextSize(idFrom, TypedValue.COMPLEX_UNIT_SP, sp); views.setTextViewTextSize(idFrom, TypedValue.COMPLEX_UNIT_SP, sp);
views.setTextViewTextSize(idTime, TypedValue.COMPLEX_UNIT_SP, sp); views.setTextViewTextSize(idTime, TypedValue.COMPLEX_UNIT_SP, sp);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
views.setViewLayoutHeight(ivSubject, cpx, TypedValue.COMPLEX_UNIT_PX); views.setViewLayoutHeight(ivSubject, cpx, TypedValue.COMPLEX_UNIT_PX);
views.setViewLayoutWidth(ivSubject, cpx, TypedValue.COMPLEX_UNIT_PX); views.setViewLayoutWidth(ivSubject, cpx, TypedValue.COMPLEX_UNIT_PX);
}
views.setTextViewTextSize(idSubject, TypedValue.COMPLEX_UNIT_SP, sp); views.setTextViewTextSize(idSubject, TypedValue.COMPLEX_UNIT_SP, sp);
views.setTextViewTextSize(idAccount, TypedValue.COMPLEX_UNIT_SP, sp); views.setTextViewTextSize(idAccount, TypedValue.COMPLEX_UNIT_SP, sp);