Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import android.content.res.TypedArray;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.os.Handler;
import android.support.annotation.AttrRes;
import android.support.annotation.ColorInt;
import android.support.annotation.DrawableRes;
Expand All @@ -40,6 +39,7 @@
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewTreeObserver;
import android.widget.Button;
import android.widget.LinearLayout;

Expand Down Expand Up @@ -310,13 +310,13 @@ public void setAdapter(@NonNull StepAdapter stepAdapter) {
mStepperType.onNewAdapter(stepAdapter);

// this is so that the fragments in the adapter can be created BEFORE the onUpdate() method call
new Handler().post(new Runnable() {
mPager.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
@Override
public void run() {
public void onGlobalLayout() {
mPager.getViewTreeObserver().removeGlobalOnLayoutListener(this);
onUpdate(mCurrentStepPosition, false);
}
});

}

/**
Expand Down