user1280649
user1280649

Reputation: 31

Draw Dynamic Shapes

I need some help to make an activity.

I have stored coordinates from shapes and name of shapes in a database. These are grouped into rooms. In the activity I need the top of the screen 8 TextViews (with colors and textst) in two rows. If I click on a textView, accordingly the shapes for the room need to be drawn on the screen under the textViews.

If I click on a shape, I need to get back the information, on which shape I made a click.

Upvotes: 3

Views: 566

Answers (1)

emesx
emesx

Reputation: 12755

I guess you could create a custom view:

public class CustomView extends View { ... }

and then you simply override appropriate methods like:

@Override
public boolean onTouchEvent(MotionEvent ev) { /* check for hitting shapes here */ }

@Override
protected void onDraw(Canvas canvas) { /* draw anything you want here */ }

Use the search engine of your choice to find out more. This looks like what you need

Upvotes: 1

Related Questions