Skip to content
This repository has been archived by the owner on Apr 19, 2018. It is now read-only.

inconsistent animation behavior #34

Closed
shredmaster opened this issue Oct 25, 2012 · 4 comments
Closed

inconsistent animation behavior #34

shredmaster opened this issue Oct 25, 2012 · 4 comments

Comments

@shredmaster
Copy link

I am using this library to implement side navigation like facebook app.

It's really easy to setup. I have a framelayout with content view and menu view. The content view sits on top of the menu view.

on version 4.0:

I call following method to slide the contentview to the right. I can click on the menu item which is way I want it to behave.
ObjectAnimator.ofFloat(contentView, "translationX", theSlideX).start();

the same code on version 2.3.3, it's behaving differently. When content view slides out. I can see the menu view but when I click on the menu view, the content view is the one which receives the click event. how do i fix this?

@JakeWharton
Copy link
Owner

Dupe #31. Can't be fixed.

@shredmaster
Copy link
Author

thank you for your prompt response. I am new to android development, can you show me how to move the contentview to actual position after slide out? much appreciated!!

@shredmaster
Copy link
Author

in case anyone might run into same issue. For pre honeycomb, I use v.layout method to slide the content view. Thanks

public void move(View v, int inSlideAmount) {

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            if (menuOut) {
                inSlideAmount = 0;
            }
            ObjectAnimator.ofFloat(itsListView, "translationX", inSlideAmount).start();
        } else {

            if (menuOut) {
                inSlideAmount = 0 - inSlideAmount;
            }
            v.layout(v.getLeft() + inSlideAmount, 0, v.getLeft() + inSlideAmount + v.getWidth(), v.getHeight());
        }
    }

@shredmaster
Copy link
Author

for below honeycomb, I came up with better solution by updating layout param in the onAnimationEnd listener. This way, the view still get the animation effect.

but there is one weird issue. Jake, if you have the chance, would be please take a look. Thanks for a million.
http://stackoverflow.com/questions/14541265/changecursor-cause-layout-container-of-the-listview-to-reposition

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants