Animation. How to remove flashing effect?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Postby mangaluve » Wed Sep 02, 2009 10:42 pm

Well the Handler solution was meant for the other guys code... in your case, you could try the following

For your animation, try setting the following properties:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. t.setFillAfter(true);
  2.  
  3. t.setFillEnabled(true);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4


also, in your onAnimationEnd, change it to
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. public void onAnimationEnd(Animation animation) {
  2.  
  3.                         v.setAnimation(null);
  4.  
  5.                         v.setLayoutParams(new AbsoluteLayout.LayoutParams(v.getLayoutParams().width, v.getLayoutParams().height, xTargeted, yTargeted));        
  6.  
  7.                 }
Parsed in 0.031 seconds, using GeSHi 1.0.8.4

That should do it. It's also nicer to change the v.setLayoutParams line to something like
Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. v.layout(xTargeted, yTargeted, xTargeted + v.getWidth(), yTargeted + v.getHeight());
Parsed in 0.034 seconds, using GeSHi 1.0.8.4

but it will still work without it.
mangaluve
Experienced Developer
Experienced Developer
 
Posts: 82
Joined: Mon Mar 23, 2009 8:59 pm

Top

Postby AsTeR » Thu Sep 03, 2009 8:58 am

I'll test this evening.

Thanks
AsTeR
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Jun 17, 2008 8:36 am

Postby AsTeR » Fri Sep 04, 2009 6:57 pm

Thank you sir :) !! Evertything works fine, everything but the v.layout, I'm supposing that there's a problem in getting the width of the View.

One last question : do you know why is there the letter 'm' at the beginning of each attribute, is that like the '_' meaning that a the attribute is private ?
AsTeR
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Jun 17, 2008 8:36 am

Postby mangaluve » Sat Sep 05, 2009 11:37 pm

It's a conventioned in Android, for non-static and non-public fields in a class. Don't really know what the 'm' stands for :)
mangaluve
Experienced Developer
Experienced Developer
 
Posts: 82
Joined: Mon Mar 23, 2009 8:59 pm

Postby AsTeR » Sat Sep 05, 2009 11:39 pm

Ok, like me ;)
AsTeR
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Jun 17, 2008 8:36 am

Postby pskink » Sun Sep 06, 2009 9:23 am

mangaluve wrote:It's a conventioned in Android, for non-static and non-public fields in a class. Don't really know what the 'm' stands for :)


mEmber ?
pskink
pskink
Master Developer
Master Developer
 
Posts: 719
Joined: Mon Nov 24, 2008 3:49 pm

Top

Postby AsTeR » Sun Sep 06, 2009 10:17 am

Now you've said it, it seems obvious ;)

Thanks
AsTeR
Junior Developer
Junior Developer
 
Posts: 19
Joined: Tue Jun 17, 2008 8:36 am

Top
Previous

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 8 guests