Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeAfc committed May 19, 2017
2 parents f36ff3a + 4faf8d6 commit ffe2e37
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import android.content.res.TypedArray;
import android.graphics.Bitmap;
import android.graphics.Point;
import android.os.Build;
import android.support.v4.view.PagerAdapter;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
Expand Down Expand Up @@ -126,6 +127,12 @@ public UltraViewPager(Context context, AttributeSet attrs, int defStyleAttr) {

private void initView() {
viewPager = new UltraViewPagerView(getContext());
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) {
viewPager.setId(viewPager.hashCode());
} else {
viewPager.setId(View.generateViewId());
}

addView(viewPager, new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));
}

Expand Down Expand Up @@ -395,7 +402,7 @@ public PagerAdapter getAdapter() {

public void setOnPageChangeListener(ViewPager.OnPageChangeListener listener) {
if (pagerIndicator == null) {
viewPager.setOnPageChangeListener(listener);
viewPager.addOnPageChangeListener(listener);
} else {
pagerIndicator.setPageChangeListener(listener);
}
Expand Down

0 comments on commit ffe2e37

Please sign in to comment.