Skip to content

Commit

Permalink
Merge pull request #1878 from ayeung/timob-8324
Browse files Browse the repository at this point in the history
TIMOB-8324: Android: Animation: V8/Rhino: The window background gets transparent when animated object is set up
  • Loading branch information
Opie Cyrus committed Mar 29, 2012
2 parents 76520a5 + 75a779f commit ac3852d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Expand Up @@ -502,6 +502,7 @@ protected class AnimationListener implements Animation.AnimationListener
{
public void onAnimationEnd(Animation a)
{

if (relayoutChild) {
LayoutParams params = (LayoutParams) view.getLayoutParams();
TiConvert.fillLayout(options, params);
Expand All @@ -511,7 +512,8 @@ public void onAnimationEnd(Animation a)
}

if (applyOpacity) {
//There is an android bug where animations still occur after this method. We clear it from the view to correct this.
// There is an android bug where animations still occur after this method. We clear it from the view to
// correct this.
view.clearAnimation();
if (toOpacity.floatValue() == 0) {
view.setVisibility(View.INVISIBLE);
Expand Down
Expand Up @@ -17,6 +17,7 @@
import org.appcelerator.titanium.proxy.TiViewProxy;

import android.content.Context;
import android.os.Build;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.OnHierarchyChangeListener;
Expand Down Expand Up @@ -536,7 +537,15 @@ protected void onLayout(boolean changed, int l, int t, int r, int b)
protected void onAnimationEnd()
{
super.onAnimationEnd();
invalidate();
if (Build.VERSION.SDK_INT < TiC.API_LEVEL_HONEYCOMB) {
// There is an android bug where animations still occur after this method. We clear it from the view to
// correct this. This fixes TIMOB-8324
// (http://stackoverflow.com/questions/4750939/android-animation-is-not-finished-in-onanimationend)
clearAnimation();
// We have to force an invalidate here for TIMOB-7412 (only for 3.0 and below). This is to prevent a
// background color of a view from being transparent after an animation.
invalidate();
}
}

// option0 is left/top, option1 is right/bottom
Expand Down

0 comments on commit ac3852d

Please sign in to comment.