Fixes to logic when setting up the welcome pager adapter

pull/14/head
Sam Bosley 13 years ago
parent b2686e855c
commit 2c87c840a0

@ -64,6 +64,8 @@ public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
R.layout.welcome_walkthrough_login_page, R.layout.welcome_walkthrough_login_page,
}; };
public int fallbackLoginPage;
private final Context context; private final Context context;
public WelcomeWalkthrough parent; public WelcomeWalkthrough parent;
@Autowired ActFmPreferenceService actFmPreferenceService; @Autowired ActFmPreferenceService actFmPreferenceService;
@ -83,18 +85,21 @@ public class WelcomePagerAdapter extends PagerAdapter implements TitleProvider
int choice = ABChooser.readChoiceForTest(ABTests.AB_NEW_LOGIN_YES_GOOGLE); int choice = ABChooser.readChoiceForTest(ABTests.AB_NEW_LOGIN_YES_GOOGLE);
switch (choice) { switch (choice) {
case 1: case 1:
layouts[layouts.length - 1] = R.layout.actfm_login_activity; fallbackLoginPage = layouts[layouts.length - 1] = R.layout.actfm_login_activity;
break; break;
case 2: case 2:
layouts[layouts.length - 1] = R.layout.welcome_walkthrough_simple_login; layouts[layouts.length - 1] = R.layout.welcome_walkthrough_simple_login;
fallbackLoginPage = R.layout.actfm_login_activity;
break; break;
default: default:
fallbackLoginPage = layouts[layouts.length - 1];
break; break;
} }
} else if (ABChooser.readChoiceForTest(ABTests.AB_NEW_LOGIN_NO_GOOGLE) != ABChooser.NO_OPTION) { } else if (ABChooser.readChoiceForTest(ABTests.AB_NEW_LOGIN_NO_GOOGLE) != ABChooser.NO_OPTION) {
int choice = ABChooser.readChoiceForTest(ABTests.AB_NEW_LOGIN_NO_GOOGLE); int choice = ABChooser.readChoiceForTest(ABTests.AB_NEW_LOGIN_NO_GOOGLE);
fallbackLoginPage = layouts[layouts.length - 1];
if (choice == 1) if (choice == 1)
layouts[layouts.length - 1] = R.layout.actfm_login_activity; fallbackLoginPage = layouts[layouts.length - 1] = R.layout.actfm_login_activity;
} }
} }
} }

@ -78,7 +78,7 @@ public class WelcomeWalkthrough extends ActFmLoginActivity {
} }
private int getLoginPageLayout() { private int getLoginPageLayout() {
return R.layout.actfm_login_activity; return mAdapter.fallbackLoginPage;
} }
@Override @Override

Loading…
Cancel
Save