use of android.support.v4.view.ViewPropertyAnimatorCompat in project Android-MaterialRefreshLayout by android-cjj.
the class MaterialRefreshLayout method finishRefreshing.
public void finishRefreshing() {
if (mChildView != null) {
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(mChildView);
viewPropertyAnimatorCompat.setDuration(200);
viewPropertyAnimatorCompat.y(ViewCompat.getTranslationY(mChildView));
viewPropertyAnimatorCompat.translationY(0);
viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
viewPropertyAnimatorCompat.start();
if (mMaterialHeaderView != null) {
mMaterialHeaderView.onComlete(MaterialRefreshLayout.this);
} else if (mSunLayout != null) {
mSunLayout.onComlete(MaterialRefreshLayout.this);
}
if (refreshListener != null) {
refreshListener.onfinish();
}
}
isRefreshing = false;
progressValue = 0;
}
use of android.support.v4.view.ViewPropertyAnimatorCompat in project Android-MaterialRefreshLayout by android-cjj.
the class MaterialRefreshLayout method createAnimatorTranslationY.
// public void setProgressValue(int progressValue) {
// this.progressValue = progressValue;
// mMaterialHeaderView.setProgressValue(progressValue);
// }
public void createAnimatorTranslationY(final View v, final float h, final FrameLayout fl) {
ViewPropertyAnimatorCompat viewPropertyAnimatorCompat = ViewCompat.animate(v);
viewPropertyAnimatorCompat.setDuration(250);
viewPropertyAnimatorCompat.setInterpolator(new DecelerateInterpolator());
viewPropertyAnimatorCompat.translationY(h);
viewPropertyAnimatorCompat.start();
viewPropertyAnimatorCompat.setUpdateListener(new ViewPropertyAnimatorUpdateListener() {
@Override
public void onAnimationUpdate(View view) {
float height = ViewCompat.getTranslationY(v);
fl.getLayoutParams().height = (int) height;
fl.requestLayout();
}
});
}
use of android.support.v4.view.ViewPropertyAnimatorCompat in project animate by hitherejoe.
the class ForegroundFrame method addContentView.
private void addContentView(FrameLayout container) {
inflate(getContext(), R.layout.layout_frame, this);
FloatingActionButton floatingActionButton = (FloatingActionButton) findViewById(R.id.fab_quiz);
floatingActionButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
ViewPropertyAnimatorCompat animatorCompat = buildAnimation(v);
animatorCompat.setListener(new ViewPropertyAnimatorListener() {
@Override
public void onAnimationStart(View view) {
}
@Override
public void onAnimationEnd(View view) {
doStuff();
}
@Override
public void onAnimationCancel(View view) {
}
});
}
});
}
use of android.support.v4.view.ViewPropertyAnimatorCompat in project BottomBar by roughike.
the class BottomBarTab method animateTitle.
private void animateTitle(int padding, float scale, float alpha) {
if (type == Type.TABLET && isTitleless) {
return;
}
setTopPaddingAnimated(iconView.getPaddingTop(), padding);
ViewPropertyAnimatorCompat titleAnimator = ViewCompat.animate(titleView).setDuration(ANIMATION_DURATION).scaleX(scale).scaleY(scale);
titleAnimator.alpha(alpha);
titleAnimator.start();
}
use of android.support.v4.view.ViewPropertyAnimatorCompat in project RecyclerViewItemAnimators by gabrielemariotti.
the class BaseItemAnimator method animateChangeImpl.
private void animateChangeImpl(final ChangeInfo changeInfo) {
final RecyclerView.ViewHolder holder = changeInfo.oldHolder;
final View view = holder == null ? null : holder.itemView;
final RecyclerView.ViewHolder newHolder = changeInfo.newHolder;
final View newView = newHolder != null ? newHolder.itemView : null;
if (view != null) {
final ViewPropertyAnimatorCompat oldViewAnim = ViewCompat.animate(view).setDuration(getChangeDuration());
mChangeAnimations.add(changeInfo.oldHolder);
oldViewAnim.translationX(changeInfo.toX - changeInfo.fromX);
oldViewAnim.translationY(changeInfo.toY - changeInfo.fromY);
oldViewAnim.alpha(0).setListener(new VpaListenerAdapter() {
@Override
public void onAnimationStart(View view) {
dispatchChangeStarting(changeInfo.oldHolder, true);
}
@Override
public void onAnimationEnd(View view) {
oldViewAnim.setListener(null);
ViewCompat.setAlpha(view, 1);
ViewCompat.setTranslationX(view, 0);
ViewCompat.setTranslationY(view, 0);
dispatchChangeFinished(changeInfo.oldHolder, true);
mChangeAnimations.remove(changeInfo.oldHolder);
dispatchFinishedWhenDone();
}
}).start();
}
if (newView != null) {
final ViewPropertyAnimatorCompat newViewAnimation = ViewCompat.animate(newView);
mChangeAnimations.add(changeInfo.newHolder);
newViewAnimation.translationX(0).translationY(0).setDuration(getChangeDuration()).alpha(1).setListener(new VpaListenerAdapter() {
@Override
public void onAnimationStart(View view) {
dispatchChangeStarting(changeInfo.newHolder, false);
}
@Override
public void onAnimationEnd(View view) {
newViewAnimation.setListener(null);
ViewCompat.setAlpha(newView, 1);
ViewCompat.setTranslationX(newView, 0);
ViewCompat.setTranslationY(newView, 0);
dispatchChangeFinished(changeInfo.newHolder, false);
mChangeAnimations.remove(changeInfo.newHolder);
dispatchFinishedWhenDone();
}
}).start();
}
}
Aggregations