Steppers

[复制链接]
来自: chino 分类: Android精品源码 上传时间: 2016-3-23 10:56:52
Tag:

项目介绍:


Setup1. Add library to projectGrab via Gradle:
[XML] 查看源文件 复制代码
repositories {
    mavenCentral()
    maven {
        url "https://oss.sonatype.org/content/repositories/snapshots/"
    }
}

dependencies {
    compile 'me.drozdzynski.library.steppers:steppers:0.3.2-SNAPSHOT'
}


Manual
  • Download the library folder.
  • Copy to root project folder
  • Add to your settings.gradle file the following code line: "include ':app', ':steppers'"
  • Rebuild the project
  • Add dependency
    • File → Project Structure
    • in Modules section click on "app"
    • Click on tab "Dependecies"
    • Click on the green plus
    • Module Dependecy
    • Select ":library"
  • Done


2. Add view in XML Layout
[XML] 查看源文件 复制代码


3. Setup config for SteppersView
[XML] 查看源文件 复制代码
SteppersView.Config steppersViewConfig = new SteppersView.Config();
steppersViewConfig.setOnFinishAction(new OnFinishAction() {
    @Override
    public void onFinish() {
        // Action on last step Finish button
    }
});

steppersViewConfig.setOnCancelAction(new OnCancelAction() {
    @Override
    public void onCancel() {
        // Action when click cancel on one of steps
    }
});

// Setup Support Fragment Manager for fragments in steps
steppersViewConfig.setFragmentManager(getSupportFragmentManager());


4. Create steps list
[XML] 查看源文件 复制代码
ArrayList steps = new ArrayList<>();

SteppersItem stepFirst = new SteppersItem();

stepFirst.setLabel("Title of step");
stepFirst.setSubLabel("Subtitle of step");
stepFirst.setFragment(new SomeFragment());
stepFirst.setPositiveButtonEnable(false);

steps.add(stepFirst);


5. Set config, list and build view;
[XML] 查看源文件 复制代码
SteppersView steppersView = (SteppersView) findViewById(R.id.steppersView);
steppersView.setConfig(steppersViewConfig);
steppersView.setItems(steps);
steppersView.build();










相关源码推荐:

我来说两句
所有评论(21)
Oo未知oO 2016-3-23 14:29:12
很给力,安卓巴士有你更精彩!
回复
121ljk 2016-3-24 09:11:18
强烈支持楼主ing……
回复
121ljk 2016-3-24 09:11:18
虽不明,但觉厉!
回复
Oo未知oO 2016-3-26 12:32:50
强烈支持楼主ing……
回复
kxr 2016-3-28 16:11:30
我只是路过打酱油的。
回复
zxxcos 2016-3-31 15:01:02
感谢分享,安卓巴士有你更精彩:)
回复
KakaShi 2016-4-11 00:32:03
精华内容,楼主V5!
回复
123下一页
提取码:  下载次数:28 状态:已购或VIP 售价:10(原价:10)金钱 下载权限:初级码农 
2766 0 28
代码贡献英雄榜
用户名 下载数
联系我们
首页/微信公众账号投稿
帖子代码编辑/版权问题
QQ:435399051,1294855032
如何获得代码达人称号?
如何成为签约作者?
领先的中文移动开发者社区
18620764416
7*24全天服务
意见反馈:1294855032@qq.com

扫一扫关注我们

Powered by Discuz! X3.2© 2001-2019 Comsenz Inc.( 粤ICP备15117877号 )