title: Android and center text between two images of different size
body: <p>Imagine I have a top bar which has a parent-container.</p>
  
  <ul>
  <li>I want to have text in center of it.</li>
  <li>To the left I have a small-width-image.</li>
  <li>To the right I have a large-width-image.</li>
  </ul>
  
  <p>(Because of the difference in image sizes, I have given each image a parent with the same width. This was to ease text-centering while being able to track e.g. clicks on images correctly. If it had not been necessary to track clicks, I could just have made sure the images were same size with transparency in them.)</p>
  
  <p>I am trying to solve above using the following layout but horizontally viewed, the result is:</p>
  
  <ul>
  <li>Left-image is not correctly alligned to left within its parent.</li>
  <li>Text is immediately following the left part, not in center.</li>
  <li>Right-image is immediately following the center part.</li>
  </ul>
  
  <p>Thus total failue. Here is the XML code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     
   android:layout_width="match_parent" 
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:id="@+id/myTitleLayout"
    &gt;
  &lt;LinearLayout            
    android:layout_height="match_parent"
    android:orientation="horizontal"  
    android:layout_width="100dp"
    android:gravity="left"
    android:layout_gravity="left"    
  &gt;       
  &lt;ImageView android:id="@+id/myTitleLogoLeft" 
              android:layout_width="wrap_content" 
              android:layout_height="match_parent"
              android:background="@drawable/shared__menu__transparent"
              android:padding="2dp"
              android:visibility="visible"
              android:gravity="left"
              android:layout_gravity="left"
  /&gt;                        
  &lt;/LinearLayout&gt;   
  &lt;TextView 
    android:id="@+id/myTitleText" 
    android:text="@string/dotdotdot" 
    android:layout_width="wrap_content" 
    android:layout_height="match_parent"
    android:gravity="center"  
    android:layout_gravity="center"    
  /&gt;
  &lt;LinearLayout         
    android:layout_height="match_parent"
    android:orientation="horizontal"  
    android:layout_width="100dp"
    android:gravity="right"
    android:layout_gravity="right"
  &gt;       
  &lt;ImageView android:id="@+id/myTitleLogoRight" 
              android:layout_width="wrap_content" 
              android:layout_height="match_parent"
              android:background="@drawable/shared__menu__transparent"
              android:padding="2dp"
              android:visibility="visible"
              android:gravity="right"
              android:layout_gravity="right"                         
  /&gt;                        
  &lt;/LinearLayout&gt;
  
  
  &lt;/LinearLayout&gt;
  </code></pre>