-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMainActivity.java
51 lines (45 loc) · 1.65 KB
/
MainActivity.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package change.com.animationwithsplash;
import androidx.appcompat.app.AppCompatActivity;
import android.app.ProgressDialog;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;
public class MainActivity extends AppCompatActivity {
private static int SPLASH_SCREEN = 5000;
Animation topAnim,bottomAnim,top1;
ImageView image;
TextView logo,slogan;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
topAnim = AnimationUtils.loadAnimation(this,R.anim.top_animation);
top1 = AnimationUtils.loadAnimation(this,R.anim.top1);
bottomAnim = AnimationUtils.loadAnimation(this,R.anim.bottom_animation);
image = findViewById(R.id.imageView2);
logo = findViewById(R.id.textView);
slogan = findViewById(R.id.textView2);
image.setAnimation(topAnim);
logo.setAnimation(bottomAnim);
slogan.setAnimation(bottomAnim);
Thread splash = new Thread(){
public void run() {
try
{
sleep(3*1000);
Intent i = new Intent(getBaseContext(),Login.class);
startActivity(i);
finish();
}
catch (Exception e) {
}
}
};
splash.start();
}
}