Android Question click event is fired at original position after animation in Animation Plus

Binary Soft

Member
Licensed User
Longtime User
Hi,

I use animation plus library for two or more animation effects and more then two views simultaneously.
I start a simple animation program only single effect.
When I click a Image View, it move up.
Then I click again, it move down (original position).

My problem is:
After move animation, I click image view, click event not fire. But I click the original started position (before animation), click event is work again.

B4X:
Sub Globals
    Dim anMoveUp, anMoveDown As AnimationPlus
    Dim bMoveUp As Boolean
    Private ImageView1 As ImageView
end sub

Sub Activity_Create(FirstTime As Boolean)
    anMoveUp.InitializeTranslate("MoveUp", 0, 0, 0, -100dip)
    anMoveUp.Duration = 1500
    anMoveUp.SetInterpolator(anMoveUp.INTERPOLATOR_BOUNCE)
    anMoveUp.PersistAfter=True

    anMoveDown.InitializeTranslate("MoveDown",0, -100, 0, 0dip)
    anMoveDown.Duration = 1500
    anMoveDown.SetInterpolator(anMoveDown.INTERPOLATOR_BOUNCE)
    anMoveDown.PersistAfter=True
    bMenuUp = False
end sub


Private Sub ImageView1_Click
    If bMoveUp = False Then
        If anMoveUp.IsInitialized Then
            anMoveUp.Stop(ImageView1)
            Activity.Invalidate
            anMoveUp.Start(ImageView1)
        End If

    Else
        If anMoveDown.IsInitialized Then
            anMoveDown.Stop(ImageView1)
            Activity.Invalidate
            anMoveDown.Start(ImageView1)
        End If
    
    End If

    bMoveUp = Not(bMoveUp)
End Sub
 
Last edited:

Binary Soft

Member
Licensed User
Longtime User
Thank Erel.

I want to use different effects: INTERPOLATOR_BOUNCE and others.
I want to move three buttons/views with different effects simultaneously.
Eg. Can I use B4XView.SetLayoutAnimated for three buttons move up and one of them is move up and scale center effects at the same time?
 
Upvote 0
Top