title: Android Fragments drag or move to left to right or right to left
body: <p>My requirement is need to adjust or move left to right or right to left fragment. My main layout contain two fragment. I need to drag &amp; resize the fragment width like android setting screen / message (on tablet) divider moving right to left or left to right.</p>
  
  <p>My application consider only tablet only. &amp; those two fragment are independently (not master detail) </p>
  
  <p>courses_main.xml</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="horizontal"
      android:baselineAligned="false" &gt;
  
      &lt;fragment
          android:id="@+id/listFragment"
          android:layout_width="0dp"
          android:layout_weight="1"
          android:layout_height="match_parent"
          class="com.mobile.courses.CousesFragment" &gt;&lt;/fragment&gt;
     &lt;View
          android:layout_width="5dp"
          android:layout_height="fill_parent"
          android:background="@color/list_divider_color" /&gt;
      &lt;fragment
          android:id="@+id/detailFragment"
          android:layout_width="0dp"
          android:layout_weight="2"
          android:layout_height="match_parent"
          class="com.mobile.whathappenfeed.DiscussionFeedFragment" &gt;&lt;/fragment&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>CoursesActivity</p>
  
  <pre><code>public class CoursesActivity extends Activity {
  
      @Override
      public void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          getWindow().requestFeature(Window.FEATURE_ACTION_BAR);
          setContentView(R.layout.courses_main);
      }
  
  }
  </code></pre>
  
  <p>This my `CourseFragment.java</p>
  
  <pre><code>    public class CousesFragment extends Fragment {
  private List&lt;Course&gt; courses;
  
  private RefreshableListViewContainer refresh;
  private RefreshableListView listView;
  protected CourseArrayAdapter courseAdapter;
  
  @Override
  public View onCreateView(LayoutInflater inflater, ViewGroup container,
          Bundle savedInstanceState) {
      setHasOptionsMenu(true);
      View view = inflater.inflate(R.layout.courses_fragment, container,
              false);
  
      refresh = (RefreshableListViewContainer) view
              .findViewById(R.id.pull_to_refresh_list);
      listView = (RefreshableListView) refresh
              .findViewById(android.R.id.list);
  
      // Set a listener to be invoked when the list should be refreshed.
      refresh.setOnRefreshListener(new OnRefreshListener() {
          public void onRefresh(boolean loading) {
              refresh.finishLoading();
              reloadCurrentCourses();
          }
      });
  
  
  
      loadAndDisplayCourses();
      return view;
  }
  </code></pre>
  
  <p>This is my <code>DiscussionFragment.java</code></p>
  
  <pre><code>public class DiscussionFeedFragment extends ListFragment implements  OnClickListener {
      @Override
      public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
  
  
          View view = inflater.inflate(R.layout.discussion_fragment, container,false);
  
          return view;
      }
  </code></pre>
  
  <p>This is my <code>course_fragment.xml</code></p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:orientation="vertical" 
      xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;include
          android:id="@+id/list_header_item"
          layout="@layout/list_header_item" /&gt;
  
       &lt;View
          android:padding="4dip" 
          android:layout_width="fill_parent"
          android:layout_height="3dp"
          android:background="@color/list_divider_color" /&gt;
  
  
      &lt;include
          android:id="@+id/empty_courses"
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          layout="@layout/empty_courses"
          android:visibility="gone" /&gt;
      &lt;FrameLayout
          android:layout_width="fill_parent"
          android:layout_height="0dp"
          android:layout_weight="1" 
          android:orientation="vertical" &gt;
  
          &lt;com.mobile.widget.RefreshableListViewContainer
              android:id="@+id/pull_to_refresh_list"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent" &gt;
  
              &lt;com.mobile.widget.RefreshableListViewOverflowItem
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content" /&gt;
  
              &lt;com.mobile.widget.RefreshableListViewItem
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content" /&gt;
  
              &lt;com.mobile.widget.RefreshableListView
                  android:id="@android:id/list"
                  style="@style/MotorolaListViewFooterFix"
                  android:layout_width="fill_parent"
                  android:layout_height="fill_parent"
                  android:background="@android:color/white"
                  android:cacheColorHint="#00000000"
                  android:paddingLeft="10dip" 
                  android:paddingTop="10dip" 
                  android:divider="@drawable/list_item_divider"
                  android:dividerHeight="3dp"
                  android:drawSelectorOnTop="true"
                  android:fadingEdge="none"
                  android:smoothScrollbar="true"
                  android:fastScrollEnabled="false"
                  android:footerDividersEnabled="true"
                  android:headerDividersEnabled="true"
                  android:listSelector="@drawable/item_background_holo_light"
                  android:textFilterEnabled="true" /&gt;
  
          &lt;/com.mobile.widget.RefreshableListViewContainer&gt;
      &lt;/FrameLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>I need to adjust fragment  let to right or right to left. Like master/detail or setting screen. But I didn't create as master detail application. How to do this part?</p>