Android Question [B4X] Image Effects Beating

Biswajit

Active Member
Licensed User
Longtime User
Hello, i did not found it in forum. Is there a way to do this effect in some image with B4A and B4I?


Thank you.

You can use an animation library. Or you can do it manually,

Method 1:
  1. Create a label.
  2. Set text alignment to center (H+V)
  3. Set typeface/font to Fontawesome/ Material icon
  4. Set text to any heart icon.
  5. Create a function (say animateLabel)
    1. call SetLayoutAnimated and increase the label size within 2000ms
    2. call Sleep for 2000ms
    3. call SetLayoutAnimated and decrease the label size within 2000ms
    4. call Sleep for 2000ms
    5. call animateLabel again
Method 2:
  1. Create a label.
  2. Set text alignment to center (H+V)
  3. Set typeface/font to Fontawesome/ Material icon
  4. Set text to any heart icon.
  5. Set label tag to 1 (from code)
  6. Create a timer with less than 500ms interval for smooth animation.
  7. On timer tick event
    1. check for max limit (say 40)
    2. if the text size is equal to 40 then set label tag to -1
      OR
    3. check for min limit (say 20)
    4. if the text size is equal to 20 then set label tag to 1
    5. Set label text size like (label.textsize = label.TextSize + label.tag
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Try this one.

1.gif
 

Attachments

  • Pulse.zip
    22.5 KB · Views: 203
Last edited:
Upvote 0

udg

Expert
Licensed User
Longtime User
For some basic functionality you may have a look at my old library dgTextEffects.
It makes use of the standard Andoird component TextSwitcher
 
Upvote 0
Top