Android Question Problem with Animation Library (and SetLayoutAnimated)

Fabio Campanella

Member
Licensed User
Longtime User
Hi at all!!
I have a tedious problem with animation. (SetLayoutAnimated too)

I have a Panel that contain three webview that are positioned at 0, 100%x and 200%x rispectively.

Through a tab I select the webview (1, 2 or 3) and I use Animation library for translate the panel at 0%x, -100%x, -200%x so you can view the selected webview

During animation the content of the webview is not displayed (blank content) and when the animation end the content finally is diplayed

Can you help me?

this is the code

B4X:
public Sub setSelectedIndex( index As Int )

   Dim old = mSelectedIndex

   mSelectedIndex = index

   Dim jump As Int = (old - mSelectedIndex) * mWidth
   Ani.InitializeTranslate("Ani", 0, 0, jump, 0)
   Ani.Duration = 400
   Ani.RepeatCount = 0
   Ani.Start(mScView)

End Sub

mScView is the panel that contains the webview controls

in the Ani_AnimationEnd I put the final selected position

B4X:
private Sub Ani_AnimationEnd

   mScView.Left = 0 - (mWidth * mSelectedIndex)

End Sub

I use Samsung Galaxy 6 edge with Android 7, I try HardwareAccelerated with on and off but no lucky


This is the video that display the issue:

http://www.meteoputignano.com/webviewproblem.mov
 
Last edited:

Fabio Campanella

Member
Licensed User
Longtime User
Erel,
you are THE BEST!!!

it works fine with my custom tab too!!!!!!!

Thank you!!!!! :)

P.S.
The trick works but the control becomes very slow as well as other application points. Is it normal or something wrong?
 
Last edited:
Upvote 0
Top