navasmdc / PhoneTutorial

Make simple and beautiful tutorials start for your applications
Apache License 2.0
79 stars 39 forks source link
android

Phone tutorial logo

Phone tutorial

Android app on Google Play

Phone tutorial giff

How to use

If you want use this library, you only have to download PhoneTutorial project, import it into your workspace and add the project as a library in your android project settings.

If you prefer it, you can use the gradle dependency, you have to add these lines in your build.gradle file:

repositories {
    jcenter()
}

dependencies {
    compile 'com.github.navasmdc:PhoneTutorial:1.+@aar'
}

This library support Android 2.2

You have to add this lines in the AndroidManifest.xml file too:

<activity
        android:name="com.gc.phonetutorial.activities.TutorialActivity"
        android:screenOrientation="portrait">
</activity>

Configuration

You can configure some elements of this Activity:

For more information see MainActivity of DemoTutorialProyect.

Launch activity

For launch this activity you must add this line in your code:

    startActivityForResult(tutorialIntent, TUTORIALACTIVITY);

Configure next button

For configure next button you have to override onActivityResult function, for example:

    final int TUTORIALACTIVITY = 0;

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {

        if(requestCode == TUTORIALACTIVITY){
            if(resultCode == Activity.RESULT_OK){
                // CLick in next button
                Toast.makeText(this, "Next", Toast.LENGTH_SHORT).show();
            }
        }

    }