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:
parent
ea304dddae
commit
248fb4ad2d
1 changed files with 6 additions and 4 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue