Skip to content

Commit 6c48c8e

Browse files
committed
Fixed issue with NullPointerException with addOnTutorialPageChangeListener() called before onCreate()
1 parent 728d3d5 commit 6c48c8e

File tree

5 files changed

+15
-6
lines changed

5 files changed

+15
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
Version | Changes
88
--- | ---
9+
v.1.0.8 | Fixed issue with NullPointerException with addOnTutorialPageChangeListener() called before onCreate()
910
v.1.0.7 | <ul><li>Fixed import for SupportTutorialFragment</li><li>Updated versions of dependencies</li></ul>
1011
v.1.0.6 | <ul><li>Added new simple way of creation of tutorial</li><li>Fixed memory leaks issues</li><li>Updated default sizes of page indicator's elements</li><li>Updated default colors of page indicator</li><li>Updated versions of dependencies</li><li>Removed unused or unnecessary methods</li></ul>
1112
v.1.0.5 | <ul><li>Fixed NullPointerException & IndexOutOfBoundsException inside ViewPager.</li><li>Added SlidingTutorialViewPager</li></ul>

gradle.properties

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=1.0.7
2-
VERSION_CODE=17
1+
VERSION_NAME=1.0.8
2+
VERSION_CODE=18
33
GROUP=com.cleveroad
44

55
POM_DESCRIPTION=Sliding tutorial is simple library that help other developers easy create great tutotial

lib/build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ android {
77
defaultConfig {
88
minSdkVersion 14
99
targetSdkVersion 25
10-
versionCode 17
11-
versionName "1.0.7"
10+
versionCode 18
11+
versionName "1.0.8"
1212
}
1313
buildTypes {
1414
release {

lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java

+6-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public int getSeparatorResId() {
108108
}
109109
};
110110

111+
112+
111113
/**
112114
* Create new {@link TutorialOptions.Builder} instance.
113115
*
@@ -123,11 +125,14 @@ public static TutorialFragment newInstance(@NonNull TutorialOptions tutorialOpti
123125
return new TutorialFragmentImpl(tutorialOptions);
124126
}
125127

128+
public TutorialFragment() {
129+
mTutorial = new TutorialImpl<>(mInternalFragment);
130+
}
131+
126132
@Override
127133
public void onCreate(Bundle savedInstanceState) {
128134
super.onCreate(savedInstanceState);
129135
setRetainInstance(true);
130-
mTutorial = new TutorialImpl<>(mInternalFragment);
131136
}
132137

133138
@Override

lib/src/main/java/com/cleveroad/slidingtutorial/TutorialSupportFragment.java

+4-1
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,14 @@ public static TutorialSupportFragment newInstance(@NonNull TutorialOptions tutor
119119
return new TutorialSupportFragmentImpl(tutorialOptions);
120120
}
121121

122+
public TutorialSupportFragment() {
123+
mTutorial = new TutorialImpl<>(mInternalFragment);
124+
}
125+
122126
@Override
123127
public void onCreate(Bundle savedInstanceState) {
124128
super.onCreate(savedInstanceState);
125129
setRetainInstance(true);
126-
mTutorial = new TutorialImpl<>(mInternalFragment);
127130
}
128131

129132
@Override

0 commit comments

Comments
 (0)