I have a main Layout including 2 layout, one containing a FrameLayout with a Fragment inside. And the other one with a LinearLayout containing a ListView. This is how look my main layout :
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/map_layout" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="1"></include>
<include layout="@layout/list_layout" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_weight="6"></include>
</LinearLayout>
</ScrollView>
</LinearLayout>
The first Fragment contain a map and the second contain a custom ListView with its own listAdapter.
So here my problem, I know it's kind of triky to put a ListView in a ScrollView. But in my onCreateView of my ListFragment.java I put this :
list.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
v.getParent().requestDisallowInterceptTouchEvent(true);
return false;
}
});
But the ListView keep catch the scroll. At a moment, the ScrollView bug and put the map and le list down of an infite ScrollView.
How can I do to make it work ?