title: Swipe between two layouts overlapped on each other in Framelayout
body: <p>I want to swipe between two linear layouts which are wrapped in frame layout. At one time, only one of the linear layout is visible. I am using button to show/hide them. I want to implement swipe functionality in them. I tried ViewFliper but didn't work out on finger swipe. Is it possible to do it using ViewPager?</p>
  
  <p>Layout XML is</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>    &lt;FrameLayout
          android:layout_width="fill_parent"
          android:layout_height="fill_parent"
          android:background="#00000000" &gt;
  
          &lt;LinearLayout
              android:id="@+id/layTopUp"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:background="@drawable/yellowspace"
              android:gravity="center_vertical|center_horizontal"
              android:orientation="vertical"
              android:padding="25dp"
              android:visibility="visible" &gt;
  
              &lt;TextView
                  android:id="@+id/textView1"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp"
                  android:text="XXX"
                  android:textColor="#000000" /&gt;
  
              &lt;Spinner
                  android:id="@+id/spnTopupOperator"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp" /&gt;
  
              &lt;TextView
                  android:id="@+id/textView2"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp"
                  android:text="XXX"
                  android:textColor="#000000" /&gt;
  
              &lt;LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="10dp"
                  android:gravity="center_vertical|center_horizontal" &gt;
  
                  &lt;TextView
                      android:id="@+id/textView3"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:text="XXX"
                      android:textColor="#000000" /&gt;
  
                  &lt;EditText
                      android:id="@+id/etTopUpCode"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:ems="3"
                      android:hint="Code"
                      android:inputType="number"
                      android:maxLength="3" &gt;
  
                      &lt;requestFocus /&gt;
                  &lt;/EditText&gt;
  
                  &lt;EditText
                      android:id="@+id/etTopUpNumber"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:ems="7"
                      android:hint="Number"
                      android:inputType="number"
                      android:maxLength="7"
                      android:shadowColor="#000000" /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;TextView
                  android:id="@+id/textView4"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp"
                  android:text="XXX"
                  android:textColor="#000000" /&gt;
  
              &lt;Spinner
                  android:id="@+id/spnTopupAmount"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp" /&gt;
  
              &lt;LinearLayout
                  android:id="@+id/layConv"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp"
                  android:gravity="center_vertical|center_horizontal"
                  android:orientation="horizontal" &gt;
  
                  &lt;TextView
                      android:id="@+id/tvConvertedAmount"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:gravity="center_vertical|center_horizontal"
                      android:text="XXX "
                      android:textColor="#000000" /&gt;
  
                  &lt;ProgressBar
                      android:id="@+id/pbConversion"
                      style="?android:attr/progressBarStyleSmall"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:visibility="gone" /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;ImageButton
                  android:id="@+id/bTopUpSend"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="3dp"
                  android:background="@drawable/sendrechbotton" /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;LinearLayout
              android:id="@+id/layScratchCard"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:background="@drawable/yellowspace"
              android:gravity="center_vertical|center_horizontal"
              android:orientation="vertical"
              android:padding="25dp"
              android:visibility="gone" &gt;
  
              &lt;TextView
                  android:id="@+id/textView6"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="XXXX"
                  android:textColor="#000000" /&gt;
  
              &lt;Spinner
                  android:id="@+id/spnRechargeOperator"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content" /&gt;
  
              &lt;TextView
                  android:id="@+id/textView7"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="XXX"
                  android:textColor="#000000" /&gt;
  
              &lt;EditText
                  android:id="@+id/etRechargeEmail"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:ems="10"
                  android:hint="Email"
                  android:inputType="textEmailAddress" /&gt;
  
              &lt;TextView
                  android:id="@+id/textView8"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:text="XXXX"
                  android:textColor="#000000" /&gt;
  
              &lt;Spinner
                  android:id="@+id/spnRechargeAmount"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content" /&gt;
  
              &lt;ImageButton
                  android:id="@+id/bSendCard"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:background="@drawable/sendcardbotton" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/FrameLayout&gt;
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>