package ai.pai.lensman.splash;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import ai.pai.lensman.R;
import ai.pai.lensman.login.LoginActivity;
import ai.pai.lensman.upload.UploadActivity;

public class SplashActivity extends FragmentActivity implements SplashContract.View {

    private SplashPresenter presenter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        presenter = new SplashPresenter(this,this);

    }

    @Override
    protected void onResume() {
        super.onResume();
        presenter.start();

    }

    @Override
    protected void onStop() {
        super.onStop();
        presenter.stop();
    }

    @Override
    public void jump2Main() {
        Intent intent = new Intent(SplashActivity.this, UploadActivity.class);
        startActivity(intent);
        finish();
    }

    @Override
    public void jump2Login() {
        Intent intent = new Intent(SplashActivity.this, LoginActivity.class);
        startActivity(intent);
        finish();
    }
}
