Rotate images around a circle?

Please take a look at this screenshot of the application:

enter image description here

This is a banking application. It has 6 buttons around the bank logo. You can rotate images with one click and hold them and move your finger in any direction (clockwise or counterclockwise). So, for example, I can rotate them to place the Currency Convertor image instead of the Login image.

In my application I also have 6 images, I want to rotate them. How can i do this?

Update: BTW, this is an application for the iPhone, but I think this is not a problem with iOS.

+8
android rotation image-rotation
source share
3 answers

I created such a menu in one of my projects using the Circle Menu and is created by modifying this tutorial .

If you want to change it above, this will help you.

+4
source share

Just do it

 RotateAnimation rAnim = new RotateAnimation(0, 359, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f); rAnim.setDuration(1000); image.startAnimation(rAnim); 
0
source share

Assuming you don’t need to change items in the “menu” (on / off / order / visibility), you can possibly “trick” it by having a bitmap with elements pre-drawn as needed and rotating the bitmap. Image on top and background, etc. It can be done by overlaying the images, therefore ..

  • you have a background image (maybe a bevel around the disk) that you draw first.
  • then you turn your dial to place your menu item wherever you want (transparently anywhere you want the background to be seen ..) and draw it over the background
  • then you will draw an image of the pointer above the dial (again, transparently wherever you want to see the dial and background).

    • The end result (theoretically) will be very similar to your screenshot.

on Android, you are likely to do this on a screen bitmap so that the user does not see the constructed image, and then draw the entire finished bitmap. On iOS, off-screen buffering is mostly automatic, so you probably don't need to worry about that.

.. becomes harder if you want to change the state of elements. I would “build” a dial with images of objects (like images of segments) without rotating, and then turn and draw a “built-in” dial.

I would personally show the shadows on the dial as another layer (this will be step 2.5) using a partially transparent raster map that darkens the shaded areas. This would make the turn more convincing, since the shadows would remain in the right places.

0
source share

All Articles