@Override
  protected void onSizeChanged(int w, int h) {
    super.onSizeChanged(w, h);
    boolean isLandscape = isLandscape();
    int newColumnCount = isLandscape ? mColumnCountLandscape : mColumnCountPortrait;
    if (mColumnCount != newColumnCount) {
      mColumnCount = newColumnCount;

      mColumnWidth = calculateColumnWidth(w);

      mColumnTops = new int[mColumnCount];
      mColumnBottoms = new int[mColumnCount];
      mColumnLefts = new int[mColumnCount];

      mDistanceToTop = 0;

      // rebuild the columns
      initColumnTopsAndBottoms();
      initColumnLefts();

      // if we have data
      if (getCount() > 0 && mPositionData.size() > 0) {
        onColumnSync();
      }

      requestLayout();
    }
  }
 @Override
 protected void onSizeChanged(final int w, final int h, final int oldw, final int oldh) {
   super.onSizeChanged(w, h, oldw, oldh);
   onSizeChanged(w, h);
 }