Question

I have a view that contains a view buttons that slides out of view, and after it slides away, the buttons that WERE there are still capturing click events in the spot where the buttons were. Here is the code that shows the layout:

share_layout_slide.setVisibility(View.VISIBLE);
TranslateAnimation slide = new TranslateAnimation(0, 0, 100, 0);
slide.setDuration(500);
slide.setFillAfter(true);
slide.setInterpolator(new DecelerateInterpolator((float) 1.5));
share_layout_slide.startAnimation(slide);

and here is the code that hides it:

share_layout_slide.setVisibility(View.GONE);
TranslateAnimation slide = new TranslateAnimation(0, 0, 0, 380);
slide.setDuration(500);
slide.setFillAfter(true);
slide.setInterpolator(new DecelerateInterpolator((float) 1.5));
share_layout_slide.startAnimation(slide);

Any ideas?

Was it helpful?

Solution 2

It turns out the issue was solved by using an xml animation instead of one created from Java.

OTHER TIPS

Where did you put share_layout_slide? What is its parent layout?

Try changing the parent layout to FrameLayout. I had this exact problem before with LinearLayout and RelativeLayout. I changed to FrameLayout and the problem disappears, I'd like to understand why such behavior happening when all of them extend ViewGroup anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top