Android Tutorial Android views animation tutorial

Pintinho

Member
Licensed User
Longtime User
Hi Erel
Here it goes...
The orig.. values, I save them before I call the animation and ImgBtn is a BitMapDrawable. I have ran it in Debug and put a breakpoint here to make sure it would go through, and it does, but as if nothing... I wonder if it has to do with the Imgbtn.. I define it earlier like this:
B4X:
Imgbtn.Initialize(LoadBitmap(File.DirAssets, "App_SoundMatch_Creambutton.png"))

B4X:
Sub animBtnReset_AnimationEnd
   'Because there is a strange problem to the scale, the button is truncated
   'we are resetting the button at the end of the animation to make sure it does not
   'happen
     btnSel.Height = origBtnHeight
     btnSel.Width = origBtnWidth
     btnSel.Background = Imgbtn 
 
End Sub
Thanks for your help!
 
Last edited:

Pintinho

Member
Licensed User
Longtime User
Indeed it seems that the problem was to do with the image itself!
I apologize to have entered this issue under this thread - somehow the image was being "corrupted" elsewhere in the program - I reloaded the image and it works fine now.
Thanks for your help!
 

jyounger

Member
Licensed User
Longtime User
Erel,

I have a panel that is hiding down below the activity. I have a button click event start an animation to slide the panel up. About 40-50% of the time, if not more, the animation to slide up does not start. The animation start is hung waiting for something, who knows what. Sometimes it starts, and it looks great. However, it is not reliable. Why is this? Something seems to be preempting the animation from starting. I do have an adview in the main activity. I wonder if it is a threading thing?

Interestingly, the slide down animation works every time.
 

kiki78

Active Member
Licensed User
Longtime User
Hi Erel,

May we expect, in future release of Animation, that we can pass "EventObject" in Initialize, and so receive Animation event inside Class, and so use it, for example, in custom views ?

I suppose you use Animator as base for this library.
I see that we must implement AnimatorListener interface to receive events, but I don't know how to do that, if possible, with reflexion.

Regards
 

Informatix

Expert
Licensed User
Longtime User

The Animation lib (and my AnimationPlus library) are not based on the Animator class. They use the animation methods of the View class and thus are limited to what this class provides.
 

kiki78

Active Member
Licensed User
Longtime User
I put Animation in class to move object and stay in end position.
I had problem of flashing at the end, and stupidly in think AnimationEnd doesn't fire in class.
It just fired to late to correctly change position of view.

Thank you Informatix, AnimationPlus PersistAfter property solve my problem.

Kind Regards
 

MaxApps

Active Member
Licensed User
Longtime User
Hi

When moving an imageview, with animation translate, I am unable to use ImageView_Click.
It seem like the position is not updated, until the animation has ended.
Is there a way around this?

Kind regards
Jakob
 

MaxApps

Active Member
Licensed User
Longtime User
Ok.
I have 20 items (imageviews) that floats slowly around. Is there any way to register, if the user clicks any of them?
 

MaFu

Well-Known Member
Licensed User
Longtime User
Note that I send to all donors of AnimationPlus a library for animations called NineOldAndroids that is not affected by this problem.
When did you send the mail? I haven't receive one.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…