use of android.view.ViewPropertyAnimator in project Launcher3 by chislon.
the class LauncherViewPropertyAnimator method onAnimationStart.
@Override
public void onAnimationStart(Animator animation) {
// This is the first time we get a handle to the internal ValueAnimator
// used by the ViewPropertyAnimator.
mFirstFrameHelper.onAnimationStart(animation);
for (int i = 0; i < mListeners.size(); i++) {
Animator.AnimatorListener listener = mListeners.get(i);
listener.onAnimationStart(this);
}
mRunning = true;
}
use of android.view.ViewPropertyAnimator in project animate by hitherejoe.
the class ViewPropertyAnimatorActivity method buildAndStartAnimation.
private void buildAndStartAnimation(View view) {
ViewPropertyAnimator animator = view.animate();
if (mAnimateAlphaCheck.isChecked() || view.getAlpha() == 0f) {
float animationValue = view.getAlpha() == 0f ? 1f : 0f;
animator.alpha(animationValue);
}
if (mAnimateScaleCheck.isChecked()) {
float animationValue = view.getScaleY() == 0f ? 1f : 0f;
animator.scaleX(animationValue).scaleY(animationValue);
}
if (mAnimateZCheck.isChecked()) {
float animationValue = view.getTranslationZ() != 25f ? 25f : 2f;
animator.translationZ(animationValue);
}
if (mAnimationDurationCheck.isChecked()) {
animator.setDuration(500l);
}
if (mAnimationDelayCheck.isChecked()) {
animator.setStartDelay(500l);
}
animator.setInterpolator(getSelectedInterpolator());
animator.start();
}
use of android.view.ViewPropertyAnimator in project vlayout by alibaba.
the class FixLayoutHelper method addFixViewWithAnimator.
private void addFixViewWithAnimator(LayoutManagerHelper layoutManagerHelper, View fixView) {
if (mFixViewAnimatorHelper != null) {
ViewPropertyAnimator animator = mFixViewAnimatorHelper.onGetFixViewAppearAnimator(fixView);
if (animator != null) {
fixView.setVisibility(View.INVISIBLE);
layoutManagerHelper.addFixedView(fixView);
mFixViewAppearAnimatorListener.bindAction(layoutManagerHelper, fixView);
animator.setListener(mFixViewAppearAnimatorListener).start();
} else {
layoutManagerHelper.addFixedView(fixView);
}
} else {
layoutManagerHelper.addFixedView(fixView);
}
isRemoveFixViewImmediately = false;
}
use of android.view.ViewPropertyAnimator in project android_frameworks_base by ParanoidAndroid.
the class RecentsPanelView method animateInIconOfFirstTask.
private void animateInIconOfFirstTask() {
if (mItemToAnimateInWhenWindowAnimationIsFinished != null && !mRecentTasksLoader.isFirstScreenful()) {
int timeSinceWindowAnimation = (int) (System.currentTimeMillis() - mWindowAnimationStartTime);
final int minStartDelay = 150;
final int startDelay = Math.max(0, Math.min(minStartDelay - timeSinceWindowAnimation, minStartDelay));
final int duration = 250;
final ViewHolder holder = mItemToAnimateInWhenWindowAnimationIsFinished;
final TimeInterpolator cubic = new DecelerateInterpolator(1.5f);
FirstFrameAnimatorHelper.initializeDrawListener(holder.iconView);
for (View v : new View[] { holder.iconView, holder.labelView, holder.calloutLine }) {
if (v != null) {
ViewPropertyAnimator vpa = v.animate().translationX(0).translationY(0).alpha(1f).setStartDelay(startDelay).setDuration(duration).setInterpolator(cubic);
FirstFrameAnimatorHelper h = new FirstFrameAnimatorHelper(vpa, v);
}
}
mItemToAnimateInWhenWindowAnimationIsFinished = null;
mAnimateIconOfFirstTask = false;
}
}
use of android.view.ViewPropertyAnimator in project platform_frameworks_base by android.
the class RecentsView method onBusEvent.
public final void onBusEvent(DraggingInRecentsEndedEvent event) {
ViewPropertyAnimator animator = animate();
if (event.velocity > mFlingAnimationUtils.getMinVelocityPxPerSecond()) {
animator.translationY(getHeight());
animator.withEndAction(new Runnable() {
@Override
public void run() {
WindowManagerProxy.getInstance().maximizeDockedStack();
}
});
mFlingAnimationUtils.apply(animator, getTranslationY(), getHeight(), event.velocity);
} else {
animator.translationY(0f);
animator.setListener(null);
mFlingAnimationUtils.apply(animator, getTranslationY(), 0, event.velocity);
}
animator.start();
}
Aggregations