title: How to make expandable panel layout in android?
body: <p>I have very complex layout to do in android ?</p>
  
  <p>I need two panels the if one expanded the other is extended and otherwise,
  i would like to make a behavior like slidingdrawer but because i can have in view only button and nothing else i'm in deep trouble.</p>
  
  <p><img src="https://i.stack.imgur.com/Vvscs.png" alt="enter image description here"></p>
  
  <p>here is the example of what i need please help, i have spent already 3 days on it,
  havent found an answer for this.</p>
  
  <p>here is my code`</p>
  
  <p>
  
      
          
          
          </p>
  
  <pre><code>    &lt;RelativeLayout android:id="@+id/imagesContent" android:orientation="vertical" android:layout_alignBottom="@+id/lhsLogo"
                      android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;
          &lt;ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="3dp"
                     android:src="@drawable/orange_price_tag" android:layout_toLeftOf="@+id/lhsLogo" android:layout_alignBottom="@+id/lhsLogo" /&gt;
          &lt;LinearLayout android:layout_centerHorizontal="true" android:orientation="vertical" android:layout_width="wrap_content"
                        android:layout_height="wrap_content"&gt;
              &lt;TextView android:layout_width="fill_parent" android:layout_height="0dp" android:text="50%" android:singleLine="false"
                        android:textColor="#ffffff" android:textSize="17dp" android:id="@+id/discountTypeNumbers" android:layout_weight="1" /&gt;
              &lt;TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="הנחה" android:singleLine="false"
                        android:textColor="#ffffff" android:textSize="14dp" android:id="@+id/discountTypeText" /&gt;
          &lt;/LinearLayout&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;TextView android:id="@+id/detailsTextContent"
                android:layout_below="@+id/imagesContent"
                android:layout_width="fill_parent"
                android:layout_height="200dp"
                android:textSize="11dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:scrollbars = "vertical"
                android:layout_marginTop="10dp"
                android:text="some textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome
                              textsome textsome textsome textsome textsome"
                android:singleLine="false" /&gt;
  
      &lt;RelativeLayout android:id="@+id/frame"
                      android:background="#ffffff"
                   android:layout_width="fill_parent"
                   android:layout_height="wrap_content"
                   android:layout_alignParentBottom="true"&gt;
          &lt;!--... stuff you want to cover at full-size ...--&gt;
          &lt;LinearLayout
                  android:id="@+id/special_details_buttons"
                  android:layout_marginTop="5dp"
                  android:layout_marginLeft="5dp"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"&gt;
  
              &lt;ImageView android:id="@+id/specialTerms"
                         android:layout_width="wrap_content"
                         android:layout_height="fill_parent"
                         android:layout_marginLeft="2dp"
                         android:src="@drawable/special_terms"  /&gt;
  
              &lt;ImageView android:layout_width="wrap_content"
                         android:layout_height="fill_parent"
                         android:layout_marginLeft="5dp"
                         android:src="@drawable/special_details" /&gt;
  
              &lt;CheckBox android:id="@+id/setFavorite" style="@style/favorites_button" android:button="@drawable/favorites_button"/&gt;
  
              &lt;ImageView android:id="@+id/acceptTerms"
                         android:src="@drawable/accept_special"
                         android:layout_width="wrap_content"
                         android:layout_height="fill_parent"
                         android:layout_marginLeft="48dp"
                      /&gt;
          &lt;/LinearLayout&gt;
  
          &lt;RelativeLayout
                  android:layout_below="@+id/special_details_buttons"
                  android:layout_width="fill_parent"
                        android:layout_height="wrap_content"
                        android:layout_gravity="bottom"
                        android:orientation="vertical"&gt;
  
              &lt;il.co.package.widgets.WrappingSlidingDrawer
                      android:id="@+id/drawer"
                      android:layout_width="fill_parent"
                      android:layout_height="200dp"
                      android:content="@+id/content"
                      android:handle="@+id/handle"&gt;
  
                  &lt;RelativeLayout
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:id="@+id/handle"&gt;
  
                      &lt;ImageView android:id="@+id/slide_handle"
                                 android:src="@drawable/expand_open"
                                 android:layout_width="170dp"
                                 android:layout_height="21dp"
                                 android:layout_alignParentRight="true" /&gt;
                  &lt;/RelativeLayout&gt;
  
                  &lt;LinearLayout
                          android:gravity="center"
                          android:layout_width="fill_parent"
                          android:layout_height="wrap_content"
                          android:background="#ffffff"
                          android:id="@+id/content"&gt;
                  &lt;/LinearLayout&gt;
  
              &lt;/il.co.package.widgets.WrappingSlidingDrawer&gt;
          &lt;/RelativeLayout&gt;
      &lt;/RelativeLayout&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>
  `</p>