I am new to android programming In my project layout, I need created
- Color palette which is in grid layout(I put some buttons and set color background).
- Shapes(Triangle,square and circle which are buttons as well) is in Linear layout
- Next to these two is Relative Layout where users can draw the shapes
when user touch on one of the shape and then touch on the relative layout (which is next to shapes), that particular shape should be drawn and so as colors. For example if user touch on circle shape, then touch on the screen, circle should be drawn at the point where user touched.
I managed to create two touch events in two different classes, i.e one for selecting the shapes and other for placing shapes in layout.
I have no idea how to combine those two classes together.
Can anyone please give me an idea how should I approach this project.
Where should I create the shapes (should I create a separate classes for each shape/in onDraw()
)? If I create shapes in onDraw()
how can I call in onTouch()
?
Any help would be great. Thanks in advance.
I hope I explained properly, sorry I am not good in English and this is the first time I am posting in this forum.