Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <set xmlns:android="http://schemas.android.com/apk/res/android">
- <scale
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:fromXScale="1.0"
- android:toXScale="1.0"
- android:fromYScale="1.0"
- android:toYScale="2.0"
- android:pivotX="50%"
- android:pivotY="0%"
- android:duration="500">
- </scale>
- <set
- xmlns:android="http://schemas.android.com/apk/res/android">
- <scale
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:fromXScale="1.0"
- android:toXScale="2.0"
- android:fromYScale="1.0"
- android:toYScale="1.0"
- android:pivotX="50%"
- android:pivotY="50%"
- android:duration="500">
- </scale>
- <translate
- xmlns:android="http://schemas.android.com/apk/res/android"
- android:fromXDelta="0%p"
- android:toXDelta="-44.5%p"
- android:fromYDelta="0"
- android:toYDelta="0"
- android:duration="500">
- </translate>
- @Override
- public void onClick(View v) {
- back = 2;
- animationLay = AnimationUtils.loadAnimation(this, R.anim.toolbar_up);
- layoutDelete.startAnimation(animationLay);
- animationImg = AnimationUtils.loadAnimation(this, R.anim.delete);
- imgDelete.startAnimation(animationImg);
- animationImg.setAnimationListener(new Animation.AnimationListener() {
- @Override
- public void onAnimationStart(Animation animation) {
- Log.i(TAG, "onAnimationStart");
- }
- @Override
- public void onAnimationEnd(Animation animation) {
- Log.i(TAG, "onAnimationEnd");
- ViewGroup.LayoutParams l = imgDelete.getLayoutParams();
- int w = imgDelete.getWidth();
- int h = imgDelete.getHeight();
- l.height = w + w;
- l.width = h + h;
- imgDelete.setLayoutParams(l);
- layoutDelete.setGravity(Gravity.CENTER);
- }
- @Override
- public void onAnimationRepeat(Animation animation) {
- Log.i(TAG, "onAnimationRepeat");
- }
- });
- }
- @Override
- public void onAnimationEnd(Animation animation) {
- Log.i(TAG, "onAnimationEnd");
- ViewGroup.LayoutParams l = imgDelete.getLayoutParams();
- int w = imgDelete.getWidth();
- int h = imgDelete.getHeight();
- l.height = w / 2;
- l.width = h / 2;
- imgDelete.setLayoutParams(l);
- animation = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
- animation.setDuration(1);
- imgDelete.startAnimation(animation);
- animation = new TranslateAnimation(0.0f, 0.0f, 0.0f, 0.0f);
- animation.setDuration(1);
- layoutDelete.startAnimation(animation);
- layoutDelete.setGravity(Gravity.RIGHT);
- }
Add Comment
Please, Sign In to add comment