How to create custom graphical component

47 views Asked by At

I would like to create custom component similar to this picture.

sample control preview

So I could set fan speed (from 0 to 4) and and timer (from 0 to 9). If I set fan speed greater than zero it would be nice to rotate the fan image.

What is the best approach to create such component?

1

There are 1 answers

0
Vyacheslav On BEST ANSWER

You have to create your custom view which handlers your taps and gestures and draws anything you want. Just a simple example.

public class MyView extends View {
//
@Override
    protected void onDraw(Canvas canvas) {

        super.onDraw(canvas);

//setup your output drawables here
}

Huge example:

https://developer.android.com/training/custom-views/create-view.html