I have two fragments with-in an activity. I want to implement swipe in one of those fragments. My layout is:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#ffffff"
android:orientation="horizontal" >
<fragment
android:id="@+id/image_list_fragment"
android:name="com.example.fragments.QGridFragment"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="100" >
</fragment>
<fragment
android:id="@+id/image_viewer_fragment"
android:name="com.example.fragments.QViewerFragment"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="85" />
</LinearLayout>
I want to implement swipe in image_viewer_fragment
fragment. I'm looking for a way either using ViewPager
or GestureListener
. For normal activity with no fragments in it I'm able to do using this approach.