use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.
the class AdapterViewAnimator method getDefaultOutAnimation.
ObjectAnimator getDefaultOutAnimation() {
ObjectAnimator anim = ObjectAnimator.ofFloat(null, "alpha", 1.0f, 0.0f);
anim.setDuration(DEFAULT_ANIMATION_DURATION);
return anim;
}
use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.
the class WebViewClassic method setTouchHighlightRects.
private void setTouchHighlightRects(WebKitHitTest hit) {
FocusTransitionDrawable transition = null;
if (shouldAnimateTo(hit)) {
transition = new FocusTransitionDrawable(this);
}
Rect[] rects = hit != null ? hit.mTouchRects : null;
if (!mTouchHighlightRegion.isEmpty()) {
mWebView.invalidate(mTouchHighlightRegion.getBounds());
if (transition != null) {
transition.mPreviousRegion = new Region(mTouchHighlightRegion);
}
mTouchHighlightRegion.setEmpty();
}
if (rects != null) {
mTouchHightlightPaint.setColor(hit.mTapHighlightColor);
for (Rect rect : rects) {
Rect viewRect = contentToViewRect(rect);
// more than half of the screen.
if (viewRect.width() < getWidth() >> 1 || viewRect.height() < getHeight() >> 1) {
mTouchHighlightRegion.union(viewRect);
} else if (DebugFlags.WEB_VIEW) {
Log.d(LOGTAG, "Skip the huge selection rect:" + viewRect);
}
}
mWebView.invalidate(mTouchHighlightRegion.getBounds());
if (transition != null && transition.mPreviousRegion != null) {
transition.mNewRegion = new Region(mTouchHighlightRegion);
mFocusTransition = transition;
ObjectAnimator animator = ObjectAnimator.ofFloat(mFocusTransition, "progress", 1f);
animator.start();
}
}
}
use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.
the class ActionBarContextView method makeOutAnimation.
private Animator makeOutAnimation() {
ObjectAnimator buttonAnimator = ObjectAnimator.ofFloat(mClose, "translationX", -mClose.getWidth() - ((MarginLayoutParams) mClose.getLayoutParams()).leftMargin);
buttonAnimator.setDuration(200);
buttonAnimator.addListener(this);
buttonAnimator.setInterpolator(new DecelerateInterpolator());
AnimatorSet set = new AnimatorSet();
AnimatorSet.Builder b = set.play(buttonAnimator);
if (mMenuView != null) {
final int count = mMenuView.getChildCount();
if (count > 0) {
for (int i = 0; i < 0; i++) {
View child = mMenuView.getChildAt(i);
child.setScaleY(0);
ObjectAnimator a = ObjectAnimator.ofFloat(child, "scaleY", 0);
a.setDuration(300);
b.with(a);
}
}
}
return set;
}
use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.
the class ScrollingTabContainerView method animateToVisibility.
public void animateToVisibility(int visibility) {
if (mVisibilityAnim != null) {
mVisibilityAnim.cancel();
}
if (visibility == VISIBLE) {
if (getVisibility() != VISIBLE) {
setAlpha(0);
}
ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 1);
anim.setDuration(FADE_DURATION);
anim.setInterpolator(sAlphaInterpolator);
anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
anim.start();
} else {
ObjectAnimator anim = ObjectAnimator.ofFloat(this, "alpha", 0);
anim.setDuration(FADE_DURATION);
anim.setInterpolator(sAlphaInterpolator);
anim.addListener(mVisAnimListener.withFinalVisibility(visibility));
anim.start();
}
}
use of android.animation.ObjectAnimator in project android_frameworks_base by ParanoidAndroid.
the class DrawableHolder method startAnimations.
/**
* Starts all animations added since the last call to this function. Used to synchronize
* animations.
*
* @param listener an optional listener to add to the animations. Typically used to know when
* to invalidate the surface these are being drawn to.
*/
public void startAnimations(ValueAnimator.AnimatorUpdateListener listener) {
for (int i = 0; i < mNeedToStart.size(); i++) {
ObjectAnimator anim = mNeedToStart.get(i);
anim.addUpdateListener(listener);
anim.addListener(this);
anim.start();
}
mNeedToStart.clear();
}
Aggregations