Android Question Sliding an ImageView ?

GMan

Well-Known Member
Licensed User
Longtime User
I have the following simple code:
B4X:
Sub Button1_Click
    ivBuehne.SetLayout (0,0,100%x,80dip)
End Sub
Sub Button2_Click
    ivBuehne.SetLayout (0,80dip,100%x,80dip)
End Sub
Sub Button3_Click
    ivBuehne.SetLayout (0,160dip,100%x,80dip)
End Sub
Sub Button4_Click
    ivBuehne.SetLayout (0,240dip,100%x,80dip)
End Sub
Sub Button5_Click
    ivBuehne.SetLayout (0,320dip,100%x,80dip)
End Sub
Sub Button6_Click
    ivBuehne.SetLayout (0,400dip,100%x,80dip)
End Sub


- the Activity has an background image like in Picture1

- ivBuehne is an ImageView with an backgroundpicture, looking like in Picture2

- the App looks like in Picture3


IF i click the depending button the ivBuehne is drawed at the given Position - but too fast.
I would like to let it slide to the clicked position (all distances are the same) with an configurable duration-timer for sliding simple integer is enough and is guilty for all positions)

Has anyone an idea ?
 

GMan

Well-Known Member
Licensed User
Longtime User
OK, but how ? ;-)
 
Upvote 0

GMan

Well-Known Member
Licensed User
Longtime User
I love these quiz-questions really
Of course i tried it before, but as i am not the graphical type, i have no solution else in sight.

This code won't work and throws an error: invalid double.
But i is declared as a Double.


B4X:
Sub BuehnenTimer_Tick
For i = 1 To 80
ivBuehne.SetLayout (0,ivBuehne+i,100%x,80dip)
Next
End Sub
 
Upvote 0

ibra939

Active Member
Licensed User
Longtime User
thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…