I tried to draw an icon on the front of Android, but did not see it on the dial. I am already checking this link. Ref I set the text on the text screen for the TYPE complex text, but it is not set for other types such as ICON, RANGED_VALUE, SMALL_IMAGE, so please suggest.

I need an icon of this type, where is the complexity of the red sign. I used this code to draw text.
if (COMPLICATION_IDS[i] == RIGHT_DIAL_COMPLICATION) {
int offset = (int) ((mWidth / 2) - textWidth) / 2;
complicationsX = (mWidth / 2) + offset;
canvas.drawText(
complicationMessage,
0,
complicationMessage.length(),
complicationsX,
mComplicationsY,
mComplicationPaint);
Log.e("log", "offset==" + offset + "==complicationsX==" + complicationsX);
Log.e("log", "mComplicationsY==" + mComplicationsY);
}
and use this code for the image but get nothing.
if (COMPLICATION_IDS[i] == LEFT_DIAL_COMPLICATION) {
complicationsX = (int) ((mWidth / 2) - textWidth) / 2;
Icon icon = complicationData.getIcon();
Drawable drawable = icon.loadDrawable(getApplicationContext());
if (drawable instanceof BitmapDrawable) {
Bitmap bitmap;
bitmap = ((BitmapDrawable) drawable).getBitmap();
canvas.drawBitmap(bitmap, complicationsX, mComplicationsY, null);
}
}
source
share