1

I'm starting to develop Android Wear watchfaces using Google's Sample app as a reference. I am running in to an issue where I do not want color tinting on my complications. Specifically, the google assistant complication. However, no matter what I do, the google assistant complication will appear with some type of color tinting.

When looking through Google's code, I can only find a single reference to color tinting the complication:

    private void setComplicationsActiveAndAmbientColors(int primaryComplicationColor) {
        int complicationId;
        ComplicationDrawable complicationDrawable;

        for (int i = 0; i < COMPLICATION_IDS.length; i++) {
            complicationId = COMPLICATION_IDS[i];
            complicationDrawable = mComplicationDrawableSparseArray.get(complicationId);

            if (complicationId == BACKGROUND_COMPLICATION_ID) {
                // It helps for the background color to be black in case the image used for the
                // watch face's background takes some time to load.
                complicationDrawable.setBackgroundColorActive(Color.BLACK);
            } else {
                // Active mode colors.
                complicationDrawable.setBorderColorActive(primaryComplicationColor);
                complicationDrawable.setRangedValuePrimaryColorActive(primaryComplicationColor);

                // Ambient mode colors.
                Log.d("TAG Type", "Failed at complication " + i);
                complicationDrawable.setIconColorActive(Color.WHITE);
                complicationDrawable.setBorderColorAmbient(Color.WHITE);
                complicationDrawable.setRangedValuePrimaryColorAmbient(Color.WHITE);
            }
        }
    }

When I comment out

complicationDrawable.setIconColorActive(Color.WHITE);

The color is still tinted white. If I were to uncomment and change the value to something like Color.BLUE, the icon will appear blue.

Watchface with Google Assistant color tinting

I know it is possible to disable complication tinting because one of my Fossil watchfaces displays the Google Assistant logo the way I wish.

enter image description here

Does anyone know how I can disable color tinting for my complications?

Tykin
  • 492
  • 2
  • 8
  • 16

1 Answers1

0

There are two different complication types at play here:

  1. ICON - The icon is expected to be single-color, and may be tinted by the watch face.

  2. SMALL_IMAGE - A full-color image that should not be tinted.

The Google Assistant complication in the second screenshot is (most likely) of type SMALL_IMAGE. Make sure that your complication slot also supports the SMALL_IMAGE type. My guess is that you currently only support the ICON type. Calling setIconColorActive() on a ComplicationDrawable will not tint a SMALL_IMAGE, only an ICON.

It's perfectly fine to support both types, just remember that the order you declare them in actually matters.

More details about the different types can be found in the official documentation.

TofferJ
  • 4,678
  • 1
  • 37
  • 49