mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-21 21:57:19 +00:00
Fixed text size scaling
This commit is contained in:
parent
31820ec363
commit
1a99188b85
2 changed files with 5 additions and 4 deletions
|
@ -52,6 +52,7 @@ import android.text.style.ImageSpan;
|
|||
import android.text.style.QuoteSpan;
|
||||
import android.text.style.StyleSpan;
|
||||
import android.text.style.URLSpan;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuItem;
|
||||
|
@ -471,8 +472,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
tvCount.setTypeface(null, typeface);
|
||||
|
||||
if (textSize != 0) {
|
||||
tvFrom.setTextSize(textSize);
|
||||
tvSubject.setTextSize(textSize);
|
||||
tvFrom.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||
tvSubject.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||
}
|
||||
|
||||
int colorUnseen = (message.unseen > 0 ? colorUnread : textColorSecondary);
|
||||
|
@ -545,7 +546,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
bnvActions.setVisibility(View.VISIBLE);
|
||||
|
||||
if (textSize != 0)
|
||||
tvBody.setTextSize(textSize);
|
||||
tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||
|
||||
Spanned body = properties.getBody(message.id);
|
||||
tvBody.setText(body);
|
||||
|
|
|
@ -189,7 +189,7 @@ public class Helper {
|
|||
else
|
||||
ta = context.obtainStyledAttributes(
|
||||
R.style.TextAppearance_AppCompat_Medium, new int[]{android.R.attr.textSize});
|
||||
return ta.getDimension(0, 0) / context.getResources().getDisplayMetrics().density;
|
||||
return ta.getDimension(0, 0);
|
||||
} finally {
|
||||
if (ta != null)
|
||||
ta.recycle();
|
||||
|
|
Loading…
Reference in a new issue