title: Android translate animation: moved view is overlapped
body: <p>I have two <code>TextViews</code> in my <code>Activity</code> (let's call them TV1 and TV2), both belonging to different <code>RelativeLayouts</code>. I created a <code>TranslateAnimation</code> to move TV1 from its location to TV2's location. The problem is that, when TV1 reaches TV2's <code>RelativeLayout</code>, it gets under it (the moved <code>TextView</code> is overlapped by TV2's layout), and I want TV1 to be above this layout. Is there any way to bring it to front?</p>
  
  <p>Thanks!</p>
  
  <p>[EDIT] </p>
  
  <p>I add my layout code. I want to move <strong>timeText</strong> to <strong>numTimeValue</strong>. As you can see, timeText is declared after numTimeValue. Also, I tried this:</p>
  
  <pre><code>mTimeTextView.bringToFront();
  ((View)mTimeTextView.getParent()).bringToFront();
  </code></pre>
  
  <p>and it's still overlapped.</p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/outer_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout
          android:id="@+id/header"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:baselineAligned="false"
          android:orientation="vertical" &gt;
  
          &lt;LinearLayout
              android:id="@+id/pointsLayout"
              style="@style/ScoreBar"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:baselineAligned="false"
              android:orientation="horizontal" &gt;
  
              &lt;LinearLayout
                  android:id="@+id/numCorrectLayout"
                  android:layout_width="0dip"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:orientation="vertical" &gt;
  
                  &lt;TextView
                      android:id="@+id/numCorrectTitle"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_horizontal"
                      android:text="@string/num_correct_title"
                      android:textSize="16sp" /&gt;
  
                  &lt;TextView
                      android:id="@+id/numGuessed"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_horizontal"
                      android:textSize="22sp" /&gt;
              &lt;/LinearLayout&gt;
  
              &lt;LinearLayout
                  android:id="@+id/numTimeLayout"
                  android:layout_width="0dip"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:orientation="vertical" &gt;
  
                  &lt;TextView
                      android:id="@+id/numTimeTitle"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_horizontal"
                      android:text="@string/num_time_title"
                      android:textSize="16sp" /&gt;
  
                  &lt;TextView
                      android:id="@+id/numTimeValue"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_gravity="center_horizontal"
                      android:textSize="22sp" /&gt;
              &lt;/LinearLayout&gt;
          &lt;/LinearLayout&gt;
  
          &lt;RelativeLayout
              android:id="@+id/timeLayout"
              android:layout_width="fill_parent"
              android:layout_height="wrap_content"
              android:orientation="horizontal" &gt;
  
              &lt;ProgressBar
                  android:id="@+id/time_progbar"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_centerVertical="true"
                  android:layout_marginRight="10dp"
                  android:layout_toLeftOf="@+id/timeText"
                  android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
                  android:indeterminateOnly="false"
                  android:maxHeight="20dip"
                  android:minHeight="20dip"
                  android:padding="15dp"
                  android:progressDrawable="@drawable/time_progressbar" /&gt;
  
              &lt;TextView
                  android:id="@+id/timeText"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_alignParentRight="true"
                  android:layout_centerVertical="true"
                  android:layout_marginRight="5dp"
                  android:textSize="30sp" /&gt;
          &lt;/RelativeLayout&gt;
      &lt;/LinearLayout&gt;
  
      &lt;ImageView
          android:id="@+id/movieImage"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/header"
          android:layout_centerHorizontal="true"
          android:layout_marginBottom="30dp"
          android:contentDescription="@string/movie_to_guess" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>[EDIT2]</p>
  
  <p>Simplified version:</p>
  
  <pre><code>&lt;RelativeLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/game_layout"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:orientation="vertical" &gt;
  
      &lt;LinearLayout
          android:id="@+id/pointsLayout"
          style="@style/ScoreBar"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:baselineAligned="false"
          android:orientation="horizontal" &gt;
  
              &lt;TextView
                  android:id="@+id/numTimeValue"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:layout_gravity="center_horizontal"
                  android:textSize="22sp" /&gt;
          &lt;!--  &lt;/LinearLayout&gt; --&gt;
      &lt;/LinearLayout&gt;
  
      &lt;RelativeLayout
          android:id="@+id/timeLayout"
          android:layout_width="fill_parent"
          android:layout_height="wrap_content"
          android:layout_below="@+id/pointsLayout"
          android:orientation="horizontal" &gt;
  
          &lt;ProgressBar
              android:id="@+id/time_progbar"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_centerVertical="true"
              android:layout_marginRight="10dp"
              android:layout_toLeftOf="@+id/timeText"
              android:indeterminateDrawable="@android:drawable/progress_indeterminate_horizontal"
              android:indeterminateOnly="false"
              android:maxHeight="20dip"
              android:minHeight="20dip"
              android:padding="15dp"
              android:progressDrawable="@drawable/time_progressbar" /&gt;
  
          &lt;TextView
              android:id="@+id/timeText"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:layout_alignParentRight="true"
              android:layout_centerVertical="true"
              android:layout_marginRight="5dp"
              android:textSize="30sp" /&gt;
      &lt;/RelativeLayout&gt;
  
      &lt;ImageView
          android:id="@+id/movieImage"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_below="@+id/timeLayout"
          android:layout_centerHorizontal="true"
          android:layout_marginBottom="30dp"
          android:contentDescription="@string/movie_to_guess" /&gt;
  &lt;/RelativeLayout&gt;
  </code></pre>