Bug? TextArea Size...

Cableguy

Expert
Licensed User
Longtime User
Hi EREL,

I am creating a TextArea in code, wich I would like to animate using SetLayoutAnimated method, this is beside the scope of this BUG.

When I add the TextArea to a pane like this...

B4X:
MainForm.RootPane.AddNode(TextPage, 0,0,0,0)

...instead of getting a 0x0 sized TextArea I get a TextArea of about 400px by 150px.
In order to animate the node, I first set it to invisible with visible=False and then I call the SetLayoutAnimated method and set the node to visible again. This way, expanding the node from invisible to defined size, it seems to start from the 0x0 size set in the addNode method, therefore the "workaround" is manageable, BUT, if I try to do a collapsing animation, going from defined size to 0x0, the textArea get animates to a (+-) 50x50 size. Setting the visible property kinda of overruns the animation...
 

Cableguy

Expert
Licensed User
Longtime User
Here is a sample demo that demonstrates the behaviour
 

Attachments

  • Test.zip
    986 bytes · Views: 154

Cableguy

Expert
Licensed User
Longtime User
So no work around for the collapsing animation? Is there any animation end event?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
You can use this code:
B4X:
Sub Btn_Action
   Select state
     Case "Colapsed"
       textpage.Visible = True
       textpage.SetLayoutAnimated(200, 100,125, 300, 200)
       textpage.SetAlphaAnimated(200, 1)
       state = "Expanded"
       
     Case "Expanded"
       textpage.SetLayoutAnimated(200, 100, 125, 0, 0)
       textpage.SetAlphaAnimated(200, 0)
       state = "Colapsed"
   End Select
End Sub
 
Top