@@ -85,14 +85,14 @@ export class Pager extends PagerBase {
85
85
}
86
86
87
87
public initNativeView ( ) {
88
+ this . on ( View . layoutChangedEvent , this . onLayoutChange , this ) ;
88
89
super . initNativeView ( ) ;
89
90
const nativeView = this . nativeViewProtected ;
90
91
initPagerRecyclerAdapter ( ) ;
91
92
this . _pagerAdapter = new PagerRecyclerAdapter ( new WeakRef ( this ) ) ;
92
93
this . compositeTransformer = new androidx . viewpager2 . widget . CompositePageTransformer ( ) ;
93
94
nativeView . setPageTransformer ( this . compositeTransformer ) ;
94
95
nativeView . setUserInputEnabled ( ! this . disableSwipe ) ;
95
- this . on ( View . layoutChangedEvent , this . onLayoutChange , this ) ;
96
96
// Store disable animation value
97
97
this . _oldDisableAnimation = this . disableAnimation ;
98
98
// Disable animation to set currentItem w/o animation
@@ -153,10 +153,10 @@ export class Pager extends PagerBase {
153
153
this . initStaticPagerAdapter ( ) ;
154
154
}
155
155
onLayoutChange ( args : any ) {
156
- if ( this . _lastPeaking ) {
156
+ if ( this . peaking ) {
157
157
this [ peakingProperty . setNative ] ( this . peaking ) ;
158
158
}
159
- if ( this . _lastSpacing ) {
159
+ if ( this . spacing ) {
160
160
this [ spacingProperty . setNative ] ( this . spacing ) ;
161
161
}
162
162
// this._setTransformers(this.transformers ? this.transformers : '');
@@ -182,6 +182,7 @@ export class Pager extends PagerBase {
182
182
}
183
183
}
184
184
this . _lastSpacing = size ;
185
+ this . refresh ( ) ;
185
186
}
186
187
}
187
188
@@ -201,6 +202,7 @@ export class Pager extends PagerBase {
201
202
this . compositeTransformer . addTransformer ( this . peakingTransformer ) ;
202
203
}
203
204
this . _lastPeaking = size ;
205
+ this . refresh ( ) ;
204
206
}
205
207
}
206
208
0 commit comments