title: Scaling animation on different screen size
body: <p>Hey I have the following problem whan I animate my floating buttons - namely they are scaling badly. First of all, fab buttons on the second Image are higher than they should. Event main floating button with "+" is not rotating. I anyone know how to deal with it please answer me.</p>
  
  <p>Image left HTC One MAX, screen HD - SKD21 lolipop, emulator 768x1280 SKD 17 jelly bean
  <a href="https://i.stack.imgur.com/PCKEs.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PCKEs.jpg" alt="enter image description here"></a></p>
  
  <p>my code in Activity.PhotoGallery</p>
  
  <pre><code> private void showFabs(){
      Animation show_fab_photo = AnimationUtils.loadAnimation(getApplication(), R.anim.fab_add_photo_show);
      FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) fabAddPhoto.getLayoutParams();
      layoutParams.bottomMargin += (int) (fabAddPhoto.getHeight() * 1.7);
      fabAddPhoto.setLayoutParams(layoutParams);
      fabAddPhoto.startAnimation(show_fab_photo);
      fabAddPhoto.setClickable(true);
  
      Animation show_fab_gallery = AnimationUtils.loadAnimation(getApplication(), R.anim.fab_add_from_gallery_show);
      FrameLayout.LayoutParams layoutParamsGallery = (FrameLayout.LayoutParams) fabAddFromGallery.getLayoutParams();
      layoutParamsGallery.bottomMargin += (int) (fabAddFromGallery.getHeight() * 3.4);
      fabAddFromGallery.setLayoutParams(layoutParamsGallery);
      fabAddFromGallery.startAnimation(show_fab_gallery);
      fabAddFromGallery.setClickable(true);
  
      Animation rotateFabAdd = AnimationUtils.loadAnimation(getApplication(), R.anim.fab_gallery_show);
      fabAdd.startAnimation(rotateFabAdd);
  }
  
  private void hideFabs(){
      Animation hide_fab_photo = AnimationUtils.loadAnimation(getApplication(), R.anim.fab_add_photo_hide);
      FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) fabAddPhoto.getLayoutParams();
      layoutParams.bottomMargin -= (int) (fabAddPhoto.getHeight() * 1.7);
      fabAddPhoto.setLayoutParams(layoutParams);
      fabAddPhoto.startAnimation(hide_fab_photo);
      fabAddPhoto.setClickable(false);
  
      Animation hide_fab_gallery = AnimationUtils.loadAnimation(getApplication(), R.anim.fab_add_from_gallery_hide);
      FrameLayout.LayoutParams layoutParamsGallery = (FrameLayout.LayoutParams) fabAddFromGallery.getLayoutParams();
      layoutParamsGallery.bottomMargin -= (int) (fabAddFromGallery.getHeight() * 3.4);
      fabAddFromGallery.setLayoutParams(layoutParamsGallery);
      fabAddFromGallery.startAnimation(hide_fab_gallery);
      fabAddFromGallery.setClickable(false);
  
      Animation rotateFabAdd = AnimationUtils.loadAnimation(getApplication(), R.anim.fab_gallery_hide);
      fabAdd.startAnimation(rotateFabAdd);
  }
  </code></pre>
  
  <p>And my animations XML files
  <strong>Fab with camera</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:fillAfter="true"&gt;
      &lt;!-- Rotate --&gt;
      &lt;rotate
          android:duration="500"
          android:fromDegrees="30"
          android:interpolator="@android:anim/linear_interpolator"
          android:pivotX="50%"
          android:pivotY="50%"
          android:repeatCount="0"
          android:repeatMode="reverse"
          android:toDegrees="0"&gt;&lt;/rotate&gt;
  
      &lt;!--Move--&gt;
      &lt;translate
          android:duration="800"
          android:fromXDelta="0%"
          android:fromYDelta="170%"
          android:interpolator="@android:anim/linear_interpolator"
          android:toXDelta="0%"
          android:toYDelta="0%"&gt;&lt;/translate&gt;
  
  
      &lt;!--Fade In--&gt;
      &lt;alpha
          android:duration="1500"
          android:fromAlpha="0.0"
          android:interpolator="@android:anim/decelerate_interpolator"
          android:toAlpha="1.0"&gt;&lt;/alpha&gt;
  
  &lt;/set&gt;
  </code></pre>
  
  <p><strong>Fab with image</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set xmlns:android="http://schemas.android.com/apk/res/android"
      android:fillAfter="true"&gt;
      &lt;!-- Rotate --&gt;
      &lt;rotate
          android:duration="500"
          android:fromDegrees="30"
          android:interpolator="@android:anim/linear_interpolator"
          android:pivotX="50%"
          android:pivotY="50%"
          android:repeatCount="0"
          android:repeatMode="reverse"
          android:toDegrees="0"&gt;&lt;/rotate&gt;
  
      &lt;!--Move--&gt;
      &lt;translate
          android:duration="800"
          android:fromXDelta="0%"
          android:fromYDelta="340%"
          android:interpolator="@android:anim/linear_interpolator"
          android:toXDelta="0%"
          android:toYDelta="0%"&gt;&lt;/translate&gt;
  
      &lt;!--Fade In--&gt;
      &lt;alpha
          android:duration="1500"
          android:fromAlpha="0.0"
          android:interpolator="@android:anim/decelerate_interpolator"
          android:toAlpha="1.0"&gt;&lt;/alpha&gt;
  &lt;/set&gt;
  </code></pre>