Change article text color
This commit is contained in:
parent
4a126badb5
commit
73328e0d65
1 changed files with 3 additions and 0 deletions
|
@ -20,6 +20,7 @@ import android.text.Html;
|
|||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.TextUtils;
|
||||
import android.text.style.ForegroundColorSpan;
|
||||
import android.text.style.RelativeSizeSpan;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
|
@ -207,6 +208,8 @@ public class WikipediaDialogFragment extends DialogFragment {
|
|||
Spannable spannableContent = new SpannableString(Html.fromHtml(content));
|
||||
int length = spannableContent.length();
|
||||
spannableContent.setSpan(new RelativeSizeSpan(1.2f), 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
int contentTextColor = ContextCompat.getColor(getContext(), darkMode ? R.color.ctx_menu_bottom_view_text_color_dark : R.color.ctx_menu_bottom_view_text_color_light);
|
||||
spannableContent.setSpan(new ForegroundColorSpan(contentTextColor), 0, length, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
articleTextView.setText(spannableContent);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue