private void init(AttributeSet attrs, int defStyleAttr, int defStyleRes) {
        if (attrs == null)
            return;

        final Context context = getContext();
        final Resources resources = getResources();

        // Load attributes
        final TypedArray a = context.obtainStyledAttributes(
                attrs, R.styleable.ImageView, defStyleAttr, defStyleRes);

        int touchEffect = a.getInt(R.styleable.ImageView_gTouchEffect, EffectFactory.TOUCH_EFFECT_NONE);
        int touchColor = a.getColor(R.styleable.ImageView_gTouchColor, Ui.TOUCH_PRESS_COLOR);

        // Load clip touch corner radius
        int touchRadius = a.getDimensionPixelOffset(R.styleable.ImageView_gTouchCornerRadius, resources.getDimensionPixelOffset(R.dimen.g_imageView_touch_corners_radius));
        int touchRadiusTL = a.getDimensionPixelOffset(R.styleable.ImageView_gTouchCornerRadiusTL, touchRadius);
        int touchRadiusTR = a.getDimensionPixelOffset(R.styleable.ImageView_gTouchCornerRadiusTR, touchRadius);
        int touchRadiusBL = a.getDimensionPixelOffset(R.styleable.ImageView_gTouchCornerRadiusBL, touchRadius);
        int touchRadiusBR = a.getDimensionPixelOffset(R.styleable.ImageView_gTouchCornerRadiusBR, touchRadius);
        float touchDurationRate = a.getFloat(R.styleable.ImageView_gTouchDurationRate, 1.0f);
        boolean enabled = a.getBoolean(R.styleable.ImageView_android_enabled,
                touchEffect != EffectFactory.TOUCH_EFFECT_NONE);
        // Load intercept event type, the default is intercept click event
        int interceptEvent = a.getInt(R.styleable.ImageView_gInterceptEvent, 0x0001);
        a.recycle();


        // Initial  TouchEffectDrawable
        if (touchEffect != 0) {
            TouchEffectDrawable touchEffectDrawable = new TouchEffectDrawable();
            touchEffectDrawable.setColor(touchColor);
            touchEffectDrawable.setEffect(EffectFactory.creator(touchEffect));
            touchEffectDrawable.setEnterDuration(touchDurationRate);
            touchEffectDrawable.setExitDuration(touchDurationRate);
            touchEffectDrawable.setInterceptEvent(interceptEvent);
            // Check for IDE preview render to set Touch factory
            if (!this.isInEditMode()) {
                float[] radius = new float[]{touchRadiusTL, touchRadiusTL, touchRadiusTR, touchRadiusTR,
                        touchRadiusBR, touchRadiusBR, touchRadiusBL, touchRadiusBL};
                ClipFilletFactory touchFactory = new ClipFilletFactory(radius);
                touchEffectDrawable.setClipFactory(touchFactory);
            }
            setTouchDrawable(touchEffectDrawable);
        }

        // Change enabled
        setEnabled(enabled);
    }
This is touch effect ImageView
Include 'Auto' 'Ease' 'Press' 'Ripple' effect to touch
<p>
<p><strong>XML attributes</strong></p>
<p>
See {@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchEffect Attributes},
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchColor Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchCornerRadius Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchCornerRadiusTL Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchCornerRadiusTR Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchCornerRadiusBL Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchCornerRadiusBR Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gTouchDurationRate Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_android_enabled Attributes}
{@link net.qiujuer.genius.ui.R.styleable#ImageView_gInterceptEvent Attributes}
caprice/ui/src/main/java/net/qiujuer/genius/ui/widget/ImageView.java