Skip to content

Commit a78c6cd

Browse files
author
Chris Banes
committed
Pretty sure this finally fixes #185.
1 parent e10106b commit a78c6cd

1 file changed

Lines changed: 15 additions & 4 deletions

File tree

library/src/com/handmark/pulltorefresh/library/PullToRefreshBase.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,13 +840,28 @@ protected final Parcelable onSaveInstanceState() {
840840

841841
@Override
842842
protected final void onSizeChanged(int w, int h, int oldw, int oldh) {
843+
if (DEBUG) {
844+
Log.d(LOG_TAG, String.format("onSizeChanged. W: %d, H: %d", w, h));
845+
}
846+
843847
super.onSizeChanged(w, h, oldw, oldh);
844848

845849
// We need to update the header/footer when our size changes
846850
refreshLoadingViewsSize();
847851

848852
// Update the Refreshable View layout
849853
refreshRefreshableViewSize(w, h);
854+
855+
/**
856+
* As we're currently in a Layout Pass, we need to schedule another one
857+
* to layout any changes we've made here
858+
*/
859+
post(new Runnable() {
860+
@Override
861+
public void run() {
862+
requestLayout();
863+
}
864+
});
850865
}
851866

852867
/**
@@ -902,10 +917,6 @@ protected final void refreshLoadingViewsSize() {
902917
}
903918

904919
protected final void refreshRefreshableViewSize(int width, int height) {
905-
if (DEBUG) {
906-
Log.d(LOG_TAG, String.format("refreshRefreshableViewSize. W: %d, H: %d", width, height));
907-
}
908-
909920
// We need to set the Height of the Refreshable View to the same as
910921
// this layout
911922
LinearLayout.LayoutParams lp = (LinearLayout.LayoutParams) mRefreshableViewWrapper.getLayoutParams();

0 commit comments

Comments
 (0)