AndroidAPS/app/src/main/java/info/nightscout/androidaps/startupwizard/SWScreen.java

50 lines
1.1 KiB
Java
Raw Normal View History

2018-04-20 17:27:31 +02:00
package info.nightscout.androidaps.startupwizard;
import java.util.ArrayList;
import java.util.List;
import info.nightscout.androidaps.MainApp;
2018-05-20 15:09:32 +02:00
import info.nightscout.androidaps.startupwizard.elements.SWItem;
2018-04-20 17:27:31 +02:00
public class SWScreen {
int header;
List<SWItem> items = new ArrayList<>();
SWValidator validator;
2018-05-09 18:49:42 +02:00
SWValidator visibility;
2018-04-20 17:27:31 +02:00
boolean skippable = false;
public SWScreen(int header) {
this.header = header;
}
public String getHeader() {
return MainApp.gs(header);
}
public SWScreen skippable(boolean skippable) {
this.skippable = skippable;
return this;
}
public SWScreen add(SWItem newItem) {
items.add(newItem);
return this;
}
public SWScreen validator(SWValidator validator) {
this.validator = validator;
return this;
}
2018-05-09 13:38:17 +02:00
2018-05-09 18:49:42 +02:00
public SWScreen visibility(SWValidator visibility) {
this.visibility = visibility;
return this;
}
2018-05-09 13:38:17 +02:00
public void processVisibility() {
for (SWItem i : items)
i.processVisibility();
}
2018-04-20 17:27:31 +02:00
}