title: Android. How to set objectAnimator's valueFrom and valueTo according to screen size?
body: <p>I am using slide animation when transaction replacing fragments</p>
  
  <pre><code>    FragmentManager fragmentManager = getFragmentManager();
      FragmentTransaction transaction = fragmentManager
              .beginTransaction();
      transaction.setCustomAnimations(
              R.anim.anim_from_left, R.anim.anim_to_right);
      transaction.replace(R.id.frame_drugstore, fragment).commit();
  </code></pre>
  
  <p>Animation for fragment which comes from left:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set&gt;
  
      &lt;objectAnimator
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:duration="1000"
          android:interpolator="@android:anim/accelerate_decelerate_interpolator"
          android:propertyName="translationX"
          android:valueType="floatType"
          android:valueFrom="-720"
          android:valueTo="0" /&gt;
  
  &lt;/set&gt;
  </code></pre>
  
  <p>Animation for fragment which to the right:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;set&gt;
  
      &lt;objectAnimator
          xmlns:android="http://schemas.android.com/apk/res/android"
          android:duration="1000"
          android:interpolator="@android:anim/accelerate_decelerate_interpolator"
          android:propertyName="translationX"
          android:valueType="floatType"
          android:valueFrom="0"
          android:valueTo="720" /&gt;
  
  &lt;/set&gt;
  </code></pre>
  
  <p>On my Galaxy Nexus (1280×720) this is working as needed. I am thinking about devices which have no 720px width screen.</p>
  
  <p>How to set objectAnimator's valueFrom and valueTo according to screen size?</p>