Skip to content

Commit badcd78

Browse files
Piotr Zawadzkizawadz88
authored andcommitted
- added setOffscreenPageLimit() method in StepperLayout
1 parent 13ca7c2 commit badcd78

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

material-stepper/src/main/java/com/stepstone/stepper/StepperLayout.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,18 @@ public void setCompleteButtonVerificationFailed(boolean verificationFailed) {
326326
mCompleteNavigationButton.setVerificationFailed(verificationFailed);
327327
}
328328

329+
/**
330+
* Set the number of steps that should be retained to either side of the
331+
* current step in the view hierarchy in an idle state. Steps beyond this
332+
* limit will be recreated from the adapter when needed.
333+
*
334+
* @param limit How many steps will be kept offscreen in an idle state.
335+
* @see ViewPager#setOffscreenPageLimit(int)
336+
*/
337+
public void setOffscreenPageLimit(int limit) {
338+
mPager.setOffscreenPageLimit(limit);
339+
}
340+
329341
private void init(AttributeSet attrs, @AttrRes int defStyleAttr) {
330342
initDefaultValues();
331343
extractValuesFromAttributes(attrs, defStyleAttr);

0 commit comments

Comments
 (0)