Skip to content

Commit 7e19d4c

Browse files
author
Alexander Vlasov
authored
Merge pull request Cleveroad#28 from Cleveroad/develop
Develop
2 parents 8b0b03f + 403f76f commit 7e19d4c

File tree

16 files changed

+255
-46
lines changed

16 files changed

+255
-46
lines changed

CHANGELOG.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
12
## SlidingTutorial [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) <img src="https://www.cleveroad.com/public/comercial/label-android.svg" height="20"> <a href="https://www.cleveroad.com/?utm_source=github&utm_medium=label&utm_campaign=contacts"><img src="https://www.cleveroad.com/public/comercial/label-cleveroad.svg" height="20"></a>
23
![Header image](/images/header.jpg)
34

45
## Changelog
56

67
Version | Changes
78
--- | ---
9+
v.1.0.3 | Fixed issues with layout coustizations. Fixed issues with translate animations.
10+
v.1.0.2 | Minor fixes.
11+
v.1.0.1 | Changed gradle plugin version to stable `2.1.0`.
812
v.1.0.0 | Library fully refactored. See full [1.0.0 Changelog](#100_Changelog)
913
v.0.9.5 | Added getters for views. Possible fix for manifest merging issues
1014
v.0.9.4 | Renamed all attributes; all resources marked as private |
@@ -13,19 +17,26 @@ v.0.9.2 | Added onSkipButtonClicked method and SimplePagerFragment
1317
v.0.9.1 | Added infinite scroll behavior
1418
v.0.9 | First public release
1519

20+
## 1.0.2 Changelog
21+
* Fixed issue with not using [TutorialFragment#getLayoutResId()], [TutorialFragment#getViewPagerResId()], [TutorialFragment#getIndicatorResId()], [TutorialFragment#getButtonSkipResId()], [TutorialFragment#getSeparatorResId()].
22+
* Fixed issue with not using [TutorialSupportFragment#getLayoutResId()], [TutorialSupportFragment#getViewPagerResId()], [TutorialSupportFragment#getIndicatorResId()], [TutorialSupportFragment#getButtonSkipResId()], [TutorialSupportFragment#getSeparatorResId()].
23+
24+
## 1.0.1 Changelog
25+
Changed gradle plugin version to stable `2.1.0`.
26+
1627
## 1.0.0 Changelog
1728
* Renamed **PresentationPagerFragment** to [TutorialFragment].
18-
* Created [SimplePageFragment] fragment with default implementaion for [PageFragment#getLayoutResId()] and [PageFragment#getTransformItems()].
29+
* Created [SimplePageFragment] fragment with default implementation for [PageFragment#getLayoutResId()] and [PageFragment#getTransformItems()].
1930
* Removed capability to create new instance of [TransformItem] via `new`. Added fabric static method [TransformItem#create(int,Direction,float)].
2031
* Created [OnTutorialPageChangeListener] to listen change page events.
21-
* Use [TutorialFragment#addOnTutorialPageChangeListener()] and [TutorialFragment#removeOnTutorialPageChangeListener()] to add/remove listener.
32+
* Use [TutorialFragment#addOnTutorialPageChangeListener(OnTutorialPageChangeListener)] and [TutorialFragment#removeOnTutorialPageChangeListener(OnTutorialPageChangeListener)] to add/remove listener.
2233
* Created [TutorialOptions] to configure [TutorialFragment].
2334
* Created [TutorialPageOptionsProvider] and [PageOptions] to provide and configure [PageFragment] instances.
2435
* Created [TutorialPageProvider] to provide [PageFragment] instances.
2536
* Removed **CirclePageIndicator**.
2637
* Created [TutorialPageIndicator] view.
2738
* Created [IndicatorOptions] to configure [TutorialPageIndicator] view.
28-
* Created [Renderer] interface that responds for drawing single indicator item. There are 2 default implementaion: [Renderer.Factory#newCircleRenderer()] and [Renderer.Factory#newSquareRenderer()].
39+
* Created [Renderer] interface that responds for drawing single indicator item. There are 2 default implementation: [Renderer.Factory#newCircleRenderer()] and [Renderer.Factory#newSquareRenderer()].
2940
* Created [TutorialSupportFragment] and [PageSupportFragment] for use with **AppCompat** library. [TutorialFragment] and [PageFragment] now using **android.app.Fragment**.
3041

3142
## Support
@@ -57,11 +68,21 @@ at info@cleveroad.com (email subject: «Sliding android app tutorial. Support re
5768
[TransformItem]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TransformItem.java
5869
[TransformItem#create(int,Direction,float)]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TransformItem.java#L54
5970
[TutorialFragment]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java
71+
[TutorialFragment#getLayoutResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L208
72+
[TutorialFragment#getViewPagerResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L213
73+
[TutorialFragment#getIndicatorResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L218
74+
[TutorialFragment#getButtonSkipResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L223
75+
[TutorialFragment#getSeparatorResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L228
6076
[TutorialFragment#provideTutorialOptions()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L239
6177
[OnTutorialPageChangeListener]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/OnTutorialPageChangeListener.java
6278
[TutorialFragment#addOnTutorialPageChangeListener(OnTutorialPageChangeListener)]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L168
6379
[TutorialFragment#removeOnTutorialPageChangeListener(OnTutorialPageChangeListener)]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialFragment.java#L178
6480
[TutorialSupportFragment]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialSupportFragment.java
81+
[TutorialSupportFragment#getLayoutResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialSupportFragment.java#L204
82+
[TutorialSupportFragment#getViewPagerResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialSupportFragment.java#L209
83+
[TutorialSupportFragment#getIndicatorResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialSupportFragment.java#L214
84+
[TutorialSupportFragment#getButtonSkipResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialSupportFragment.java#L219
85+
[TutorialSupportFragment#getSeparatorResId()]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/bugfix/custom_layout/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialSupportFragment.java#L224
6586
[TutorialOptions]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialOptions.java
6687
[TutorialOptions.Builder]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialOptions.java#L113
6788
[TutorialOptions.Builder#setTutorialPageProvider(TutorialPageOptionsProvider)]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialOptions.java#L239
@@ -73,4 +94,4 @@ at info@cleveroad.com (email subject: «Sliding android app tutorial. Support re
7394
[TutorialOptions.Builder#setUseAutoRemoveTutorialFragment(boolean)]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialOptions.java#L164
7495
[TutorialPageIndicator]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageIndicator.java
7596
[TutorialPageOptionsProvider]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageOptionsProvider.java
76-
[TutorialPageProvider]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageProvider.java
97+
[TutorialPageProvider]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageProvider.java

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ All you need to do is:
3131
First, add gradle dependency into your build.gradle:
3232
```groovy
3333
dependencies {
34-
compile 'com.cleveroad:slidingtutorial:1.0.0'
34+
compile 'com.cleveroad:slidingtutorial:1.0.3'
3535
}
3636
```
3737

@@ -175,7 +175,7 @@ public class CustomTutorialFragment extends TutorialFragment {
175175
Here's the list of changes in code to use `SlidingTutorial` library with `AppCompat` library:
176176
* Your fragment pages must extend [PageSupportFragment].
177177
* Your tutorial fragment must extend [TutorialSupportFragment].
178-
* [TutorialPageProvider] must provide **android.support.v4.app.Fragment** intances.
178+
* [TutorialPageProvider] must provide **android.support.v4.app.Fragment** instances.
179179
That's all.
180180

181181

@@ -247,7 +247,7 @@ As you can see, you can specify *element size*, *element spacing* (aka padding),
247247
* [Renderer.Factory#newCircleRenderer()] - draw indicators with circle shape
248248
* [Renderer.Factory#newSquareRenderer()] - draw indicators with square shape
249249

250-
Also in sample module there are two implementaions:
250+
Also in sample module there are two implementations:
251251
* [DrawableRenderer] - draw indicators with drawable background
252252
* [RhombusRenderer] - draw indicators with rhombus shape
253253

@@ -353,4 +353,4 @@ at info@cleveroad.com (email subject: «Sliding android app tutorial. Support re
353353
[TutorialOptions.Builder#setUseAutoRemoveTutorialFragment(boolean)]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialOptions.java#L164
354354
[TutorialPageIndicator]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageIndicator.java
355355
[TutorialPageOptionsProvider]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageOptionsProvider.java
356-
[TutorialPageProvider]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageProvider.java
356+
[TutorialPageProvider]: https://github.com/Cleveroad/SlidingTutorial-Android/blob/master/lib/src/main/java/com/cleveroad/slidingtutorial/TutorialPageProvider.java

build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.0-beta1'
9-
8+
classpath 'com.android.tools.build:gradle:2.1.0'
109
// NOTE: Do not place your application dependencies here; they belong
1110
// in the individual module build.gradle files
1211
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
VERSION_NAME=1.0.0
2-
VERSION_CODE=10
1+
VERSION_NAME=1.0.3
2+
VERSION_CODE=13
33
GROUP=com.cleveroad
44

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

gradle/wrapper/gradle-wrapper.jar

-48.7 KB
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

lib/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ apply plugin: 'com.android.library'
22

33
android {
44
compileSdkVersion 24
5-
buildToolsVersion "23.0.3"
5+
buildToolsVersion "24.0.2"
66

77
defaultConfig {
88
minSdkVersion 14
99
targetSdkVersion 24
10-
versionCode 10
11-
versionName "1.0.0"
10+
versionCode 12
11+
versionName "1.0.2"
1212
}
1313
buildTypes {
1414
release {

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

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public void removeCurrentFragment() {
7272
.commitAllowingStateLoss();
7373
}
7474

75+
@Override
76+
public int getLayoutResId() {
77+
return TutorialFragment.this.getLayoutResId();
78+
}
79+
7580
@Override
7681
public PagerAdapter getPagerAdapter() {
7782
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
@@ -80,6 +85,26 @@ public PagerAdapter getPagerAdapter() {
8085
return new TutorialAdapter(getFragmentManager());
8186
}
8287
}
88+
89+
@Override
90+
public int getViewPagerResId() {
91+
return TutorialFragment.this.getViewPagerResId();
92+
}
93+
94+
@Override
95+
public int getIndicatorResId() {
96+
return TutorialFragment.this.getIndicatorResId();
97+
}
98+
99+
@Override
100+
public int getButtonSkipResId() {
101+
return TutorialFragment.this.getButtonSkipResId();
102+
}
103+
104+
@Override
105+
public int getSeparatorResId() {
106+
return TutorialFragment.this.getSeparatorResId();
107+
}
83108
};
84109

85110
/**
@@ -181,27 +206,27 @@ public boolean removeOnTutorialPageChangeListener(@NonNull OnTutorialPageChangeL
181206

182207
@LayoutRes
183208
protected int getLayoutResId() {
184-
return mTutorial.getLayoutResId();
209+
return mTutorial.getDefaultLayoutResId();
185210
}
186211

187212
@IdRes
188213
protected int getViewPagerResId() {
189-
return mTutorial.getViewPagerResId();
214+
return mTutorial.getDefaultViewPagerResId();
190215
}
191216

192217
@IdRes
193218
protected int getIndicatorResId() {
194-
return mTutorial.getIndicatorResId();
219+
return mTutorial.getDefaultIndicatorResId();
195220
}
196221

197222
@IdRes
198223
protected int getButtonSkipResId() {
199-
return mTutorial.getButtonSkipResId();
224+
return mTutorial.getDefaultButtonSkipResId();
200225
}
201226

202227
@IdRes
203228
protected int getSeparatorResId() {
204-
return mTutorial.getSeparatorResId();
229+
return mTutorial.getDefaultSeparatorResId();
205230
}
206231

207232
/**

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

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ public void onChanged() {
7070
}
7171

7272
View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
73-
View view = inflater.inflate(getLayoutResId(), container, false);
73+
View view = inflater.inflate(mInternalFragment.getLayoutResId(), container, false);
7474

75-
mViewPager = (ViewPager) view.findViewById(getViewPagerResId());
76-
mPageIndicator = (TutorialPageIndicator) view.findViewById(getIndicatorResId());
77-
mButtonSkip = view.findViewById(getButtonSkipResId());
78-
mSeparator = view.findViewById(getSeparatorResId());
75+
mViewPager = (ViewPager) view.findViewById(mInternalFragment.getViewPagerResId());
76+
mPageIndicator = (TutorialPageIndicator) view.findViewById(mInternalFragment.getIndicatorResId());
77+
mButtonSkip = view.findViewById(mInternalFragment.getButtonSkipResId());
78+
mSeparator = view.findViewById(mInternalFragment.getSeparatorResId());
7979

8080
mViewPager.setPageTransformer(true, new FragmentTransformer());
8181
mViewPager.addOnPageChangeListener(new InternalHelperPageChangeDecorator());
@@ -173,27 +173,27 @@ boolean removeOnTutorialPageChangeListener(@NonNull OnTutorialPageChangeListener
173173
}
174174

175175
@LayoutRes
176-
int getLayoutResId() {
176+
int getDefaultLayoutResId() {
177177
return R.layout.st_fragment_presentation;
178178
}
179179

180180
@IdRes
181-
int getViewPagerResId() {
181+
int getDefaultViewPagerResId() {
182182
return R.id.viewPager;
183183
}
184184

185185
@IdRes
186-
int getIndicatorResId() {
186+
int getDefaultIndicatorResId() {
187187
return R.id.indicator;
188188
}
189189

190190
@IdRes
191-
int getButtonSkipResId() {
191+
int getDefaultButtonSkipResId() {
192192
return R.id.tvSkip;
193193
}
194194

195195
@IdRes
196-
int getSeparatorResId() {
196+
int getDefaultSeparatorResId() {
197197
return R.id.separator;
198198
}
199199

@@ -292,8 +292,8 @@ private class FragmentTransformer implements ViewPager.PageTransformer {
292292

293293
public void transformPage(View view, float position) {
294294
Object obj = view.getTag(R.id.st_page_fragment);
295-
if (obj instanceof PageFragment) {
296-
((PageFragment) obj).transformPage(view.getWidth(), position);
295+
if (obj instanceof PageImpl) {
296+
((PageImpl) obj).transformPage(view.getWidth(), position);
297297
}
298298
}
299299
}
@@ -306,6 +306,21 @@ interface InternalFragment {
306306
PagerAdapter getPagerAdapter();
307307

308308
void removeCurrentFragment();
309+
310+
@LayoutRes
311+
int getLayoutResId();
312+
313+
@IdRes
314+
int getViewPagerResId();
315+
316+
@IdRes
317+
int getIndicatorResId();
318+
319+
@IdRes
320+
int getButtonSkipResId();
321+
322+
@IdRes
323+
int getSeparatorResId();
309324
}
310325

311326
@SuppressWarnings("unused")

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

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,32 @@ public void removeCurrentFragment() {
7575
public PagerAdapter getPagerAdapter() {
7676
return new TutorialAdapter(getChildFragmentManager());
7777
}
78+
79+
@Override
80+
public int getLayoutResId() {
81+
return TutorialSupportFragment.this.getLayoutResId();
82+
}
83+
84+
@Override
85+
public int getViewPagerResId() {
86+
return TutorialSupportFragment.this.getViewPagerResId();
87+
}
88+
89+
@Override
90+
public int getIndicatorResId() {
91+
return TutorialSupportFragment.this.getIndicatorResId();
92+
}
93+
94+
@Override
95+
public int getButtonSkipResId() {
96+
return TutorialSupportFragment.this.getButtonSkipResId();
97+
}
98+
99+
@Override
100+
public int getSeparatorResId() {
101+
return TutorialSupportFragment.this.getSeparatorResId();
102+
}
103+
78104
};
79105

80106
/**
@@ -176,27 +202,27 @@ public boolean removeOnTutorialPageChangeListener(@NonNull OnTutorialPageChangeL
176202

177203
@LayoutRes
178204
protected int getLayoutResId() {
179-
return mTutorial.getLayoutResId();
205+
return mTutorial.getDefaultLayoutResId();
180206
}
181207

182208
@IdRes
183209
protected int getViewPagerResId() {
184-
return mTutorial.getViewPagerResId();
210+
return mTutorial.getDefaultViewPagerResId();
185211
}
186212

187213
@IdRes
188214
protected int getIndicatorResId() {
189-
return mTutorial.getIndicatorResId();
215+
return mTutorial.getDefaultIndicatorResId();
190216
}
191217

192218
@IdRes
193219
protected int getButtonSkipResId() {
194-
return mTutorial.getButtonSkipResId();
220+
return mTutorial.getDefaultButtonSkipResId();
195221
}
196222

197223
@IdRes
198224
protected int getSeparatorResId() {
199-
return mTutorial.getSeparatorResId();
225+
return mTutorial.getDefaultSeparatorResId();
200226
}
201227

202228
/**

0 commit comments

Comments
 (0)