-
Notifications
You must be signed in to change notification settings - Fork 18
/
SplashActivity.java
33 lines (27 loc) · 1.15 KB
/
SplashActivity.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.hit.android.haim.texasholdem.view.activity;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import androidx.appcompat.app.AppCompatActivity;
import org.hit.android.haim.texasholdem.R;
/**
* The first activity that we display is a splash screen with cards animation<br/>
* This activity does nothing except of waiting for some seconds for the animation to finish and then
* switches to the {@link LoginActivity}
* @author Haim Adrian
* @since 15-Jun-21
*/
public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
Intent mainActivity = new Intent(this, LoginActivity.class);
ActivityOptions activityOptions = ActivityOptions.makeCustomAnimation(this, android.R.anim.fade_in, android.R.anim.fade_out);
// Run it later on UI thread
new Handler().postDelayed(() -> {
startActivity(mainActivity, activityOptions.toBundle());
}, 4500);
}
}