title: Defining sizes in pixels
body: <p>I have a ListView with a custom layout, whichs consists of an image on the left hand side, and two TextViews next to it.</p>
  
  <p>Since the height of the list item should not be higher than the image, I have considered defining the height to be 150px, which is the size of the image.</p>
  
  <p>However, this is causing Android Studio to show me a warning.</p>
  
  <p>Is setting the height of the item in pixels considered bad practice in this case, and if so, how should I fix it?</p>
  
  <pre><code>&lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="wrap_content"&gt;
  
  &lt;ImageView
      android:id="@+id/image"
      android:layout_width="wrap_content"
      android:layout_height="match_parent"
      android:layout_alignParentLeft="true"
      android:adjustViewBounds="true"
      android:scaleType="centerInside"
      android:src="@mipmap/ic_launcher" /&gt;
  
  &lt;LinearLayout
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      android:orientation="vertical"
      android:padding="8dp"&gt;
  
      &lt;TextView
          android:id="@+id/title"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:textAppearance="?android:textAppearanceLarge"
          tools:text="Text" /&gt;
  
      &lt;TextView
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:singleLine="true"
          android:textAppearance="?android:textAppearanceMedium"
          tools:text="Text" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is a picture of the layout I want to create:</p>
  
  <p><a href="https://i.stack.imgur.com/u36pJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/u36pJ.png" alt=""></a></p>