2

I have a LinearLayout which contains only a ListView. LinearLayout fills the entire screen and the listView at first stays at the bottom quarter of the screen. I am setting Top Margin of ListView to a big value to keep the listView at the bottom of the screen. Below illustration might help you to understand my layout better.

enter image description here

Now on a button click I want my listView to slide up and fill the screen. I am using Translate animation just like this

TranslateAnimation animation = new TranslateAnimation(
                    Animation.RELATIVE_TO_SELF,0.0f
                                ,Animation.RELATIVE_TO_SELF, 0.0f
                                ,Animation.RELATIVE_TO_SELF,0.0f
                                ,Animation.RELATIVE_TO_SELF, -0.70f);
animation.setDuration(1000);
animation.setFillAfter(true);
animation.setFillEnabled(true); 
mBottomView.startAnimation(animation);

where mBottomView is my Listview Layout. And this code successfully animates the listView to the top.

Now my problem is when listView fills the screen, and I try to scroll, touch events to the listview is not recognized above listview's original position. ie when I touch anywhere in the yellow space (in the image) to scroll the listView, touch is not getting detected. I am able to scroll below the listView's original position. Why is that?

Krishnabhadra
  • 34,169
  • 30
  • 118
  • 167

1 Answers1

4

I faced same problem and the answer to this problem is completely defined in the answer of this question. EditText stucks after animation and alive back on scrolling......?

Community
  • 1
  • 1
Umar Qureshi
  • 5,985
  • 2
  • 30
  • 40