在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):drozdzynski/Steppers开源软件地址(OpenSource Url):https://github.com/drozdzynski/Steppers开源编程语言(OpenSource Language):Java 100.0%开源软件介绍(OpenSource Introduction):SteppersScreenSetup1. Add library to projectGrab via Gradle:dependencies {
compile 'me.drozdzynski.library.steppers:steppers:1.0.0'
} Manual
2. Add view in XML Layout<me.drozdzynski.library.steppers.SteppersView
android:id="@+id/steppersView"
android:layout_width="match_parent"
android:layout_height="match_parent"/> 3. Setup config for SteppersViewSteppersView.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
}
});
steppersViewConfig.setOnChangeStepAction(new OnChangeStepAction() {
@Override
public void onChangeStep(int position, SteppersItem activeStep) {
// Action when click continue on each step
}
});
// Setup Support Fragment Manager for fragments in steps
steppersViewConfig.setFragmentManager(getSupportFragmentManager()); 4. Create steps listArrayList<SteppersItem> 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;SteppersView steppersView = (SteppersView) findViewById(R.id.steppersView);
steppersView.setConfig(steppersViewConfig);
steppersView.setItems(steps);
steppersView.build(); Other functionsEnable skip step buttonSimple: item.setSkippable(true); With callback: item.setSkippable(true, new OnSkipStepAction() {
@Override
public void onSkipStep() {
// Some action after step is skipped
}
}); Override continue buttonitem.setOnClickContinue(new OnClickContinue() {
@Override
public void onClick() {
// Some action on click
steppersView.nextStep(); // Now You must call next step
}
}); Change active stepsteppersView.setActiveItem(1); // step index from 0 Disable cancel button (hide)steppersViewConfig.setCancelAvailable(false); License
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论