In Java, you can change the typeface, text color and background color as follows:
private final Typeface mExoBold = ResourcesCompat.getFont(getApplicationContext(), R.font.exo_semibold);
complicationDrawable.setTextTypefaceActive(mExoBold);
complicationDrawable.setTextColorActive(Color.YELLOW);
complicationDrawable.setBackgroundColorActive(Color.argb(0xFF, 0x20, 0x20, 0x20));
I haven't found a way to change the font size in this manner, though. In the case that you want to completely reformat the complication, if you're using the old complication libraries in Java try this:
ComplicationText compTitle = null, compText = null;
String title = "", text = "";
if (complicationData.getType() == ComplicationData.TYPE_SHORT_TEXT) {
compTitle = complicationData.getShortTitle();
compText = complicationData.getShortText();
}
else if (complicationData.getType() == ComplicationData.TYPE_LONG_TEXT) {
compTitle = complicationData.getLongTitle();
compText = complicationData.getLongText();
}
if (compTitle != null) {
try {
title = compTitle.getText(context, currentTimeMillis()).toString();
} catch (Exception unused) {
title = "";
}
}
if (compText != null) {
try {
text = compText.getText(context, currentTimeMillis()).toString();
} catch (Exception unused) {
text = "";
}
}
Now you've got the text values in String variables, and you can display them any way you'd like (and yes, I know ComplicationText is deprecated, but then again, so is ComplicationData; I haven't yet figured out how to use the new complication libraries in Java).