tags:

views:

52

answers:

2

Hi Folks,
I would like to design a layout for my android app which has imageviews/Textviews placed as shown in the figure below. alt text
Right now, i tried to use Absolute layout, but i know that will create problems as the screen size changes.
Please help me with your ideas.
All comments are welcomed.

Thanks & Regards,
Sen

+1  A: 

You should use 2D Graphics to draw shapes, 2D Graphics.

ArtWorkAD
Okk.. i know using canvas i will be able to draw this.. but is'nt it possible placing TextViews along such a curved path possible via xml file in Android??
Sen
shape and text should be one entity. so you just need to set the shapes position. I do not think that you should use textview but just a string ressouce that you apply to each shape in the drawing process
ArtWorkAD
Actually it is a list of strings, at a time only 8 or 9 texts will be shown. So if it was possible to arrange them via xml it would be easy for me to implement the rest of the task.
Sen
+1  A: 

Hmm I think my approach will be to calculate some function that will model the curve (maybe two functions one for yellow and one for green 1/-x seems good) and then draw the circles with center coordinates like x = f(x). You can do this by simple implementing custom view and override onDraw method.

Mojo Risin
Can you please elaborate the technique as it will help me to get the best out of your idea. I also have problems in drawing curves with a given equation.
Sen
You have a rectangle in which you have to draw your objects. 1/x graph look something (check it in google ) which is curve in a way similar to your curve. If you want to specialize it more play little bit with the function (add, multiple some constants). When you get your f(x) like you desire set the distance between the points it is not necessary to be the same between all points. Then you simply iterate between 0, NUMBER_OF_POINTS and for each point draw circle with coordinates od the center x , f(x). Then do this for the green circles.
Mojo Risin