Android Imagebutton focus flow / color tint

So, when using ImageButton with

android:background="@drawable/icon" 

defined by default, there is no radiance of the focus / click effect that appears with each default android button. I know that I can use a selector to use different images in different states, but this is not what android does, and it is not what I am looking for.

I want android to add an external default strong effect effect to my image when I focus / click on it. I think (maybe it was done differently, I don’t know!) Android uses a shade for this. However. using the hue selector and defining it as follows:

 android:tint="@color/tint_selector" 

my application is corrupted. using a static color, since the shade did not damage it, BUT no shade was visible.

so my questions are:

  • How does android, this is a glow
  • if this is done using a hue, how to define a hue selector that works with API 7 and> for an image button, and what should the selector look like for different colors in different states?
  • if done using hue, is there a static resource that I can use, so I get a "default glow color", so I got the default color for each Android API. something like @ color / llow?
+6
source share
1 answer

In fact, this is done using available selectors. It is not external, only 9patch less when unselected.

0
source

Source: https://habr.com/ru/post/905876/


All Articles