use of com.waz.zclient.BaseActivity in project wire-android by wireapp.
the class MarkdownTextView method configureStyleSheet.
/**
* Configures the style sheet used for rendering.
*/
private void configureStyleSheet() {
mStyleSheet = new StyleSheet();
mStyleSheet.setBaseFontColor(getCurrentTextColor());
mStyleSheet.setBaseFontSize((int) getTextSize());
mStyleSheet.setCodeColor(ContextUtils.getStyledColor(R.attr.codeColor, context()));
mStyleSheet.setQuoteColor(ContextUtils.getStyledColor(R.attr.quoteColor, context()));
mStyleSheet.setQuoteStripeColor(ContextUtils.getStyledColor(R.attr.quoteStripeColor, context()));
mStyleSheet.setListPrefixColor(ContextUtils.getStyledColor(R.attr.listPrefixColor, context()));
BaseActivity activity = (BaseActivity) getContext();
if (activity != null) {
// update the link color whenever the accent color changes
activity.injectJava(AccentColorController.class).accentColorForJava(new AccentColorCallback() {
@Override
public void color(AccentColor color) {
mStyleSheet.setLinkColor(color.color());
setLinkTextColor(color.color());
refreshLinks();
}
}, eventContext());
}
// to make links clickable
mStyleSheet.configureLinkHandler(context());
setMovementMethod(new LinkTextView.MovementMethod(getContext()));
setLineSpacing(0f, 1.1f);
}
Aggregations