StepDialog

项目地址:guangzq/StepDialog
简介:一行代码实现 ofo app 首次注册时的步骤控件
更多:作者   提 Bug   
标签:
DialogFragment-

一行代码实现 ofo app 首次注册时的步骤控件

Preview

stepdialog

Gradle

dependencies {
    compile 'com.zqg:library:1.0.2'
}

Usage

StepDialog.getInstance()
                .setImages(new int[]{R.drawable.new_user_guide_1, R.drawable.new_user_guide_2, R.drawable.new_user_guide_3, R.drawable.new_user_guide_4})
                .show(getFragmentManager());

API

API 释义
setPageTransformer ViewPager 切换动画方式,分为 DepthPageTransformer 和 ZoomOutPageTransformer 两种方式
setCanceledOnTouchOutside 点击四周是否取消 dialog,默认取消
setOutsideIsTransparent 设置背景四周是否透明,调用时需要放到 show 方法后面
setOnCancelListener dissmiss 监听,可以用来进行 dissmiss 后的操作,比如跳转

ViewPager 的两种切换方式

DepthPageTransformer 方式

示例

StepDialog.getInstance()
                        .setImages(new int[]{com.zqg.dialogviewpager.R.drawable.new_user_guide_1, com.zqg.dialogviewpager.R.drawable.new_user_guide_2, com.zqg.dialogviewpager.R.drawable.new_user_guide_3, com.zqg.dialogviewpager.R.drawable.new_user_guide_4})
                        .setPageTransformer(new DepthPageTransformer())
                        .show(getFragmentManager());

t1

ZoomOutPageTransformer 方式

示例

StepDialog.getInstance()
                        .setImages(new int[]{com.zqg.dialogviewpager.R.drawable.new_user_guide_1, com.zqg.dialogviewpager.R.drawable.new_user_guide_2, com.zqg.dialogviewpager.R.drawable.new_user_guide_3, com.zqg.dialogviewpager.R.drawable.new_user_guide_4})
                        .setPageTransformer(new ZoomOutPageTransformer())
                        .show(getFragmentManager());

t2

License

MIT License

Copyright (c) 2017 祝起光

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Android 开发经验分享
用了一年多的理财推荐
Android 开发经验分享
用了一年多的理财推荐