I have a custom ArrayAdapter for a listView that sits inside a horizontal scrollView. Horizontal scrolling works fine, but for vertical scrolling I had to do some hacks. I just want to know if this is a good idea, since listView is already optimized for vertical scrolling.? Is there a way to scroll without this hack?
Basically hack touchEvent capture for scrollView (parent class) and extend touchEvent to ListView.
scrolLView.setOnTouchListener(new OnTouchListener(){ @Override public boolean onTouch(View arg0, MotionEvent arg1) { lv.setSmoothScrollbarEnabled(true); lv.dispatchTouchEvent(arg1); } });
This causes a scroll and everything works. I just want to know if there are some more things that I need to register.
thanks
source share