material风格欢迎界面示例:MaterialIntroTutorial
jopen
9年前
一个Android库展示了material风格欢迎界面示例。这个帮助教程为每个页面设置背景色,然后两个页面之间滚动时,两种颜色将淡出。示例:
用法
将以下添加至你的 build.gradle:
compile 'za.co.riggaroo:materialhelptutorial:1.0.1'
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.
public void loadTutorial() { Intent mainAct = new Intent(this, MaterialTutorialActivity.class); mainAct.putParcelableArrayListExtra(MaterialTutorialActivity.MATERIAL_TUTORIAL_ARG_TUTORIAL_ITEMS, getTutorialItems(this)); startActivityForResult(mainAct, REQUEST_CODE); } private ArrayList<TutorialItem> getTutorialItems(Context context) { TutorialItem tutorialItem1 = new TutorialItem(context.getString(R.string.slide_1_african_story_books), context.getString(R.string.slide_1_african_story_books_subtitle), R.color.slide_1, R.drawable.tut_page_1_front, R.drawable.tut_page_1_background); ... ArrayList<TutorialItem> tutorialItems = new ArrayList<>(); tutorialItems.add(tutorialItem1); ... return tutorialItems; }
You should see a tutorial like below:
This library is using the following:
- CirclePageIndicator https://github.com/JakeWharton/ViewPagerIndicator
- Glide for image loading - https://github.com/bumptech/glide
- Percent Support Library - http://developer.android.com/intl/ru/reference/android/support/percent/package-summary.html