A short and simple library which allows easy replication of several* app onboarding techniques.

Min SDK   16
Latest Commit   2017-10-21 13:23:22
License   Apache-2.0

Github   https://github.com/Vexigon/Material-Onboarding

         

标签

使用APP客户端扫描二维码运行Demo


         

类似的还有....
SlidingIntoView initial commit
Material-ViewPagerIndicator Dot-based Android ViewPager indicator with Material Design animations.
Onboarding A beautiful way to introduce users to your app
README

README.md

Material-Onboarding Build Status Codacy Badge

Sample image

(Image is of sample usage from an unreleased app)

A short and simple library which allows easy replication of several app onboarding techniqies found here.

Background

The Material Design guidelines list a lot of different techniques for onboarding users in your apps. The main concept is to remain as simple as possible, and do away with complicated introductions to your app.

*What's Included

For now, this library only allows the creation of the TopUserBenefitsModel technique. Later on, it will make use of the other techniques as well.

Enough Talking. How do I use this?

First off, add the Gradle dependency to your app:

// Add this in your root build.gradle file
allprojects {
    repositories {
        // ...
        maven { url 'https://jitpack.io' }
    }
}
// And add this to your module build.gradle file
dependencies {
    // ...
    compile 'com.github.Vexigon:Material-Onboarding:v1.1.1'
}

Next, add a manifest activity declaration, and set its theme. NOTE: Make sure your theme's parent is Sometheme.NoActionBar otherwise your onboarding activity will have a toolbar.

<activity
    android:name="com.vexigon.libraries.onboarding.ui.activity.UserBenefitsActivity"
    android:theme="@style/Onboarding" />

And now, the fun part! Create a new TopUserBenefitsModel instance like this:

new TopUserBenefitsModel(this)
    .setupSlides(
            new Page("Title 1", "Subtitle 1", R.mipmap.ic_launcher),
            new Page("Title 2", "Subtitle 2", R.mipmap.ic_launcher),
            new Page("Title 3", "Subtitle 3", "Custom Button Text", R.mipmap.ic_launcher)
    )
    .launch();

Code Overview

Below, you'll find info for each of the methods for setting up your onboarding activity.

new TopUserBenefitsModel(Activity activity)

The constructor takes an activity as its parameter.

// For launching from activity...
@Override
public void onClick(View v) {
    switch (v.getId()) {
        case R.id.demo:
            new TopUserBenefitsModel(this)
                    ...
            break;
    }
}

setupSlides()

This method takes a String array of titles for each slide. The items in the array correspond to the title on each slide. (Array position 0 sets the title of the first slide, and so on.)

// Sample
new TopUserBenefitsModel(Activity activity)
    .setupSlides(
            new Page("Title 1", "Subtitle 1", R.mipmap.ic_launcher),
            new Page("Title 2", "Subtitle 2", R.mipmap.ic_launcher),
            new Page("Title 3", "Subtitle 3", "Custom Button Text", R.mipmap.ic_launcher)
    );

Page object

The SSPage object takes 4 parameters total. See below:

// 3 required
new Page(String pageTitle, String pageSubtitle, int drawableResource);

// 1 optional
new Page(String pageTitle, String pageSubtitle, String buttonText, int drawableResource);

launch()

This method launches the activity. No parameters are required.

Sample App

Review the sample app code here, and download the APK here.

Thanks

This library makes use of some other libraries made by some awesome developers around the Github community.

Thank you!

License

See LICENSE.md

Developed By

Andrew Quebe

Github | Google+ | Twitter