With these codes below, i can move xcustomlistview from right to left, but how can the reverse be achieved? What i intend to achieve with this is to move with timer from right to left and then move back from left to right. After returning back to right, deactivate timer so that it can be moved freely manually as if no timer was used before. Below is the code that moves xcustomlistview from right to left
B4X:
Do While True
'..vertical...xclv1.sv.ScrollViewOffsetY = xclv1.sv.ScrollViewOffsetY + 3dip
xclv1.sv.ScrollViewOffsetX = xclv1.sv.ScrollViewOffsetX + 3dip
Sleep(15)
If xclv1.sv.ScrollViewOffsetX > 0 Then
xclv1.sv.ScrollViewOffsetX = xclv1.sv.ScrollViewOffsetX - 1
End If
Loop
Dim MovingLeft = 1, MovingRight = 2 As Int
Dim MaxOffset As Int = xclv1.sv.ScrollViewContentWidth - xclv1.sv.Width
Dim State As Int = MovingLeft
Dim delta As Int = 3dip
Do While True
Dim offset As Int = xclv1.sv.ScrollViewOffsetX
If State = MovingLeft Then
offset = offset + delta
If offset >= MaxOffset Then State = MovingRight
Else If State = MovingRight Then
offset = offset - delta
If offset <= 0 Then Exit
Sleep(15)
Loop
Dim MovingLeft = 1, MovingRight = 2 As Int
Dim MaxOffset As Int = xclv1.sv.ScrollViewContentWidth - xclv1.sv.Width
Dim State As Int = MovingLeft
Dim delta As Int = 3dip
Do While True
Dim offset As Int = xclv1.sv.ScrollViewOffsetX
If State = MovingLeft Then
offset = offset + delta
If offset >= MaxOffset Then State = MovingRight
Else If State = MovingRight Then
offset = offset - delta
If offset <= 0 Then Exit
Sleep(15)
Loop
I tried this code under the timer by first un-commenting the one in #1 (after first closing with end if error), it freezes everything; nothing moves. I later moved it out of timer, it still freezes. It neither moves to left nor right while other controls stop responding. I tried to see if i could debug it to work, but wasn't successful.
I ran it without timer, everything got hanged. However, i have plan-B to use if this doesn't work out. You have solved major problem for me already relating to other thread, this one has alternative. Thank you so much for your time