title: Android ObjectAnimator animate translationY same proportion on all screen sizes
body: <p>I am using <code>ObjectAnimator</code> to slide up a background image to reveal a <code>listView</code> below. The <code>listView</code> has a <code>weight</code> of <code>0.7f</code> so that it will be the same proportions on all screen sizes.</p>
  
  <p><strong>Using <code>ObjectAnimator</code> is it possible to then slide up my background image with that same <code>0.7</code> proportion, being the same on all screens?</strong></p>
  
  <p>Background image and <code>listView</code>:</p>
  
  <pre><code>&lt;LinearLayout
   android:layout_width="match_parent"
   android:layout_height="match_parent"
   android:orientation="vertical"
   android:weightSum="1" &gt;
  
   &lt;LinearLayout
       android:layout_width="match_parent"
       android:layout_height="0dp"
       android:layout_weight="0.3" &gt;
   &lt;/LinearLayout&gt;
  
   &lt;ListView
       android:id="@+id/listView"
       android:layout_width="match_parent"
       android:layout_height="0dp"
       android:layout_weight="0.7"
       android:background="#303030"
       android:divider="#555555"
       android:dividerHeight="1dp" &gt;
  
   &lt;/ListView&gt;
  
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Animation code:</p>
  
  <pre><code>FrameLayout mainView = (FrameLayout)findViewById(R.id.mainView);
  ObjectAnimator mover = ObjectAnimator.ofFloat(mainView, "translationY", !historyShown ? -500 : 0);
  mover.setDuration(300);
  mover.start();
  </code></pre>