|
| 1 | +### Setup ### |
| 2 | +To use BlurTutorial add dependency to your project: |
| 3 | +```groovy |
| 4 | + implementation 'com.cleveroad.blur_tutorial:blur_tutorial:1.0.1' |
| 5 | +``` |
| 6 | + |
| 7 | + |
1 | 8 | ### Usage ###
|
2 | 9 | #### BlurTutorial ####
|
3 | 10 | The main component of library is the <b>BlurTutorial</b> interface.
|
4 | 11 |
|
5 | 12 | ```kotlin
|
6 |
| - // add list of states to tutorial |
| 13 | + /* |
| 14 | + Add list of states to tutorial. |
| 15 | + */ |
7 | 16 | fun addAllStates(states: List<TutorialState>)
|
8 | 17 |
|
9 |
| - // add one state to tutorial |
| 18 | + /* |
| 19 | + Add one state to tutorial. |
| 20 | + */ |
10 | 21 | fun addState(state: TutorialState)
|
11 | 22 |
|
12 |
| - // add one state to position |
| 23 | + /* |
| 24 | + Add one state by position. |
| 25 | + */ |
13 | 26 | fun setState(state: TutorialState, index: Int)
|
14 | 27 |
|
15 |
| - // remove state from tutorial |
| 28 | + /* |
| 29 | + Remove state from tutorial. |
| 30 | + */ |
16 | 31 | fun removeState(state: TutorialState)
|
17 | 32 |
|
18 |
| - // clear all states of tutorial. Cancel tutorial process. |
| 33 | + /* |
| 34 | + Clear all states of tutorial. |
| 35 | + Cancel tutorial process. |
| 36 | + */ |
19 | 37 | fun clearStates()
|
20 | 38 |
|
21 |
| - // get current state of tutorial |
| 39 | + /* |
| 40 | + Get current state of tutorial. |
| 41 | + */ |
22 | 42 | fun getCurrentState(): TutorialState?
|
23 | 43 |
|
24 | 44 | /*
|
25 |
| - * Start tutorial process. |
26 |
| - * |
27 |
| - * Should be called in [Activity.onResume] or [Fragment.onResume] or later. |
28 |
| - * If you also highlight action bar menu items, |
29 |
| - * call it in [Activity.onPrepareOptionsMenu] or [Fragment.onPrepareOptionsMenu] or later. |
30 |
| - */ |
| 45 | + Start tutorial process. |
| 46 | + |
| 47 | + Should be called in [Activity.onResume] or [Fragment.onResume] or later. |
| 48 | + If you also highlight action bar menu items, |
| 49 | + call it in [Activity.onPrepareOptionsMenu] or [Fragment.onPrepareOptionsMenu] or later. |
| 50 | + */ |
31 | 51 | fun start()
|
32 | 52 |
|
33 |
| - // go to next state of tutorial. Finish the current state. |
| 53 | + /* |
| 54 | + Go to next state of tutorial. |
| 55 | + Finish the current state. |
| 56 | + */ |
34 | 57 | fun next()
|
35 | 58 |
|
36 |
| - /** |
37 |
| - * Interrupt tutorial process. |
38 |
| - * It can be renewed by calling next() or start() |
39 |
| - */ |
| 59 | + /* |
| 60 | + Interrupt tutorial process. |
| 61 | + It can be renewed by calling next() or start() |
| 62 | + */ |
40 | 63 | fun interrupt()
|
41 | 64 |
|
42 |
| - // change configuration of current [BlurTutorial] instance. |
| 65 | + /* |
| 66 | + Change configuration of |
| 67 | + current [BlurTutorial] instance. |
| 68 | + */ |
43 | 69 | fun configure(): TutorialBuilder
|
44 | 70 |
|
45 |
| - // save state of tutorial. Ypu must call it in onSaveInstanceState() of your Fragment or Activity. |
| 71 | + /* |
| 72 | + Save state of tutorial. |
| 73 | + You must call it in onSaveInstanceState() |
| 74 | + of your Fragment or Activity. |
| 75 | + */ |
46 | 76 | fun onSaveInstanceState(outState: Bundle)
|
47 | 77 |
|
48 |
| - // restore state of tutorial. You must call it in onRestoreInstanceState() of your Fragment or Activity. |
| 78 | + /* |
| 79 | + Restore state of tutorial. |
| 80 | + You must call it in onRestoreInstanceState() of |
| 81 | + your Fragment or Activity. |
| 82 | + */ |
49 | 83 | fun onRestoreInstanceState(savedState: Bundle?)
|
50 | 84 |
|
51 |
| - // Release resources. You must call it in onDestroy() of Fragment or Activity. |
| 85 | + /* |
| 86 | + Release resources. |
| 87 | + You must call it in onDestroy() of |
| 88 | + your Fragment or Activity. |
| 89 | + */ |
52 | 90 | fun onDestroy()
|
53 | 91 | ```
|
54 | 92 | #### TutorialState ####
|
|
0 commit comments