Created
December 24, 2018 13:24
-
-
Save theapache64/b0f3c9b51404e0f5f33dcbd0fee5118f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SplashActivityViewModel extends BaseViewModel<SplashActivityNavigator> { | |
private static final int SPLASH_DURATION_IN_MILLIS = 1500; | |
public SplashActivityViewModel(@NonNull Application application, SplashActivityNavigator navigator) { | |
super(application, navigator); | |
} | |
void startWorking() { | |
final LogInResponse.User user = PreferenceManager.getInstance(getApplication()).getUser(); | |
new Handler().postDelayed(new Runnable() { | |
@Override | |
public void run() { | |
if (user == null) { | |
getNavigator().openLogInActivity(); | |
} else { | |
getNavigator().openMainActivity(); | |
} | |
} | |
}, SPLASH_DURATION_IN_MILLIS); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment