Skip to content

Latest commit

 

History

History
67 lines (52 loc) · 2.48 KB

README.md

File metadata and controls

67 lines (52 loc) · 2.48 KB

TutorialView

Highlight the new features or best parts of your Android App and guide new users

 

Contains 3 modules

  1. TutorialViewLibrary (com.ak.android.tutorialview) which is an Android Library
  2. TutorialViewSampleApp - A sample app showing how to use the above library
  3. viewpagerindicator(http://viewpagerindicator.com/) - Used by the library for viewing tutorial with multiple items/pages

TutorialBuilder

Build your tutorial using the TutorialBuilder class by passing one or more tutorial items. Sample code below:

private void showTutorial(){
        TutorialBuilder builder = new TutorialBuilder(this);

        ViewHighlighterCustomViewTutorialItem tutItem1 = new ViewHighlighterCustomViewTutorialItem(
                this,
                R.id.button1,
                R.layout.tutorial_custom_layout
        );
        ViewHighlighterTutorialItem tutItem2 = new ViewHighlighterTutorialItem(
                this,
                R.string.tut_page2_desc,
                R.id.button2, R.id.button3
        );
        builder.setTutId(1)
                .setForce(true)
                .addTutItem(tutItem1)
                .addTutItem(tutItem2)
                .build()
                .run();
    }

Each tutorial needs a unique Id - set via setTutId(int)

By default the tutorial is shown only once on the first run unless it is forced using setForce(boolean)

TutorialItem

Currently there is support for 2 types of tutorial items

  1. ViewHighlighterTutorialItem - A simple help text overlay highlighting required views and a central aligned text describing the highlighted view
ViewHighlighterTutorialItem tutItem2 = new ViewHighlighterTutorialItem(
                this, //activity object
                R.string.tut_page2_desc, // string resource id describing the highlighed view
                R.id.button2, R.id.button3 // view resource ids of views to be highlighted
        );
  1. ViewHighlighterCustomViewTutorialItem - A custom layout help overlay over highlighted views
ViewHighlighterCustomViewTutorialItem tutItem1 = new ViewHighlighterCustomViewTutorialItem(
                this, //activity object
                R.id.button1, // view resource id to highlight
                R.layout.tutorial_custom_layout // layout resource id to be shown as help over highlighted view
        );