Element of radial menù on android


I was wondering how android radial menus were painted, this is a small test in which I created the basic element graphic of a radial menu, is a simple arc and a text write on the center of it, is very basic procject just contains two activity, In the main activity you can choice of different parameters for creating the segment ,like:

  • Tilt angle
    this int variable permit to set the tilt angle of the radial menù
  • Start angle segment
    this int variable permit to set the start angle of the element,0 degrees is at 3 o’clock, the turn is clockwise
  • Sweep angle segment
    this int variable permit to set the sweep angle of the element, if greater than 0 it rotates clockwise Otherwise counterclockwise
  • Start angle text
    this int variable permit to set the start angle of the text,0 degrees is at 3 o’clock, the turn is clockwise
  • Sweep angle text
    this int variable permit to set the sweep angle of the text, if greater than 0 it be draw straight otherwise it is draw inverted
  • Offset text
    this float variable permit to set the offset of the text, if greater than 0 will be moved within the segment otherwise it will be moved to the outside

In this custom view the first touch on the screen is recognized, and returns the distance of the touch on the screen at the center of the circle, also the angle of the touch point that is created from the intersection with the absolute 0.
In this github repo you can find all the project code:
https://github.com/iacopodeenosee/test_angle
Here’s a small demonstration video:

Annunci

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...