2359media / EasyAndroidAnimations

Apache License 2.0
1.39k stars 313 forks source link

Problem with Andorid API 7.0 #27

Open AhmadHegazy opened 7 years ago

AhmadHegazy commented 7 years ago

I have a problem while animate simple panel from right to left it animate correctly but just one time only, after try to do it again and again nothing happen. this is just with android API 7.0. before this every thing work perfectly.

wisien92 commented 7 years ago

There is workaround. You need to store initial location. You will need 2 dimentional array:

private int[] location = new int[2];

Before animation starts get location:

view.getLocationOnScreen(location);

Then add new animation listener and restore position in onAnimationEnd:

new AnimationListener() {
    @Override
    public void onAnimationEnd(Animation animation) {
        view.setX(location[0]);
        view.setY(location[1]);
    }
}

Ugly but works - and I hope but doubt that lib will be updated.

Hemant0601 commented 7 years ago

I faced the same, when is a standard fix expected?