@@ -691,6 +691,23 @@ final void refreshLoadingViewsSize() {
691
691
setPadding (pLeft , pTop , pRight , pBottom );
692
692
}
693
693
694
+ final void refreshRefreshableViewSize (int width , int height ) {
695
+ // We need to set the Height of the Refreshable View to the same as
696
+ // this layout
697
+ LinearLayout .LayoutParams lp = (LinearLayout .LayoutParams ) mRefreshableViewWrapper .getLayoutParams ();
698
+
699
+ switch (getPullToRefreshScrollDirection ()) {
700
+ case HORIZONTAL :
701
+ lp .width = width ;
702
+ break ;
703
+ case VERTICAL :
704
+ default :
705
+ lp .height = height ;
706
+ break ;
707
+ }
708
+ mRefreshableViewWrapper .requestLayout ();
709
+ }
710
+
694
711
final void setState (State state , final boolean ... params ) {
695
712
mState = state ;
696
713
if (DEBUG ) {
@@ -902,6 +919,9 @@ protected final Parcelable onSaveInstanceState() {
902
919
903
920
@ Override
904
921
protected void onSizeChanged (int w , int h , int oldw , int oldh ) {
922
+ // Update the Refreshable View layout
923
+ refreshRefreshableViewSize (w , h );
924
+
905
925
// We need to update the header/footer when our size changes
906
926
refreshLoadingViewsSize ();
907
927
}
@@ -999,17 +1019,8 @@ private void addRefreshableView(Context context, T refreshableView) {
999
1019
mRefreshableViewWrapper .addView (refreshableView , ViewGroup .LayoutParams .MATCH_PARENT ,
1000
1020
ViewGroup .LayoutParams .MATCH_PARENT );
1001
1021
1002
- switch (getPullToRefreshScrollDirection ()) {
1003
- case HORIZONTAL :
1004
- addViewInternal (mRefreshableViewWrapper , new LinearLayout .LayoutParams (0 , LayoutParams .MATCH_PARENT ,
1005
- 1.0f ));
1006
- break ;
1007
- case VERTICAL :
1008
- default :
1009
- addViewInternal (mRefreshableViewWrapper , new LinearLayout .LayoutParams (LayoutParams .MATCH_PARENT , 0 ,
1010
- 1.0f ));
1011
- break ;
1012
- }
1022
+ addViewInternal (mRefreshableViewWrapper , new LinearLayout .LayoutParams (LayoutParams .MATCH_PARENT ,
1023
+ LayoutParams .MATCH_PARENT ));
1013
1024
}
1014
1025
1015
1026
@ SuppressWarnings ("deprecation" )
0 commit comments