Android Question Halo animation, how to proceed?

wimpie3

Well-Known Member
Licensed User
Longtime User
I want to add a halo animation to my B4X buttons. I've seen that Erel already developed something that comes close:
https://www.b4x.com/android/forum/threads/b4x-xui-simple-halo-animation.80267/

However, that animation is shown UNDERNEATH the button. I want the animation to be shown INSIDE the button, like in Android, starting from the point in the button where the finger went down (and not centered in the button).

This is simple to do with a panel, which can have an ImageView as a child, and by animating the child the animation can be played. However, buttons cannot have children. So I think the animation must be done by changing the background bitmap of the button. But that means the standard B4X animations cannot be used, which might have an impact on performance.

How can I attack this problem?
 

teddybear

Well-Known Member
Licensed User
I want to add a halo animation to my B4X buttons. I've seen that Erel already developed something that comes close:
https://www.b4x.com/android/forum/threads/b4x-xui-simple-halo-animation.80267/

However, that animation is shown UNDERNEATH the button. I want the animation to be shown INSIDE the button, like in Android, starting from the point in the button where the finger went down (and not centered in the button).

This is simple to do with a panel, which can have an ImageView as a child, and by animating the child the animation can be played. However, buttons cannot have children. So I think the animation must be done by changing the background bitmap of the button. But that means the standard B4X animations cannot be used, which might have an impact on performance.

How can I attack this problem?
You can use a label instead of button.
 
Upvote 0

Jeffrey Cameron

Well-Known Member
Licensed User
Longtime User
Put your button, and the animation control in a panel together. Make sure your animation control has a higher elevation than the button.
 
Upvote 0

ilan

Expert
Licensed User
Longtime User
do you mean ripple effect?
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
 
Upvote 0

TILogistic

Expert
Licensed User
Longtime User
Exactly that. But I need a B4X solution that works on B4X Buttons.
if you want a button with ripple.

see:
 
Upvote 0

wimpie3

Well-Known Member
Licensed User
Longtime User
Yes I know, but those are new views. I'd like to apply the ripple effect to a standard button, like the ones used in the XUI dialogs for instance.
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Overlapping isn't a solution cause there might be text on the button.
bacchetta2.png
 
Upvote 0

wimpie3

Well-Known Member
Licensed User
Longtime User
Yes of course you could overlap a label - but the label text will still be shown UNDERNEATH the animation. The only reason you see the text is because the circle is half transparent. If your animation has 0 transparency, your trick won't work anymore.
 
Upvote 0
Top