use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project UltimateRecyclerView by cymcsg.
the class parent method rotationExpandIcon.
@Override
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public void rotationExpandIcon(float from, float to) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
ValueAnimator valueAnimator = ValueAnimator.ofFloat(from, to);
valueAnimator.setDuration(150);
valueAnimator.setInterpolator(new LinearOutSlowInInterpolator());
valueAnimator.addUpdateListener(this);
valueAnimator.start();
}
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project animate by hitherejoe.
the class ForegroundFrame method resizeViewProperty.
private void resizeViewProperty(Property<View, Float> property, float targetScale, int durationOffset) {
ObjectAnimator animator = ObjectAnimator.ofFloat(this, property, 1f, targetScale);
animator.setInterpolator(new LinearOutSlowInInterpolator());
animator.setStartDelay(DELAY_COLOR_CHANGE + durationOffset);
animator.start();
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project PreLollipopTransition by takahirom.
the class SubFragment method onCreateView.
@Nullable
@Override
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
View v = inflater.inflate(R.layout.fragment_sub, container, false);
final ExitFragmentTransition exitFragmentTransition = FragmentTransition.with(this).interpolator(new LinearOutSlowInInterpolator()).to(v.findViewById(R.id.sub_imageView)).start(savedInstanceState);
exitFragmentTransition.exitListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationStart(Animator animation) {
Log.d("TAG", "onAnimationStart: ");
}
@Override
public void onAnimationEnd(Animator animation) {
Log.d("TAG", "onAnimationEnd: ");
}
}).interpolator(new FastOutSlowInInterpolator());
exitFragmentTransition.startExitListening();
return v;
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project Douya by DreaminginCodeZH.
the class ProfileLayout method animateEnter.
private void animateEnter() {
ObjectAnimator animator = ObjectAnimator.ofInt(this, OFFSET, getHeight(), 0);
animator.setDuration(mShortAnimationTime);
animator.setInterpolator(new LinearOutSlowInInterpolator());
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animation) {
if (mListener != null) {
mListener.onEnterAnimationEnd();
}
}
});
animator.start();
}
use of android.support.v4.view.animation.LinearOutSlowInInterpolator in project AndroidChromium by JackyAndroid.
the class FocusAnimator method startAnimator.
private void startAnimator(final Runnable callback) {
// Don't animate anything if the number of children changed.
if (mInitialNumberOfChildren != mLayout.getChildCount()) {
finishAnimation(callback);
return;
}
// Don't animate if children are already all in the correct places.
boolean isAnimationNecessary = false;
ArrayList<Integer> finalChildTops = calculateChildTops();
for (int i = 0; i < finalChildTops.size() && !isAnimationNecessary; i++) {
isAnimationNecessary |= finalChildTops.get(i).compareTo(mInitialTops.get(i)) != 0;
}
if (!isAnimationNecessary) {
finishAnimation(callback);
return;
}
// Animate each child moving and changing size to match their final locations.
ArrayList<Animator> animators = new ArrayList<Animator>();
ValueAnimator childAnimator = ValueAnimator.ofFloat(0f, 1f);
animators.add(childAnimator);
for (int i = 0; i < mLayout.getChildCount(); i++) {
// The child is already where it should be.
if (mInitialTops.get(i).compareTo(finalChildTops.get(i)) == 0 && mInitialTops.get(i + 1).compareTo(finalChildTops.get(i + 1)) == 0) {
continue;
}
final View child = mLayout.getChildAt(i);
final int translationDifference = mInitialTops.get(i) - finalChildTops.get(i);
final int oldHeight = mInitialTops.get(i + 1) - mInitialTops.get(i);
final int newHeight = finalChildTops.get(i + 1) - finalChildTops.get(i);
// Translate the child to its new place while changing where its bottom is drawn to
// animate the child changing height without causing another layout.
childAnimator.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float progress = (Float) animation.getAnimatedValue();
child.setTranslationY(translationDifference * (1f - progress));
if (oldHeight != newHeight) {
float animatedHeight = oldHeight * (1f - progress) + newHeight * progress;
child.setBottom(child.getTop() + (int) animatedHeight);
}
}
});
// Explicitly place the child in its final position in the end.
childAnimator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animator) {
child.setTranslationY(0);
child.setBottom(child.getTop() + newHeight);
}
});
}
// Animate the height of the container itself changing.
int oldContainerHeight = mInitialTops.get(mInitialTops.size() - 1);
int newContainerHeight = finalChildTops.get(finalChildTops.size() - 1);
ValueAnimator layoutAnimator = ValueAnimator.ofInt(oldContainerHeight, newContainerHeight);
layoutAnimator.addUpdateListener(new AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
mLayout.setBottom(((Integer) animation.getAnimatedValue()));
requestChildFocus();
}
});
animators.add(layoutAnimator);
// Set up and kick off the animation.
AnimatorSet animator = new AnimatorSet();
animator.setDuration(ANIMATION_LENGTH_MS);
animator.setInterpolator(new LinearOutSlowInInterpolator());
animator.playTogether(animators);
animator.addListener(new AnimatorListenerAdapter() {
@Override
public void onAnimationEnd(Animator animator) {
finishAnimation(callback);
// Request a layout to put everything in the right final place.
mLayout.requestLayout();
}
});
animator.start();
}
Aggregations