引导图 android开源,Material-Onboarding 轻松实现引导图

Material-Onboarding

onboarding_sample.png

(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:

// TODO

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.

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.

Thanks

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

Thank you!

License

Developer Info

Andrew Quebe

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值