0

I want to create an Curve layout like Sen want here How to create this layout?

Here at place of bubble I need button's, here want to move layout like gallery?

pls suggest me. Thanks

Community
  • 1
  • 1
CoDe
  • 11,056
  • 14
  • 90
  • 197
  • So what have you tried so far and what are the problems? You can't just say 'Show me the codez' – John J Smith Jul 26 '11 at 08:14
  • yeah ur right John...but i m not guessing from where i have to start..pls suggest – CoDe Jul 26 '11 at 08:46
  • Something related to this [Here](http://stackoverflow.com/questions/5882199/layout-like-spider/5933402#5933402) – Vaibhav Jani Jul 26 '11 at 08:57
  • @wanted : thanks, but it's all about to drawing only what u suggest ne, i want to keep button as well in circular area..so when I fling it so it will rotate – CoDe Jul 26 '11 at 09:37

2 Answers2

1

See this answer to the question layout with buttons in a circle. It provides a method to plot XY coordinates in your layout.

EDIT 7/28/2011: The second answer to layout with buttons in a circle did not include XML. @Shubh asked for it in the comments, below, so I put this together:

<RelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent">
    <FrameLayout 
        android:layout_width="130dp"
        android:layout_height="85dp"
        android:background="#FFCC0000">
        <Button 
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_gravity="right|bottom"
        />
    </FrameLayout>  
    <FrameLayout 
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:background="#FFCCCC00">
        <Button 
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_gravity="right|bottom"
        />
    </FrameLayout>  
    <FrameLayout 
        android:layout_width="85dp"
        android:layout_height="130dp">
        <Button 
            android:layout_width="30dp"
            android:layout_height="30dp"
            android:layout_gravity="right|bottom"
        />
    </FrameLayout>  
</RelativeLayout>

enter image description here

Community
  • 1
  • 1
cdhabecker
  • 1,693
  • 1
  • 14
  • 23
  • but i need something like http://stackoverflow.com/questions/6830023/layout-with-buttons-in-a-circle/6830285#6830285 pls suggest me way to do this – CoDe Jul 28 '11 at 05:46
  • @Shubh See my edits -- I added example XML to match 6830023. This question about layout is done, but I think that you might need to ask a new question to explain what you mean by "Gallery" and "fling" and "rotate". If you just want to scroll your curve left-right or up-down, that is simple. But if you want to rotate it like a dial, that is more complicated. – cdhabecker Jul 28 '11 at 16:33
  • : yes cdhabecker same like dial i m trying to do...i got something related it with QuickAction view ..but prob is stl same ...how to make it rounded... – CoDe Jul 29 '11 at 11:58
1

Ok, for what its worth, my approach would be to create a custom layout, probably extending an AbsoluteLayout. You would have to query for the screen dimensions and then you could create a Path or EllipticCurve within the layout which best fits the screen dimensions. Next you could determine where on the curve (or offset from the curve) you wish to position graphics or buttons. You would also have to create a custom gesture detector by extending SimpleOnGesturreListener so that the fling action did what you want it to do e.g. do an animation on one or more or all of the objects on the curve. This is obviously just a starting point but it should get you started and once you try and run it, you will see issues or behaviours that need adjusting. Good luck with it.

Edit: You could make it more generic by being able to pass in a shape e.g. curve, circle etc and then getting it to layout your buttons along the path of the shape.

John J Smith
  • 11,435
  • 9
  • 53
  • 72