mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-22 14:11:00 +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.QuoteSpan;
|
||||||
import android.text.style.StyleSpan;
|
import android.text.style.StyleSpan;
|
||||||
import android.text.style.URLSpan;
|
import android.text.style.URLSpan;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
|
@ -471,8 +472,8 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
tvCount.setTypeface(null, typeface);
|
tvCount.setTypeface(null, typeface);
|
||||||
|
|
||||||
if (textSize != 0) {
|
if (textSize != 0) {
|
||||||
tvFrom.setTextSize(textSize);
|
tvFrom.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||||
tvSubject.setTextSize(textSize);
|
tvSubject.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
int colorUnseen = (message.unseen > 0 ? colorUnread : textColorSecondary);
|
int colorUnseen = (message.unseen > 0 ? colorUnread : textColorSecondary);
|
||||||
|
@ -545,7 +546,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
bnvActions.setVisibility(View.VISIBLE);
|
bnvActions.setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
if (textSize != 0)
|
if (textSize != 0)
|
||||||
tvBody.setTextSize(textSize);
|
tvBody.setTextSize(TypedValue.COMPLEX_UNIT_PX, textSize);
|
||||||
|
|
||||||
Spanned body = properties.getBody(message.id);
|
Spanned body = properties.getBody(message.id);
|
||||||
tvBody.setText(body);
|
tvBody.setText(body);
|
||||||
|
|
|
@ -189,7 +189,7 @@ public class Helper {
|
||||||
else
|
else
|
||||||
ta = context.obtainStyledAttributes(
|
ta = context.obtainStyledAttributes(
|
||||||
R.style.TextAppearance_AppCompat_Medium, new int[]{android.R.attr.textSize});
|
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 {
|
} finally {
|
||||||
if (ta != null)
|
if (ta != null)
|
||||||
ta.recycle();
|
ta.recycle();
|
||||||
|
|
Loading…
Reference in a new issue