user1824047
user1824047

Reputation: 129

How to make rotating menu

I have a question about rotating menu in android. I would like to make animated menu moving like gun cylinder.

http://i.imgur.com/COb8a.png

Where 1-6 are ImageButtons, and the buttons are rotating clockwise or countercw depending on how you touch the screen. I know how to place the ImageButtons etc. but i never made animated menu, always static. If you can help me i'd be very appreciated.

Upvotes: 12

Views: 19447

Answers (4)

Zar E Ahmer
Zar E Ahmer

Reputation: 34360

The best which I have implemented is the Circle Menu. This simple implementation of a circle menu for Android applications looks like the following screenshot ...

enter image description here

To download the package ...

Maven repo:

<dependency>
    <groupId>com.github.szugyi</groupId>
    <artifactId>Android-CircleMenu</artifactId>
    <version>2.0.0</version>
</dependency>

or Gradle:

compile 'com.github.szugyi:Android-CircleMenu:2.0.0'

Android-CircleMenu requires Android 4.0.

Upvotes: 3

Sanket Kachhela
Sanket Kachhela

Reputation: 10856

I think you can do this by using

1) here is library for rotating menu https://github.com/dmitry-zaitsev/CircleLayout

2) use carousel view and set z depth according to your requirement http://www.codeproject.com/Articles/146145/Android-3D-Carousel

3) follow this creating a Circular view in android

Upvotes: 13

sidon
sidon

Reputation: 1482

Create your own layout extending ViewGroup and override OnMeasure and OnLayout methods. There you can position your buttons yourself. Listen for touch events in your custom layout and process this information in mentioned methods.

Have a look at FlowLayout implementation. It isn't what you are looking for, however it should get you started to understand what you actually need to do OnLayout and OnMeasure.

Good luck.

Upvotes: 0

Lojko
Lojko

Reputation: 173

I was considering something similar to this myself.

Have a look into the view flipper, which can be used to switch between views with a swipe gesture, perhaps there is a way to add rotation to the entry/exit animation of the views.

http://developingandroid.blogspot.co.uk/2009/09/implementing-swipe-gesture.html

Upvotes: 1

Related Questions