Code example for View

Methods: ofFloat, setAlpha, setVisibility

0
        if (securityMessageDisplay != null) {
            securityMessageDisplay.showBouncer(duration);
        } 
        if (ecaView != null) {
            if (duration > 0) {
                Animator anim = ObjectAnimator.ofFloat(ecaView, "alpha", 0f);
                anim.setDuration(duration);
                anim.addListener(new AnimatorListenerAdapter() {
                    private boolean mCanceled;
                    @Override 
                    public void onAnimationCancel(Animator animation) {
                        // Fail safe and show the emergency button in onAnimationEnd() 
                        mCanceled = true;
                        ecaView.setAlpha(1f);
                    } 
                    @Override 
                    public void onAnimationEnd(Animator animation) {
                        ecaView.setVisibility(mCanceled ? View.VISIBLE : View.INVISIBLE);
                    } 
                }); 
                anim.start();
            } else { 
                ecaView.setAlpha(0f);
                ecaView.setVisibility(View.INVISIBLE);
            } 
        } 
        if (bouncerFrame != null) {
            if (duration > 0) {
                Animator anim = ObjectAnimator.ofInt(bouncerFrame, "alpha", 0, 255);