private void prepareForBackgroundColorAnimation(int newColor) { outerContainer.clearAnimation(); backgroundOverlay.clearAnimation(); backgroundOverlay.setBackgroundColor(newColor); backgroundOverlay.setVisibility(View.VISIBLE); }
@Override protected void updateTextContainerVisibility() { if (!isVisible) { return; } boolean emptyText = isTextContainerEmpty(); if (hideEmptyTextContainer && emptyText && textContainer.getVisibility() == VISIBLE) { textContainer.clearAnimation(); textContainer.startAnimation(new BottomViewHideShowAnimation(textContainer, false, CONTROL_VISIBILITY_ANIMATION_LENGTH)); } else if ((!hideEmptyTextContainer || !emptyText) && textContainer.getVisibility() != VISIBLE) { textContainer.clearAnimation(); textContainer.startAnimation(new BottomViewHideShowAnimation(textContainer, true, CONTROL_VISIBILITY_ANIMATION_LENGTH)); } }
@Override protected void updateTextContainerVisibility() { if (!isVisible) { return; } boolean emptyText = isTextContainerEmpty(); if (hideEmptyTextContainer && emptyText && textContainer.getVisibility() == VISIBLE) { textContainer.clearAnimation(); textContainer.startAnimation(new TopViewHideShowAnimation(textContainer, false, CONTROL_VISIBILITY_ANIMATION_LENGTH)); } else if ((!hideEmptyTextContainer || !emptyText) && textContainer.getVisibility() != VISIBLE) { textContainer.clearAnimation(); textContainer.startAnimation(new TopViewHideShowAnimation(textContainer, true, CONTROL_VISIBILITY_ANIMATION_LENGTH)); } }
private void setToolbarVisibility(final RTToolbar toolbar, final boolean visible) { mToolbarIsVisible = visible; final ViewGroup toolbarContainer = toolbar.getToolbarContainer(); int visibility; synchronized (toolbarContainer) { visibility = toolbarContainer.getVisibility(); } // only change visibility if we actually have to if ((visibility == View.GONE && visible) || (visibility == View.VISIBLE && !visible)) { AlphaAnimation fadeAnimation = visible ? new AlphaAnimation(0.0f, 1.0f) : new AlphaAnimation(1.0f, 0.0f); fadeAnimation.setDuration(400); fadeAnimation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { } @Override public void onAnimationRepeat(Animation animation) { } @Override public void onAnimationEnd(Animation animation) { synchronized (toolbarContainer) { toolbarContainer.setVisibility(mToolbarIsVisible ? View.VISIBLE : View.GONE); } } }); toolbarContainer.startAnimation(fadeAnimation); } else { toolbarContainer.clearAnimation(); } }