use of android.animation.ObjectAnimator in project PhotoNoter by yydcdut.
the class PGEditView method backTopAndCenterWithAnimation.
public void backTopAndCenterWithAnimation() {
mStepLayout.setVisibility(View.VISIBLE);
if (Build.VERSION.SDK_INT >= 11) {
float centerHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_center_move_top_height);
ObjectAnimator centerAnimator = ObjectAnimator.ofFloat(mCenterLayoutParent, "y", -centerHeight, 0f);
centerAnimator.setDuration(ANIMATION_TIME);
centerAnimator.start();
float topHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_top_height);
ObjectAnimator topAnimator = ObjectAnimator.ofFloat(mFirstTopView, "y", -topHeight, 0f);
topAnimator.setDuration(ANIMATION_TIME);
topAnimator.start();
} else {
mFirstTopView.setVisibility(View.VISIBLE);
float topHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_top_height);
float bottomHeight = mActivity.getResources().getDimension(R.dimen.pg_sdk_edit_bottom_height);
mCenterLayoutParent.setPadding(mCenterLayoutParent.getPaddingLeft(), Math.round(topHeight), mCenterLayoutParent.getPaddingRight(), Math.round(bottomHeight));
}
}
use of android.animation.ObjectAnimator in project WordPress-Android by wordpress-mobile.
the class AniUtils method getFadeInAnim.
private static ObjectAnimator getFadeInAnim(final View target, Duration duration) {
ObjectAnimator fadeIn = ObjectAnimator.ofFloat(target, View.ALPHA, 0.0f, 1.0f);
fadeIn.setDuration(duration.toMillis(target.getContext()));
fadeIn.setInterpolator(new LinearInterpolator());
fadeIn.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
target.setVisibility(View.VISIBLE);
}
});
return fadeIn;
}
use of android.animation.ObjectAnimator in project WordPress-Android by wordpress-mobile.
the class AniUtils method showFab.
/*
* in/out animation for floating action button
*/
public static void showFab(final View view, final boolean show) {
if (view == null)
return;
Context context = view.getContext();
int fabHeight = context.getResources().getDimensionPixelSize(android.support.design.R.dimen.design_fab_size_normal);
int fabMargin = context.getResources().getDimensionPixelSize(R.dimen.fab_margin);
int max = (fabHeight + fabMargin) * 2;
float fromY = (show ? max : 0f);
float toY = (show ? 0f : max);
ObjectAnimator anim = ObjectAnimator.ofFloat(view, View.TRANSLATION_Y, fromY, toY);
if (show) {
anim.setInterpolator(new DecelerateInterpolator());
} else {
anim.setInterpolator(new AccelerateInterpolator());
}
anim.setDuration(show ? Duration.LONG.toMillis(context) : Duration.SHORT.toMillis(context));
anim.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
super.onAnimationStart(animation);
if (view.getVisibility() != View.VISIBLE) {
view.setVisibility(View.VISIBLE);
}
}
@Override
public void onAnimationEnd(Animator animation) {
super.onAnimationEnd(animation);
if (!show) {
view.setVisibility(View.GONE);
}
}
});
anim.start();
}
use of android.animation.ObjectAnimator in project WordPress-Android by wordpress-mobile.
the class AniUtils method getFadeOutAnim.
private static ObjectAnimator getFadeOutAnim(final View target, Duration duration) {
ObjectAnimator fadeOut = ObjectAnimator.ofFloat(target, View.ALPHA, 1.0f, 0.0f);
fadeOut.setDuration(duration.toMillis(target.getContext()));
fadeOut.setInterpolator(new LinearInterpolator());
fadeOut.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
target.setVisibility(View.GONE);
}
});
return fadeOut;
}
use of android.animation.ObjectAnimator in project platform_frameworks_base by android.
the class AdapterViewAnimator method getDefaultOutAnimation.
ObjectAnimator getDefaultOutAnimation() {
ObjectAnimator anim = ObjectAnimator.ofFloat(null, "alpha", 1.0f, 0.0f);
anim.setDuration(DEFAULT_ANIMATION_DURATION);
return anim;
}
Aggregations