title: Custom a GridView like win 8 style
body: <p>I need to custom a gridview that can be showed like following pic
  <img src="https://i.stack.imgur.com/VYze8.png" alt="enter image description here"></p>
  
  <p>As you see, every patch's width and height is same.I have custom a gridview, but encounter a problem.when the screen being scrolled, the onMeasure() method is called many times.Even you stop to scroll the screen, it also being called.</p>
  
  <pre><code>public class FixRowGridView extends GridView {
  
  private static final String TAG = "FixRowGridView";
  
  private int mChildHeight;
  
  public FixRowGridView(Context context, AttributeSet attrs, int defStyle) {
  
      super(context, attrs, defStyle);
      // TODO Auto-generated constructor stub
  
  }
  
  public FixRowGridView(Context context, AttributeSet attrs) {
  
      super(context, attrs);
      // TODO Auto-generated constructor stub
  
  }
  
  public FixRowGridView(Context context) {
  
      super(context);
      // TODO Auto-generated constructor stub
  
  }
  
  @Override
  protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
  
      // TODO Auto-generated method stub
      super.onMeasure(widthMeasureSpec, heightMeasureSpec);
      int height = MeasureSpec.getSize(heightMeasureSpec);
      mChildHeight = (height - 3 * DimensionAdjustUtil.dipToPix(getContext(), 10)) / 4;
      int width = (mChildHeight &lt;&lt; 1) + DimensionAdjustUtil.dipToPix(getContext(), 10);
      setMeasuredDimension(width, height);
  
      DumpUtil.dLog(TAG, "The height is " + height);
      /*int width = (mChildHeight &lt;&lt; 1) + DimensionAdjustUtil.dipToPix(getContext(), 10);
      setMeasuredDimension(width, height);*/
      /*setMeasuredDimension(MeasureSpec.getSize(widthMeasureSpec), 
              MeasureSpec.getSize(heightMeasureSpec));*/
  }
  
  @Override
  protected void layoutChildren() {
  
      super.layoutChildren();
  
      int count = getChildCount();
  
      for(int i = 0; i &lt; count; i++) {
          View view = getChildAt(i);
          LayoutParams params = (LayoutParams) view.getLayoutParams();
          params.height = mChildHeight;
          params.width = mChildHeight;
          view.setLayoutParams(params);
      }
  
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Apparently, the code is expensive. I'm new to ViewGroup class. If you can help me improve the efficiency or provide a third library, please let me know. Any help will be appreciated!</p>