You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated version;
Updated README - updated sample.
Created FragmentPagerAdapter for using with android.app.Fragment;
Created library version for non compat Fragments and Activity;
Copy file name to clipboardExpand all lines: MIGRATION.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,15 @@
2
2

3
3
4
4
## Migrations from v.0.9.5 to v.1.0.0
5
-
1. You must change creation TransformItem from `new TransformItem(R.id.ivFirstImage, true, 20)` to `TransformItem.create(R.id.ivFirstImage, Direction.LEFT_TO_RIGHT, 0.2f)`, where 2-nd parameter now is **Direction** of view translation and 3-rd parameter is *shiftCoefficient*.
6
-
2. Your fragment with tutorial must extend **TutorialFragment** instead of **PresentationPagerFragment**.
7
-
3. In your **TutorialFragment** successor fragment must implement #*provideTutorialOptions()* method that returns TutorialOptions instance.
8
-
4. In **TutorialOptions**.**Builder**#setTutorialPageProvider(**TutorialPageProvider**)* you must specify **TutorialPageProvider** instance. For example:
5
+
1. You must change creation [TransformItem] from `new TransformItem(R.id.ivFirstImage, true, 20)` to `TransformItem.create(R.id.ivFirstImage, Direction.LEFT_TO_RIGHT, 0.2f)`, where 2-nd parameter now is [Direction] of view translation and 3-rd parameter is *shiftCoefficient*.
6
+
2. Your fragment with tutorial must extend [TutorialFragment] instead of **PresentationPagerFragment**.
7
+
3. In your [TutorialFragment] successor fragment must implement [TutorialFragment#provideTutorialOptions()] method that returns [TutorialOptions] instance.
8
+
4. In [TutorialOptions.Builder#setTutorialPageProvider(TutorialPageProvider)] you must specify [TutorialPageProvider] instance. For example:
@@ -195,7 +195,7 @@ public class CustomTutorialFragment extends TutorialFragment {
195
195
```
196
196
197
197
### Set up pages colors
198
-
Just provide array of color values to [TutorialOptions.Builder#setPagesColors(int array)]. Array with colors **must have length equal to pages size**.
198
+
Just provide array of color values to [TutorialOptions.Builder#setPagesColors(int array)]. The array with colors **must have length equal to pages size**.
@@ -233,20 +233,21 @@ public class CustomTutorialFragment extends TutorialFragment {
233
233
.setSelectedElementColor(android.R.color.white)
234
234
.setRenderer(Drawable.create(getContext()))
235
235
.build())
236
+
// set up other configuration ...
236
237
.build();
237
238
}
238
239
}
239
240
```
240
241
As you can see, you can specify *element size*, *element spacing* (aka padding), *element color*, *selected element color*, and implementation of [Renderer] interface. There are 2 default implementation inside [Renderer.Factory]:
241
-
*[Renderer.Factory#newCircleRenderer()]
242
-
*[Renderer.Factory#newSquareRenderer()]
242
+
*[Renderer.Factory#newCircleRenderer()] - draw indicators with circle shape
243
+
*[Renderer.Factory#newSquareRenderer()] - draw indicators with square shape
243
244
244
245
Also in sample module there are two implementaions:
245
-
*[DrawableRenderer]
246
-
*[RhombusRenderer]
246
+
*[DrawableRenderer] - draw indicators with drawable background
247
+
*[RhombusRenderer] - draw indicators with rhombus shape
247
248
248
249
### Add OnTutorialPageChangeListener
249
-
You can listen change page listener - just implement [TutorialFragment.OnTutorialPageChangeListener] and add listener via [TutorialFragment#addOnTutorialPageChangeListener(OnTutorialPageChangeListener)]. To remove listener use [TutorialFragment#removeOnTutorialPageChangeListener(OnTutorialPageChangeListener)].
250
+
You can listen change page events - just implement [TutorialFragment.OnTutorialPageChangeListener] and add listener via [TutorialFragment#addOnTutorialPageChangeListener(OnTutorialPageChangeListener)]. To remove listener use [TutorialFragment#removeOnTutorialPageChangeListener(OnTutorialPageChangeListener)].
@@ -271,16 +272,15 @@ public class CustomTutorialFragment extends TutorialFragment
271
272
```
272
273
273
274
## Migrations from v.0.9.5 to v.1.0.0
274
-
1. You must change creation TransformItem from `new TransformItem(R.id.ivFirstImage, true, 20)` to `TransformItem.create(R.id.ivFirstImage, Direction.LEFT_TO_RIGHT, 0.2f)`, where 2-nd parameter now is **Direction** of view translation and 3-rd parameter is *shiftCoefficient*.
275
-
2. Your fragment with tutorial must extend **TutorialFragment** instead of **PresentationPagerFragment**.
276
-
3. In your **TutorialFragment** successor fragment must implement #*provideTutorialOptions()* method that returns TutorialOptions instance.
277
-
4. In **TutorialOptions**.**Builder**#setTutorialPageProvider(**TutorialPageProvider**)* you must specify **TutorialPageProvider** instance. For example:
275
+
1. You must change creation [TransformItem] from `new TransformItem(R.id.ivFirstImage, true, 20)` to `TransformItem.create(R.id.ivFirstImage, Direction.LEFT_TO_RIGHT, 0.2f)`, where 2-nd parameter now is [Direction] of view translation and 3-rd parameter is *shiftCoefficient*.
276
+
2. Your fragment with tutorial must extend [TutorialFragment] instead of **PresentationPagerFragment**.
277
+
3. In your [TutorialFragment] successor fragment must implement [TutorialFragment#provideTutorialOptions()] method that returns [TutorialOptions] instance.
278
+
4. In [TutorialOptions.Builder#setTutorialPageProvider(TutorialPageProvider)] you must specify [TutorialPageProvider] instance. For example:
0 commit comments