title: How to set widgets at Center vertically on LinearLayout
body: <p>I want to set the <code>Widgets</code> at <code>center_vertical</code> on my <code>horizontal</code> <code>LinearLayout</code> and set the last <code>Textview</code> at right side of parent layout. </p>
  
  <p>I tried it out but I'm having a hard time. I included my code below.</p>
  
  <blockquote>
    <p>xml layout:</p>
  </blockquote>
  
  <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="48dp"
      android:orientation="horizontal"
      android:background="@drawable/list_selector"&gt;
  
      &lt;ImageView
          android:id="@+id/icon"
          android:layout_width="25dp"
          android:layout_height="wrap_content"
          android:layout_alignParentLeft="true"
          android:layout_marginLeft="12dp"
          android:layout_marginRight="12dp"
          android:contentDescription="@string/desc_list_item_icon"
          android:src="@drawable/image1"
          android:layout_centerVertical="true" /&gt;
  
      &lt;TextView
          android:id="@+id/title"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_toRightOf="@id/icon"
          android:minHeight="?android:attr/listPreferredItemHeightSmall"
          android:textAppearance="?android:attr/textAppearanceListItemSmall"
          android:textColor="@color/colorPrimary"
          android:layout_centerVertical="true"
          android:text="Hello world"
          android:paddingRight="40dp"/&gt;
  
      &lt;TextView android:id="@+id/counter"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:background="@drawable/counter_bg"
          android:layout_alignParentRight="true"
          android:layout_centerVertical="true"
          android:layout_marginRight="8dp"
          android:textColor="@color/counter_text_color"/&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is what I'm trying to produce:</p>
  
  <p><a href="https://i.stack.imgur.com/eOvfg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eOvfg.png" alt="enter image description here"></a></p>