title: How to handle GridView with cell of different heights?
body: <p>NOTE: OK, I admit the title is a bit vague, but English is not my main language, and I'm not sure how to describe the problem in one sentance. </p>
  
  <h2>Background</h2>
  
  <p>I'm trying to create an app that shows all apps information on a gridView.</p>
  
  <p>The gridView has its numColumns set to auto_fit , so that its number of columns will be set nicely for all types of screens.</p>
  
  <h2>The problem</h2>
  
  <p>Since each app's information can sometimes be long, the cell height can be different from those that are next to it.</p>
  
  <p>I want the grid cells to be of the same width (which works fine on all cases), and for each row, the height should be determined by the max height of the row's cells.</p>
  
  <p>This causes weird things to occur:</p>
  
  <ol>
  <li>Rare: some cells are becoming empty . sometimes, when scrolling and returning there, the cells get filled...</li>
  <li>Quite common: some cells draw over other cells.</li>
  <li>Quite common: some cells don't take the space they can take , leaving empty space that cannot be clicked.</li>
  <li>Very rare: when playing with the scrolling, if you scroll all the way to the top, you get the entire grid to be empty and not scrollable ... </li>
  </ol>
  
  <p>Here is a screenshot showing both #2 and #3 issues (they don't usually show together) :</p>
  
  <p><img src="https://i.stack.imgur.com/QhIFT.png" alt="enter image description here"></p>
  
  <h2>Code I've used</h2>
  
  <p>This is the xml of the grid cell :</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:background="@drawable/list_divider_holo_dark" &gt;
  
      &lt;ImageView
          android:id="@+id/appIconImageView"
          android:layout_width="48dip"
          android:layout_height="48dip"
          android:layout_alignParentLeft="true"
          android:layout_centerVertical="true"
          android:adjustViewBounds="true"
          android:contentDescription="@string/app_icon"
          android:src="@drawable/ic_menu_help" /&gt;
  
      &lt;TextView
          android:id="@+id/appLabelTextView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignParentTop="true"
          android:layout_toLeftOf="@+id/isSystemAppImageView"
          android:layout_toRightOf="@+id/appIconImageView"
          android:ellipsize="marquee"
          android:text="label"
          android:textAppearance="?android:attr/textAppearanceLarge"
          android:textStyle="bold"
          tools:ignore="HardcodedText" /&gt;
  
      &lt;TextView
          android:id="@+id/appDescriptionTextView"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/appLabelTextView"
          android:layout_below="@+id/appLabelTextView"
          android:layout_toLeftOf="@+id/isSystemAppImageView"
          android:ellipsize="marquee"
          android:text="description"
          tools:ignore="HardcodedText" /&gt;
  
      &lt;ImageView
          android:id="@+id/isSystemAppImageView"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignBottom="@+id/appDescriptionTextView"
          android:layout_alignParentRight="true"
          android:layout_alignParentTop="true"
          android:adjustViewBounds="true"
          android:contentDescription="@string/content_description_this_is_a_system_app"
          android:src="@drawable/stat_sys_warning" /&gt;
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <h2>What I've tried</h2>
  
  <p>I've tried multiple possible solutions:</p>
  
  <ol>
  <li><p>using HorizontalListView seems to solve this, but then it doesn't allow clicking/long clicking on items.</p></li>
  <li><p>I've found a nice library for making the textViews have a "marquee" effect (<a href="https://github.com/ened/Android-MarqueeView" rel="noreferrer"><strong>here</strong></a>) , but its license isn't so permissive. </p></li>
  <li><p>Setting the cell height as fixed one or setting the textViews to have fixed lines count also work, but then it cuts down (part of) the content of the textViews without the ability to show them.</p></li>
  <li><p>I've also tried using linearLayouts instead of RelativeLayout, but it didn't help.</p></li>
  <li><p>a possible solution is to get the max height used by all views on the gridView (using getView on all items) , similar to <a href="http://pastebin.com/EV0Z8Uz0" rel="noreferrer"><strong>this code</strong></a>, but it assumes you know the number of columns , and that you do want all cells to be of the same height.</p></li>
  </ol>
  
  <h2>The question</h2>
  
  <p>How should I handle this?</p>
  
  <p>Should I really use something like <a href="https://github.com/etsy/AndroidStaggeredGrid" rel="noreferrer"><strong>StaggeredGrid</strong></a> ? </p>
  
  <p>Is there a way to put the textViews to stay fixed in size yet allow them to show their content using scrolling (manually or automatically) ?</p>