use of android.view.animation.AccelerateDecelerateInterpolator in project UltimateAndroid by cymcsg.
the class AndroidAnimationsDemoActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.android_animations_activity);
mListView = (ListView) findViewById(R.id.list_items);
mTarget = findViewById(R.id.hello_world);
mAdapter = new EffectAdapter(this);
mListView.setAdapter(mAdapter);
// after start,just click mTarget view, rope is not init
rope = YoYo.with(Techniques.FadeIn).duration(1000).playOn(mTarget);
mListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Techniques technique = (Techniques) view.getTag();
rope = YoYo.with(technique).duration(1200).interpolate(new AccelerateDecelerateInterpolator()).withListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
}
@Override
public void onAnimationEnd(Animator animation) {
}
@Override
public void onAnimationCancel(Animator animation) {
Toast.makeText(AndroidAnimationsDemoActivity.this, "canceled", Toast.LENGTH_SHORT).show();
}
@Override
public void onAnimationRepeat(Animator animation) {
}
}).playOn(mTarget);
}
});
findViewById(R.id.hello_world).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (rope != null) {
rope.stop(true);
}
}
});
}
use of android.view.animation.AccelerateDecelerateInterpolator in project UltimateAndroid by cymcsg.
the class Sample2Activity method simulateErrorProgress.
private void simulateErrorProgress(final CircularProgressButton button) {
ValueAnimator widthAnimation = ValueAnimator.ofInt(1, 99);
widthAnimation.setDuration(1500);
widthAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
widthAnimation.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
Integer value = (Integer) animation.getAnimatedValue();
button.setProgress(value);
if (value == 99) {
button.setProgress(-1);
}
}
});
widthAnimation.start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project appsly-android-rest by 47deg.
the class MainActivity method animateContent.
private void animateContent() {
ViewHelper.setRotation(imageViewIcon, 20);
ViewHelper.setTranslationY(imageViewIcon, -100);
ViewHelper.setTranslationX(textViewCity, 100);
ViewHelper.setAlpha(linearLayoutContent, 0);
ViewHelper.setTranslationY(descriptionTempContent, 200);
ViewHelper.setTranslationY(contentBottom, 200);
animate(imageViewIcon).setDuration(300).setInterpolator(new AccelerateInterpolator()).translationY(0).setListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animator) {
}
@Override
public void onAnimationEnd(Animator animator) {
iconFall(imageViewIcon, 10);
}
@Override
public void onAnimationCancel(Animator animator) {
}
@Override
public void onAnimationRepeat(Animator animator) {
}
}).start();
animate(textViewCity).setDuration(1000).setInterpolator(new AccelerateDecelerateInterpolator()).translationX(0).start();
animate(linearLayoutContent).setDuration(1000).alpha(1).start();
animate(contentBottom).setDuration(1000).translationY(0).start();
animate(descriptionTempContent).setDuration(1000).translationY(0).start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project Notes by Elder-Wu.
the class ExpandableTextView method startCollapseAnimator.
private void startCollapseAnimator() {
int begin = mTvContent.getHeight();
int end = mTvContent.getLineHeight() * mMaxLineCount;
ValueAnimator valueAnimator = ValueAnimator.ofObject(new IntEvaluator(), begin, end);
valueAnimator.setDuration(mTvContent.getLineCount() * (mHasAnimation ? 20 : 1));
valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
valueAnimator.addListener(mAnimatorListener);
valueAnimator.addUpdateListener(mAnimatorUpdateListener);
valueAnimator.start();
}
use of android.view.animation.AccelerateDecelerateInterpolator in project Notes by Elder-Wu.
the class ExpandableTextView method startExpandAnimator.
private void startExpandAnimator() {
int begin = mTvContent.getHeight();
int end = mTvContent.getLineHeight() * mTvContent.getLineCount();
ValueAnimator valueAnimator = ValueAnimator.ofObject(new IntEvaluator(), begin, end);
valueAnimator.setDuration(mTvContent.getLineCount() * (mHasAnimation ? 20 : 1));
valueAnimator.setInterpolator(new AccelerateDecelerateInterpolator());
valueAnimator.addListener(mAnimatorListener);
valueAnimator.addUpdateListener(mAnimatorUpdateListener);
valueAnimator.start();
}
Aggregations