Layout like a spider

I need a cylindrical, spider web, as a layout:

I know that I can use the canvas for drawing, but I also need all the parts to be clickable and the canvas is very difficult to handle touch for the whole part.

Ideas?

+4
source share
2 answers

Is it possible to place the layout like a spider ...

Yes, you may want to. But if you want to create this layout, you cannot do it with standard Android widgets.

If you want to do this, I would suggest drawing it on the canvas manually and using onTouchListener to catch keystrokes.

+3
source

I'm not sure, but hope this helps you ...

The Path class contains a set of vector drawing commands, such as lines, rectangles, and curves. Here is an example that defines a circular path:

circle = new Path(); circle.addCircle(150, 150, 100, Direction.CW); 

This defines a circle at position x = 150, y = 150, with a radius of 100 pixels. Now that weve defined the path, we can use it to draw circles and also the text inside:

 private static final String QUOTE = "Now is the time for all " + "good men to come to the aid of their country." ; canvas.drawPath(circle, cPaint); canvas.drawTextOnPath(QUOTE, circle, 0, 20, tPaint); 

You can see the result in this figure.

This is figure

If you want to truly introduce yourself, Android offers several PathEffect classes that allow you to do things such as applying random permutations to path, output all segments of the line along the path that the curves will be smoothed or broken into segments and create other effects.

+3
source

All Articles