title: Custom View: Redraw view canvas on Press
body: <p>I'm working on custom view, which have to draw custom canvas when pressed and other if not. I have basically overriden only methods <code>onMeasure</code> and <code>onDraw</code>. In Constructor I have set: <code>setFocusable(true)</code> and <code>setDrawingCacheEnabled(true)</code></p>
  
  <pre><code>public class CircularImageView extends ImageView{
      //...
      @Override
      protected void onDraw(Canvas canvas) {
          // ...
          if (isPressed() || isSelected() || isFocused()){
              // code when pressed
          }
          else{
              // otherwise
          }
      }
  }
  </code></pre>
  
  <p>I want this effect: view looks like pressed after <code>onDown</code> and like non-pressed after <code>onUp</code>/<code>onCancel</code> motion event. Normally I was using <code>&lt;selector&gt;</code> but now i have to do a little bit of work with canvas. (one draws circle around view, other some background effects)</p>
  
  <p>How can I set canvas for different press states?</p>