material風格歡迎界面示例:MaterialIntroTutorial
一個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
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!