title: Animation not smooth
body: <p>I have made a app in which on button click i have slided a linear layout.The code to slide the linear layout is working fine but the problem is that it lags when sliding.Also the height which i have set to slide the layout doesnt look proper on all screen sizes(Specially on Nexus 5).Please do help me out</p>
  
  <p>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="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical"&gt;
  
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_marginTop="15dp"
          android:orientation="vertical"&gt;
  
          &lt;ImageView
              android:id="@+id/iv_upload_add"
              android:layout_width="50dp"
              android:layout_height="wrap_content"
              android:layout_gravity="center"
              android:src="@drawable/add" /&gt;
  
  
          &lt;LinearLayout
              android:id="@+id/ll_upload_options"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:background="@drawable/choosefile_bg"
              android:gravity="center"
              android:orientation="vertical"&gt;
  
              &lt;pocketdocs.indiehustlers.com.pocketdocsv2.Utils.TextViewGeneral
                  android:id="@+id/tv_upload_gallery"
                  style="@style/text_view"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_marginTop="20dp"
                  android:padding="5dp"
                  android:text="GALLERY"
                  android:textSize="20sp"
                  android:visibility="visible" /&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="1dp"
                  android:layout_marginLeft="30dp"
                  android:layout_marginRight="30dp"
  
                  android:background="@drawable/line" /&gt;
  
              &lt;pocketdocs.indiehustlers.com.pocketdocsv2.Utils.TextViewGeneral
                  android:id="@+id/tv_upload_camera"
                  style="@style/text_view"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:gravity="bottom"
                  android:padding="5dp"
                  android:text="CAMERA"
                  android:textSize="20sp"
                  android:visibility="visible" /&gt;
  
              &lt;TextView
                  android:layout_width="wrap_content"
                  android:layout_height="1dp"
                  android:layout_marginLeft="30dp"
                  android:layout_marginRight="30dp"
  
                  android:background="@drawable/line" /&gt;
  
              &lt;pocketdocs.indiehustlers.com.pocketdocsv2.Utils.TextViewGeneral
                  android:id="@+id/tv_upload_file"
                  style="@style/text_view"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:gravity="bottom"
                  android:padding="5dp"
                  android:text="FILE"
                  android:textSize="20sp"
                  android:visibility="visible" /&gt;
  
  
          &lt;/LinearLayout&gt;
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_gravity="center"
          android:layout_marginLeft="@dimen/all_left_mar"
          android:layout_marginRight="@dimen/all_right_mar"
          android:layout_weight="2"
          android:gravity="center"
          android:orientation="vertical"&gt;
  
          &lt;pocketdocs.indiehustlers.com.pocketdocsv2.Utils.EditTextFont
              style="@style/edit_text"
              android:drawableBottom="@drawable/line_black"
              android:hint="File Title"
              android:textColor="#000"
              android:textColorHint="#000" /&gt;
  
          &lt;AutoCompleteTextView
              style="@style/edit_text"
              android:layout_marginTop="10dp"
              android:completionThreshold="1"
              android:drawableBottom="@drawable/line_black"
              android:hint="Type"
              android:textColor="#000"
              android:textColorHint="#000" /&gt;
  
          &lt;LinearLayout
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="10dp"
              android:orientation="horizontal"&gt;
  
              &lt;Switch
                  android:id="@+id/switch1"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:checked="false"
                  android:textOff="No"
                  android:textOn="Yes" /&gt;
  
              &lt;pocketdocs.indiehustlers.com.pocketdocsv2.Utils.TextViewGeneral
                  style="@style/text_view"
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="3"
                  android:text="@string/Protect"
                  android:textColor="#000" /&gt;
  
          &lt;/LinearLayout&gt;
  
          &lt;pocketdocs.indiehustlers.com.pocketdocsv2.Utils.EditTextFont
              style="@style/edit_text"
              android:layout_marginTop="10dp"
              android:drawableBottom="@drawable/line_black"
              android:hint="Password"
              android:inputType="numberPassword"
              android:textColor="#000"
              android:textColorHint="#000" /&gt;
  
  
      &lt;/LinearLayout&gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="0dp"
          android:layout_marginLeft="@dimen/all_left_mar"
          android:layout_marginRight="@dimen/all_right_mar"
          android:layout_weight="1"&gt;
  
          &lt;pocketdocs.indiehustlers.com.pocketdocsv2.Utils.ButtonFont
              style="@style/button"
              android:text="UPLOAD" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Code</p>
  
  <pre><code>if (llUploadOptions.getMeasuredHeight() != 0) {
  
  //                    tvGallery.setVisibility(View.GONE);
  //                    tvCamera.setVisibility(View.GONE);
  //                    tvFile.setVisibility(View.GONE);
  
                      ValueAnimator anim = ValueAnimator.ofInt(llUploadOptions.getMeasuredHeight(),200);
                      anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                          @Override
                          public void onAnimationUpdate(ValueAnimator valueAnimator) {
                              int val = (Integer) valueAnimator.getAnimatedValue();
                              ViewGroup.LayoutParams layoutParams = llUploadOptions.getLayoutParams();
                              layoutParams.height = val;
                              llUploadOptions.setLayoutParams(layoutParams);
                          }
                      });
                      anim.setDuration(700);
                      anim.start();
                  } else {
                      ValueAnimator anim = ValueAnimator.ofInt(llUploadOptions.getMeasuredHeight(),250);
                      anim.addUpdateListener(new ValueAnimator.AnimatorUpdateListener() {
                          @Override
                          public void onAnimationUpdate(ValueAnimator valueAnimator) {
                              int val = (Integer) valueAnimator.getAnimatedValue();
                              ViewGroup.LayoutParams layoutParams = llUploadOptions.getLayoutParams();
                              layoutParams.height = val;
                              llUploadOptions.setLayoutParams(layoutParams);
                          }
                      });
                      anim.setDuration(700);
                      anim.start();
  
                  }
  </code></pre>