andkulikov / Transitions-Everywhere

Set of extra Transitions on top of Jetpack Transitions Library
Apache License 2.0
4.83k stars 487 forks source link

Targets of a Transition is not removed while using removeTarget (int targetId) #15

Closed Avinash-Bhat closed 9 years ago

Avinash-Bhat commented 9 years ago

Consider the following code:

 Transition transition = ...;

 transition.addTarget(R.id.my_view);

 ...

 transition.removeTarget(R.id.my_view);

It is apparent from the documentation that the call to Transition.removeTarget(int) should remove the view with id R.id.my_view being included in further transitions. But instead the following error will be shown:

 Caused by: java.lang.IndexOutOfBoundsException: Invalid index <some-random-int>, size is 1
        at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
        at java.util.ArrayList.remove(ArrayList.java:403)

this is because the implementation is calling ArrayList.remove(int) instead of ArrayList.remove(Object).

_PS: the upstream bug is at http://b.android.com/167061 or here_

andkulikov commented 9 years ago

thanks. i will check it

Avinash-Bhat commented 9 years ago

@andkulikov, check the PR.

I think this will be the best way of fixing this issue.

Avinash-Bhat commented 9 years ago

@andkulikov any idea when this will be available in maven/bintray?

andkulikov commented 9 years ago

@Avinash-Bhat I think within two days. I want to fix one other issue

andkulikov commented 9 years ago

this fix already in maven with version 1.3.2

Avinash-Bhat commented 9 years ago

+1, thanks

On Sun, Apr 19, 2015, 4:27 AM Andrey Kulikov notifications@github.com wrote:

this fix already in maven with version 1.3.2

— Reply to this email directly or view it on GitHub https://github.com/andkulikov/transitions-everywhere/issues/15#issuecomment-94210536 .