Changing an ImageView source moves another view around in Android
<p>For some reason when I change the source of either of these two views, another view on the Layout changes its position. I've never seen this behaviour before and was looking to see if anyone here on StackOverflow has the answer.</p>

<p>The two image views that get new images are below. The View that jumps to the left when either of the other two ImageViews's sources are changed is @id/activity_video_player_control_seek_scrub</p>

<pre><code>private void togglePlayback(){      
    if (mediaPlayer.isPlaying()){
        if (firstTap){
            fadeControlBarIn();
            firstTap = false;
            setScrubPoint();
        }else{
            ((ImageView)findViewById(R.id.activity_video_player_control_play)).setImageDrawable(getResources().getDrawable(R.drawable.activity_video_player_control_play_up));
            ((ImageView)onScreenControls.findViewById(R.id.stub_video_player_onscreen_controls_playpause)).setImageDrawable(getResources().getDrawable(R.drawable.play));
            fadeOnScreenControlsIn();
            mediaPlayer.pause();
        }
        }else{

            ((ImageView)findViewById(R.id.activity_video_player_control_play)).setImageResource(R.drawable.activity_video_player_control_pause_up);
            ((ImageView)onScreenControls.findViewById(R.id.stub_video_player_onscreen_controls_playpause)).setImageResource(R.drawable.pause);
            fadeOnScreenControlsOut();
            fadeControlBarOut();
            mediaPlayer.start();
            firstTap = true;
        }       
}

&lt;?xml version="1.0" encoding="utf-8"?&gt;
</code></pre>

<p></p>

<pre><code>&lt;RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_gravity="center"
    android:layout_weight="1.0"
    android:weightSum="1.0"
&gt;

    &lt;SurfaceView 
        android:id="@+id/video_activity_surface"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1.0"
    /&gt;

    &lt;ViewStub
        android:id="@+id/activity_video_player_stub_onscreen_controls"
        android:inflatedId="@+id/randomInflated"
        android:layout="@layout/stub_video_player_onscreen_controls"
        android:layout_height="55dip"
        android:layout_width="55dip"
        android:layout_centerInParent="true"
        android:gravity="center"
        android:layout_gravity="center"
    /&gt;

&lt;/RelativeLayout&gt;

&lt;LinearLayout
    android:id="@+id/activity_video_player_control_layout"
    android:layout_width="fill_parent"
    android:layout_height="45dip"
    android:layout_gravity="center"
    android:layout_alignParentBottom="true"
    android:background="@drawable/activity_video_player_control_background"
    android:orientation="horizontal"
    android:weightSum="1.0"
    &gt;
    &lt;ImageView
        android:id="@+id/activity_video_player_control_play"
        android:layout_margin="0dip"
        android:padding="0dip"
        android:src="@drawable/activity_video_player_control_play_up"
        android:layout_width="32dip" 
        android:layout_height="fill_parent" 
        android:layout_weight="0.10"
    /&gt;

    &lt;RelativeLayout 
        android:id="@+id/activity_video_player_control_seek_layout"
        android:layout_gravity="center_vertical"
        android:gravity="center"
        android:layout_width="0dip"
        android:layout_height="fill_parent"
        android:layout_weight="0.90"
    &gt;
        &lt;ImageView 
            android:scaleType="fitXY"
            android:layout_marginRight="20dip"
            android:paddingLeft="15dip"
            android:padding="0dip"
            android:layout_width="fill_parent"
            android:layout_height="16dip"
            android:src="@drawable/activity_video_player_control_seek_bar"
        /&gt;

        &lt;ImageView
            android:id="@+id/activity_video_player_control_seek_scrub"
            android:layout_marginTop="0dip"
            android:layout_height="19dip"
            android:layout_width="19dip"
            android:src="@drawable/activity_video_player_control_scrub_up"
        /&gt;

    &lt;/RelativeLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p></p>
