0

Our clients loves color changes. I am trying to find a simple solution where we would not use colored bitmap drawables for buttons, seekbar handles etc, but just grayscale bitmaps + a configurable color value from a resource file. Changing one color value would then render all drawables in the correct color.

Is this possible (ideally by only using xml configuration, so the drawables can be used in xml selectors etc.)? An example would be great.

Bachi
  • 6,408
  • 4
  • 32
  • 30
  • setColorFilter doesnt work? – pskink Jul 04 '13 at 13:07
  • xml config only would be appreciated :). SetColorFilter's counterpart in xml would be android:tint. While this seems to work fine for normal images, it seems to not work as expected with selectors in xml. – Bachi Jul 19 '13 at 16:26
  • Partially similar questions like http://stackoverflow.com/questions/8034494/tint-dim-drawable-on-touch or http://stackoverflow.com/questions/5092649/android-how-to-update-the-selectorstatelistdrawable-programmatically provided only coded solutions as tint seems not to work well with states (pressed etc). I was wondering if today a better and xml-only solution is available. – Bachi Jul 24 '13 at 08:38
  • afaik, you can do such things only in java, no xml – pskink Jul 24 '13 at 09:14

0 Answers0