Search in sources :

Example 1 with OnboardingCreateFragment

use of co.krypt.krypton.team.onboarding.create.OnboardingCreateFragment in project krypton-android by kryptco.

the class TeamOnboardingActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    setTheme(R.style.AppTheme);
    super.onCreate(savedInstanceState);
    CrashReporting.startANRReporting();
    setContentView(R.layout.fragment_teams);
    if (getIntent() != null && getIntent().getAction() != null) {
        onNewIntent(getIntent());
        return;
    }
    Fragment initialFragment = null;
    CreateTeamProgress createTeamProgress = new CreateTeamProgress(getApplicationContext());
    JoinTeamProgress joinTeamProgress = new JoinTeamProgress(getApplicationContext());
    if (createTeamProgress.inProgress()) {
        initialFragment = createTeamProgress.currentStage().getFragment();
    } else if (joinTeamProgress.inProgress()) {
        initialFragment = joinTeamProgress.currentStage().getFragment();
    } else {
        // default to create team
        initialFragment = new OnboardingCreateFragment();
    }
    getSupportFragmentManager().beginTransaction().add(R.id.fragment_teams, initialFragment).commitAllowingStateLoss();
}
Also used : OnboardingCreateFragment(co.krypt.krypton.team.onboarding.create.OnboardingCreateFragment) CreateTeamProgress(co.krypt.krypton.team.onboarding.create.CreateTeamProgress) JoinTeamProgress(co.krypt.krypton.team.onboarding.join.JoinTeamProgress) Fragment(android.support.v4.app.Fragment) OnboardingCreateFragment(co.krypt.krypton.team.onboarding.create.OnboardingCreateFragment) OnboardingLoadTeamFragment(co.krypt.krypton.team.onboarding.create.OnboardingLoadTeamFragment)

Aggregations

Fragment (android.support.v4.app.Fragment)1 CreateTeamProgress (co.krypt.krypton.team.onboarding.create.CreateTeamProgress)1 OnboardingCreateFragment (co.krypt.krypton.team.onboarding.create.OnboardingCreateFragment)1 OnboardingLoadTeamFragment (co.krypt.krypton.team.onboarding.create.OnboardingLoadTeamFragment)1 JoinTeamProgress (co.krypt.krypton.team.onboarding.join.JoinTeamProgress)1