-
Notifications
You must be signed in to change notification settings - Fork 1
/
Splash.java
51 lines (36 loc) · 1.45 KB
/
Splash.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 com.example.imrankhan.summerplanner;
import android.app.Activity;
import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
public class Splash extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
final ImageView img = (ImageView)findViewById(R.id.imageView);
final Animation animation = AnimationUtils.loadAnimation(getBaseContext(),R.anim.rotate);
final Animation animation1 = AnimationUtils.loadAnimation(getBaseContext(),R.anim.abc_fade_out);
img.startAnimation(animation);
animation.setAnimationListener(new Animation.AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
img.startAnimation(animation1);
finish();
Intent intent = new Intent(getApplicationContext(), MainActivity.class);
startActivity(intent);
}
@Override
public void onAnimationRepeat(Animation animation) {
}
});
}
}