Code example for ImageView

Methods: setImageDrawable, getAlpha, setAlpha

0
    public float getHaloContentAlpha() { 
        return mHaloContentAlpha;
    } 
 
    public void setHaloOverlay(Overlay overlay) {
        setHaloOverlay(overlay, mHaloOverlay.getAlpha());
    } 
 
    public void setHaloOverlay(Overlay overlay, float overlayAlpha) {
 
        Drawable d = null;
 
        switch(overlay) {
            case BLACK_X:
                d = mHaloBlackX;
                break; 
            case BACK_LEFT:
                d = mHaloBackL;
                break; 
            case BACK_RIGHT:
                d = mHaloBackR;
                break; 
            case DISMISS:
                d = mHaloDismiss;
                break; 
            case SILENCE_LEFT:
                d = mHaloSilenceL;
                break; 
            case SILENCE_RIGHT:
                d = mHaloSilenceR;
                break; 
            case CLEAR_ALL:
                d = mHaloClearAll;
                break; 
            case MESSAGE:
                d = mHaloMessage;
                break; 
        } 
 
        if (d != mHaloCurrentOverlay) {
            mHaloOverlay.setImageDrawable(d);
            mHaloCurrentOverlay = d;
 
            // Fade out number batch 
            if (overlay != Overlay.NONE) {
                msgNumberFlipAnimator.animate(ObjectAnimator.ofFloat(mHaloNumberContainer, "rotationY", 270).setDuration(500),
                        new DecelerateInterpolator(), null);
                msgNumberAlphaAnimator.animate(ObjectAnimator.ofFloat(mHaloNumberContainer, "alpha", 0f).setDuration(500),
                        new DecelerateInterpolator(), null);
            } 
        } 
 
        mHaloOverlay.setAlpha(overlayAlpha);
        updateResources(); 
    } 
 
    public void updateResources() {