fix for screens adding up

This commit is contained in:
Roumen Georgiev 2018-05-09 15:44:40 +03:00
parent 41d736e176
commit bfd61a65a0
2 changed files with 3 additions and 12 deletions

View file

@ -47,6 +47,8 @@ public class SWDefinition {
SWDefinition() { SWDefinition() {
// List all the screens here // List all the screens here
if(screens.size() >0)
return;
add(new SWScreen(R.string.nav_setupwizard) add(new SWScreen(R.string.nav_setupwizard)
.add(new SWInfotext() .add(new SWInfotext()
.label(R.string.welcometosetupwizard) ) .label(R.string.welcometosetupwizard) )

View file

@ -31,9 +31,8 @@ public class SetupWizardActivity extends AppCompatActivity {
SWDefinition swDefinition = new SWDefinition(); SWDefinition swDefinition = new SWDefinition();
List<SWScreen> screens = swDefinition.getScreens(); List<SWScreen> screens = swDefinition.getScreens();
private int currentWizardPage = 0; private int currentWizardPage = 0;
public static final String INTENT_MESSAGE = "WIZZARDPAGE"; public static final String INTENT_MESSAGE = "WIZZARDPAGE";
public static final String RESTART = "RESTART";
@Override @Override
protected void onCreate(Bundle savedInstanceState) { protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
@ -62,14 +61,6 @@ public class SetupWizardActivity extends AppCompatActivity {
@Override @Override
protected void onResume() { protected void onResume() {
Intent intent = new Intent(this, SetupWizardActivity.class);
intent.putExtra(INTENT_MESSAGE, 0);
if(intent.getBooleanExtra(RESTART, false)) {
intent.putExtra(RESTART, false);
this.finish();
startActivity(intent);
}
super.onResume(); super.onResume();
MainApp.bus().register(this); MainApp.bus().register(this);
swDefinition.setContext(this); swDefinition.setContext(this);
@ -126,7 +117,6 @@ public class SetupWizardActivity extends AppCompatActivity {
this.finish(); this.finish();
Intent intent = new Intent(this, SetupWizardActivity.class); Intent intent = new Intent(this, SetupWizardActivity.class);
intent.putExtra(INTENT_MESSAGE, currentWizardPage + 1); intent.putExtra(INTENT_MESSAGE, currentWizardPage + 1);
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent); startActivity(intent);
} }
@ -137,7 +127,6 @@ public class SetupWizardActivity extends AppCompatActivity {
intent.putExtra(INTENT_MESSAGE, currentWizardPage - 1); intent.putExtra(INTENT_MESSAGE, currentWizardPage - 1);
else else
intent.putExtra(INTENT_MESSAGE, 0); intent.putExtra(INTENT_MESSAGE, 0);
// intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent); startActivity(intent);
} }