How I can start Alpha and Scale animations simultaneous?

Put your problem here if it does not fit any of the other categories.

How I can start Alpha and Scale animations simultaneous?

Postby x-files » Sun Jan 27, 2008 7:06 pm

scale animation:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.             Animation scaleAnimation = new ScaleAnimation(0.2f, 1f, 0.2f, 1f, 120, 160);
  2.  
  3.             scaleAnimation.setDuration(700);
  4.  
  5.             view.startAnimation(scaleAnimation);
  6.  
  7.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


alpha animation:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.             Animation alphaAnimation = new AlphaAnimation(0.5f, 1);
  2.  
  3.             alphaAnimation.setDuration(700);
  4.  
  5.             view.startAnimation(alphaAnimation);
  6.  
  7.  
Parsed in 0.031 seconds, using GeSHi 1.0.8.4


Can I start both animations simultaneous?

Thaks in advance.
x-files
Developer
Developer
 
Posts: 44
Joined: Fri Jan 11, 2008 10:27 am

Top

Postby x-files » Sun Jan 27, 2008 9:57 pm

Solution:
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.         Animation animation = AnimationUtils.loadAnimation(this, android.R.anim.app_enter);
  2.  
  3.         animation.setDuration(1000);
  4.  
  5.         view.startAnimation(animation);
Parsed in 0.034 seconds, using GeSHi 1.0.8.4
x-files
Developer
Developer
 
Posts: 44
Joined: Fri Jan 11, 2008 10:27 am

Postby x-files » Sun Jan 27, 2008 10:04 pm

or like this:
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <set xmlns:android="http://schemas.android.com/apk/res/android">
  2.  
  3.         <translate android:fromYDelta="100%p" android:toYDelta="0" android:duration="300"/>
  4.  
  5.         <alpha android:fromAlpha="0.0" android:toAlpha="1.0" android:duration="300" />
  6.  
  7. </set>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4
x-files
Developer
Developer
 
Posts: 44
Joined: Fri Jan 11, 2008 10:27 am

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: Exabot [Bot] and 17 guests