-
Notifications
You must be signed in to change notification settings - Fork 58
Option
Ruben Gees edited this page Sep 17, 2015
·
3 revisions
Constructs an Option
with the specified title.
Constructs an Option
with the specified title and the specified activation state. If isActivated
is true, the Checkbox
will be checked, once the user navigates to the Slide
with this Option
.
A method which is used internally to resolve resources. Don't call this method yourself.
Build an Option
like this:
Option option = new Option("Enable Feature A", true);
Then add it to a Slide:
Slide slide = new Slide().withTitle("Feature A").withOption(option)
.withImage(R.drawable.image_feature_a).withColor(R.color.yellow);
In this example, we assume the created Slide is the second one which results in the index 1.
The next step is to read the users choices once he finished the intro. You need to do so following:
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == IntroductionBuilder.INTRODUCTION_REQUEST_CODE &&
resultCode == RESULT_OK) {
for (Option option : data.<Option>getParcelableArrayListExtra(IntroductionActivity.
OPTION_RESULT)) {
if(option.getPosition() == 1){
if(option.isActivated()){
//Enable Feature A.
}else{
//Disable Feature A.
}
}else{
//Handle other Options.
}
}
}else{
//Disable Feature A.
//Handle other request codes.
}
}