Skip to content

Commit

Permalink
Update ExpandableLayout.java
Browse files Browse the repository at this point in the history
Added ability to implement AnimationListener.
  • Loading branch information
dinosoeren committed Jan 3, 2015
1 parent 5c1fa67 commit 6ea34f9
Showing 1 changed file with 8 additions and 2 deletions.
Expand Up @@ -40,6 +40,7 @@ public class ExpandableLayout extends RelativeLayout
private Integer duration;
private RelativeLayout contentRelativeLayout;
private RelativeLayout headerRelativeLayout;
private Animation animation;

public ExpandableLayout(Context context)
{
Expand Down Expand Up @@ -111,7 +112,7 @@ private void expand(final View v)
v.getLayoutParams().height = 0;
v.setVisibility(VISIBLE);

Animation animation = new Animation()
animation = new Animation()
{
@Override
protected void applyTransformation(float interpolatedTime, Transformation t)
Expand All @@ -135,7 +136,7 @@ public boolean willChangeBounds() {
private void collapse(final View v)
{
final int initialHeight = v.getMeasuredHeight();
Animation animation = new Animation()
animation = new Animation()
{
@Override
protected void applyTransformation(float interpolatedTime, Transformation t) {
Expand Down Expand Up @@ -208,4 +209,9 @@ public void run()
}, duration);
}
}

@Override
public void setLayoutAnimationListener(Animation.AnimationListener animationListener) {
animation.setAnimationListener(animationListener);
}
}

0 comments on commit 6ea34f9

Please sign in to comment.