├── .gitignore ├── .travis.yml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── za │ │ └── co │ │ └── riggaroo │ │ └── helptut │ │ └── helptutorialexample │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── za │ │ │ └── co │ │ │ └── riggaroo │ │ │ └── helptut │ │ │ └── helptutorialexample │ │ │ └── MainActivity.java │ └── res │ │ ├── drawable-hdpi │ │ ├── tut_page_1_background.png │ │ ├── tut_page_1_front.png │ │ ├── tut_page_2_background.png │ │ ├── tut_page_2_front.png │ │ ├── tut_page_3_background.png │ │ ├── tut_page_3_foreground.png │ │ ├── tut_page_4_background.png │ │ └── tut_page_4_foreground.png │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ └── ic_launcher.png │ │ ├── values-w820dp │ │ └── dimens.xml │ │ └── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── za │ └── co │ └── riggaroo │ └── helptut │ └── helptutorialexample │ └── ExampleUnitTest.java ├── build.gradle ├── device-2015-11-10-134837.mp4 ├── example-usage.gif ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── materialhelptutorial ├── .gitignore ├── build.gradle ├── materialhelptutorial.iml └── src │ ├── androidTest │ └── java │ │ └── za │ │ └── co │ │ └── riggaroo │ │ └── materialhelptutorial │ │ └── ApplicationTest.java │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── za │ │ │ └── co │ │ │ └── riggaroo │ │ │ └── materialhelptutorial │ │ │ ├── MaterialTutorialFragment.java │ │ │ ├── TutorialItem.java │ │ │ ├── adapter │ │ │ └── MaterialTutorialAdapter.java │ │ │ ├── tutorial │ │ │ ├── MaterialTutorialActivity.java │ │ │ ├── MaterialTutorialContract.java │ │ │ └── MaterialTutorialPresenter.java │ │ │ └── view │ │ │ ├── CirclePageIndicator.java │ │ │ └── PageIndicator.java │ └── res │ │ ├── drawable-hdpi │ │ └── ic_navigate_next.png │ │ ├── drawable-mdpi │ │ └── ic_navigate_next.png │ │ ├── drawable-xhdpi │ │ └── ic_navigate_next.png │ │ ├── drawable-xxhdpi │ │ └── ic_navigate_next.png │ │ ├── drawable-xxxhdpi │ │ └── ic_navigate_next.png │ │ ├── layout-land │ │ └── fragment_help_tutorial_image.xml │ │ ├── layout │ │ ├── activity_help_tutorial.xml │ │ └── fragment_help_tutorial_image.xml │ │ └── values │ │ ├── attrs.xml │ │ ├── strings.xml │ │ └── values.xml │ └── test │ └── java │ └── za │ └── co │ └── riggaroo │ └── materialhelptutorial │ └── ExampleUnitTest.java └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea/workspace.xml 4 | /.idea/libraries 5 | .DS_Store 6 | /build 7 | /captures 8 | /.idea/ 9 | *.iml 10 | 11 | *.iml 12 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: android 2 | android: 3 | components: 4 | - platform-tools 5 | - tools 6 | 7 | - build-tools-23.0.2 8 | - android-23 9 | 10 | - extra-google-m2repository 11 | - extra-android-m2repository 12 | - addon-google_apis-google-19 13 | - sys-img-armeabi-v7a-android-21 14 | 15 | 16 | env: 17 | global: 18 | # install timeout in minutes (2 minutes by default) 19 | - ADB_INSTALL_TIMEOUT=8 20 | 21 | # Emulator Management: Create, Start and Wait 22 | before_script: 23 | - echo no | android create avd --force -n test -t android-21 --abi armeabi-v7a 24 | - emulator -avd test -no-skin -no-audio -no-window & 25 | - android-wait-for-emulator 26 | - adb shell input keyevent 82 & 27 | 28 | script: 29 | - android list target 30 | - ./gradlew connectedAndroidTest 31 | 32 | before_install: 33 | - pip install --user codecov 34 | after_success: 35 | - codecov -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MaterialIntroTutorial 2 | Android Library demonstrating a material intro tutorial much like the ones on Google Sheets 3 | 4 | This library creates an introduction screen for your application. 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 | Example: 8 | 9 | ![](example-usage.gif) 10 | 11 | 12 | [ ![Download](https://api.bintray.com/packages/spongebobrf/maven/MaterialIntroTutorial/images/download.svg) ](https://bintray.com/spongebobrf/maven/MaterialIntroTutorial/_latestVersion) 13 | 14 | [![Build Status](https://travis-ci.org/spongebobrf/MaterialIntroTutorial.svg)](https://travis-ci.org/spongebobrf/MaterialIntroTutorial) 15 | # Example Usage 16 | 17 | Add the following into your build.gradle: 18 | ```groovy 19 | compile 'za.co.riggaroo:materialhelptutorial:1.+' 20 | ``` 21 | 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. 22 | ```java 23 | public void loadTutorial() { 24 | Intent mainAct = new Intent(this, MaterialTutorialActivity.class); 25 | mainAct.putParcelableArrayListExtra(MaterialTutorialActivity.MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS, getTutorialItems(this)); 26 | startActivityForResult(mainAct, REQUEST_CODE); 27 | 28 | } 29 | 30 | private ArrayList getTutorialItems(Context context) { 31 | TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle), 32 | R.color.slide_1, R.drawable.tut_page_1_front, R.drawable.tut_page_1_background); 33 | 34 | // You can also add gifs, [IN BETA YET] (because Glide is awesome!) 35 | TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle), 36 | R.color.slide_1, R.drawable.gif_drawable, true); 37 | 38 | ... 39 | 40 | ArrayList tutorialItems = new ArrayList<>(); 41 | tutorialItems.add(tutorialItem1); 42 | ... 43 | 44 | return tutorialItems; 45 | } 46 | ``` 47 | You should see a tutorial like below: 48 | 49 | 50 | This library is using the following: 51 | - CirclePageIndicator https://github.com/JakeWharton/ViewPagerIndicator 52 | - Glide for image loading - https://github.com/bumptech/glide 53 | - Percent Support Library - http://developer.android.com/intl/ru/reference/android/support/percent/package-summary.html 54 | 55 | # License 56 | 57 | MIT License 58 | 59 | Copyright (c) 2015 Rebecca Franks 60 | 61 | Permission is hereby granted, free of charge, to any person obtaining a copy 62 | of this software and associated documentation files (the "Software"), to deal 63 | in the Software without restriction, including without limitation the rights 64 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 65 | copies of the Software, and to permit persons to whom the Software is 66 | furnished to do so, subject to the following conditions: 67 | 68 | 69 | 70 | The above copyright notice and this permission notice shall be included in 71 | all copies or substantial portions of the Software. 72 | 73 | 74 | 75 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 76 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 77 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 78 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 79 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 80 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 81 | THE SOFTWARE. 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml 3 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 27 5 | buildToolsVersion "27.0.3" 6 | 7 | defaultConfig { 8 | applicationId "za.co.riggaroo.helptut.helptutorialexample" 9 | minSdkVersion 14 10 | targetSdkVersion 27 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | dependencies { 23 | compile fileTree(dir: 'libs', include: ['*.jar']) 24 | testCompile 'junit:junit:4.12' 25 | compile project(':materialhelptutorial') 26 | compile 'com.android.support:appcompat-v7:27.0.2' 27 | } 28 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/rebeccafranks/Library/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/androidTest/java/za/co/riggaroo/helptut/helptutorialexample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package za.co.riggaroo.helptut.helptutorialexample; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/za/co/riggaroo/helptut/helptutorialexample/MainActivity.java: -------------------------------------------------------------------------------- 1 | package za.co.riggaroo.helptut.helptutorialexample; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.support.v7.app.AppCompatActivity; 6 | import android.os.Bundle; 7 | import android.view.View; 8 | import android.widget.Button; 9 | import android.widget.Toast; 10 | 11 | import java.util.ArrayList; 12 | 13 | import za.co.riggaroo.materialhelptutorial.TutorialItem; 14 | import za.co.riggaroo.materialhelptutorial.tutorial.MaterialTutorialActivity; 15 | 16 | public class MainActivity extends AppCompatActivity { 17 | 18 | private static final int REQUEST_CODE = 1234; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | setContentView(R.layout.activity_main); 24 | 25 | Button buttonViewTutorial = (Button)findViewById(R.id.buttonViewTutorial); 26 | buttonViewTutorial.setOnClickListener(new View.OnClickListener() { 27 | @Override 28 | public void onClick(View v) { 29 | loadTutorial(); 30 | } 31 | }); 32 | 33 | } 34 | public void loadTutorial() { 35 | Intent mainAct = new Intent(this, MaterialTutorialActivity.class); 36 | mainAct.putParcelableArrayListExtra(MaterialTutorialActivity.MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS, getTutorialItems(this)); 37 | startActivityForResult(mainAct, REQUEST_CODE); 38 | 39 | } 40 | 41 | private ArrayList getTutorialItems(Context context) { 42 | TutorialItem tutorialItem1 = new TutorialItem(R.string.slide_1_african_story_books, R.string.slide_1_african_story_books, 43 | R.color.slide_1, R.drawable.tut_page_1_front, R.drawable.tut_page_1_background); 44 | 45 | TutorialItem tutorialItem2 = new TutorialItem(R.string.slide_2_volunteer_professionals, R.string.slide_2_volunteer_professionals_subtitle, 46 | R.color.slide_2, R.drawable.tut_page_2_front, R.drawable.tut_page_2_background); 47 | 48 | TutorialItem tutorialItem3 = new TutorialItem(context.getString(R.string.slide_3_download_and_go), null, 49 | R.color.slide_3, R.drawable.tut_page_3_foreground); 50 | 51 | TutorialItem tutorialItem4 = new TutorialItem(R.string.slide_4_different_languages, R.string.slide_4_different_languages_subtitle, 52 | R.color.slide_4, R.drawable.tut_page_4_foreground, R.drawable.tut_page_4_background); 53 | 54 | ArrayList tutorialItems = new ArrayList<>(); 55 | tutorialItems.add(tutorialItem1); 56 | tutorialItems.add(tutorialItem2); 57 | tutorialItems.add(tutorialItem3); 58 | tutorialItems.add(tutorialItem4); 59 | 60 | return tutorialItems; 61 | } 62 | @Override 63 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { 64 | // super.onActivityResult(requestCode, resultCode, data); 65 | if (resultCode == RESULT_OK && requestCode == REQUEST_CODE){ 66 | Toast.makeText(this, "Tutorial finished", Toast.LENGTH_LONG).show(); 67 | 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_1_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_1_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_1_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_1_front.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_2_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_2_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_2_front.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_2_front.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_3_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_3_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_3_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_3_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_4_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_4_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/tut_page_4_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/riggaroo/MaterialIntroTutorial/66ec189fd44e361dc1f1e5d3fc2df81c27b682ac/app/src/main/res/drawable-hdpi/tut_page_4_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 |