package com.naijab.nextzytimeline.ui;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;

import com.naijab.nextzytimeline.R;
import com.naijab.nextzytimeline.base.BaseMvpActivity;
import com.naijab.nextzytimeline.ui.main.MainActivity;

public class SplashScreenActivity extends BaseMvpActivity<SplashScreenActivityInterface.Presenter>
        implements SplashScreenActivityInterface.View {

    private Handler handler;
    private Runnable runnable;
    private long delayTime;
    private long time = 1000L;

    @Override
    public SplashScreenActivityInterface.Presenter createPresenter() {
        return SplashScreenActivityPresenter.create();
    }

    @Override
    public int getLayoutView() {
        return R.layout.splash_screen;
    }

    @Override
    public void bindView() {
    }

    @Override
    public void setupInstance() {
        goToMainActivity();
    }

    @Override
    public void setupView() {
    }

    @Override
    public void initialize() {
    }

    @Override
    protected void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onRestoreInstanceState(Bundle savedInstanceState) {
        super.onRestoreInstanceState(savedInstanceState);
    }


    private void goToMainActivity() {
        handler = new Handler();
        runnable = new Runnable() {
            public void run() {
                Intent intent = new Intent(SplashScreenActivity.this, MainActivity.class);
                startActivity(intent);
                finish();
                overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
            }
        };
    }

    @Override
    public void onResume() {
        super.onResume();
        delayTime = time;
        handler.postDelayed(runnable, delayTime);
        time = System.currentTimeMillis();
    }

    public void onPause() {
        super.onPause();
        handler.removeCallbacks(runnable);
        time = delayTime - (System.currentTimeMillis() - time);
    }
}


@@ -191,27 +191,24 @@
 ne.base.Base
-Mvp
 Activity;%0Aim
@@ -311,19 +311,16 @@
 Base
-Mvp
 Activity
 %3CSpl
@@ -319,103 +319,8 @@
 vity
-%3CSplashScreenActivityInterface.Presenter%3E%0A        implements SplashScreenActivityInterface.View
  %7B%0A%0A
@@ -443,155 +443,8 @@
 L;%0A%0A
-    @Override%0A    public SplashScreenActivityInterface.Presenter createPresenter() %7B%0A        return SplashScreenActivityPresenter.create();%0A    %7D%0A%0A
     
@@ -1641,30 +1641,47 @@
 %0A    %7D%0A%0A    
-public
+@Override%0A    protected
  void onPaus
@@ -1824,11 +1824,13 @@
 ;%0A    %7D%0A
-%7D
+%0A%7D%0A
 %0A%0A

Edit splash Screen