|
1 | 1 | # MaterialIntroTutorial |
2 | | -Library demonstrating a material intro tutorial much like the ones on Google Sheets |
| 2 | +Android Library demonstrating a material intro tutorial much like the ones on Google Sheets |
| 3 | + |
| 4 | +This library shows a help or introduction tutorial into your application. Its inspired by the one in the Google Sheets Android app. |
| 5 | +The help tutorial takes the background colour set for each page and when scrolling between the two pages, the two colours will fade into one another. |
| 6 | + |
| 7 | + |
| 8 | +# Example Usage |
| 9 | + |
| 10 | +Add the following into your build.gradle: |
| 11 | + |
| 12 | + compile "za.co.riggaroo.materialhelptutorial:material-tutorial:1.0.0" |
| 13 | + |
| 14 | +In your activity, create a list of TutorialItems (set the title, subtitle, background colour and image drawable int). Pass them onto the MaterialTutorialActivity and start the activity for result. |
| 15 | + |
| 16 | + public void loadTutorial() { |
| 17 | + Intent mainAct = new Intent(this, MaterialTutorialActivity.class); |
| 18 | + mainAct.putParcelableArrayListExtra(MaterialTutorialActivity.MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS, getTutorialItems(this)); |
| 19 | + startActivityForResult(mainAct, REQUEST_CODE); |
| 20 | + |
| 21 | + } |
| 22 | + |
| 23 | + private ArrayList<TutorialItem> getTutorialItems(Context context) { |
| 24 | + TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle), |
| 25 | + R.color.slide_1, R.drawable.tut_page_1_front, R.drawable.tut_page_1_background); |
| 26 | + |
| 27 | + ... |
| 28 | + |
| 29 | + ArrayList<TutorialItem> tutorialItems = new ArrayList<>(); |
| 30 | + tutorialItems.add(tutorialItem1); |
| 31 | + ... |
| 32 | + |
| 33 | + return tutorialItems; |
| 34 | + } |
| 35 | + |
| 36 | +You should see a tutorial like below: |
| 37 | + |
| 38 | + |
| 39 | +This library is using the following: |
| 40 | +- CirclePageIndicator |
| 41 | +- UniversalImageLoader |
| 42 | +- Percent Support Library |
| 43 | + |
| 44 | + |
0 commit comments