This post will summarize the creation of a circle with arcs
1. Class that contains a single pieItem
2. method that bind multiple pieItems into 1 single layout
3. Insert the layout into your main view as a single element
1.Class that contains a single pieItem
This class will extend Views, and override OnTouchEvent.
2 things will happen to this custom view. First, it will draw a circle arc based on start point on a plane. Second, it intercept a touchevent and check that the angle of the touch to it's center point matches the angle of the circle arc created (boundary = start point, end point = start point + sweep point). If true, we can then react/set an action
2. Method that bind muliple pieItems - this have to be in the UI
Create a relativelayout, and house all pieItems view into the relativelayout without positioning. This will create a illusion that the views are a circle, since they are all position as 1,1 - where the non-arc portion is transparent.
No comments:
Post a Comment