Make a Button moving in a view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Make a Button moving in a view

Postby mangaluve » Wed Apr 29, 2009 7:46 pm

I wanna create a own view(group). Within that view group, Im trying to get a Button to move. Now I've extended ViewGroup and implemented onLayout. Furthermore I have a thread that calls invalidate to redraw everything. The thread also increases a x-coordinate which is used in onLayout to position the button. But the animation is not smooth at all, it feels very slow. What can I do?

What I ultimatly want is a ViewGroup where I can add a couple of views and then place them in a circle. I should then be able to rotate this circle around.
mangaluve
Experienced Developer
Experienced Developer
 
Posts: 82
Joined: Mon Mar 23, 2009 8:59 pm

Top

Postby padde » Wed Apr 29, 2009 8:04 pm

use a absolutelayout and calculate the X,Y positions apropiate for each child.
When this isnt smooth enough i guess you have to use surfaceview.


Greets
Padde
padde
Master Developer
Master Developer
 
Posts: 443
Joined: Wed Apr 08, 2009 4:52 pm

Postby mangaluve » Wed Apr 29, 2009 8:16 pm

Thanks! But how do I set the X/Y coordinate for a child with an absolutlayout? And how do I redraw everything?
mangaluve
Experienced Developer
Experienced Developer
 
Posts: 82
Joined: Mon Mar 23, 2009 8:59 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 4 guests