@Override
    protected void drawableStateChanged() {
        super.drawableStateChanged();

        // Update the state of the highlight drawable to match
        // the state of the button.
        if (mForegroundDrawable.isStateful()) {
            mForegroundDrawable.setState(getDrawableState());
        }

        // Trigger a redraw.
        invalidate();
    }
General view initialization used common to all constructors of the view.
app/src/main/java/home/smart/fly/animations/ui/activity/demos/TouchHighlightImageButton.java