-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSplashScreen.java
More file actions
71 lines (52 loc) · 2.28 KB
/
Copy pathSplashScreen.java
File metadata and controls
71 lines (52 loc) · 2.28 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
package com.example.trip_packer;
import androidx.appcompat.app.AppCompatActivity;
import android.animation.ObjectAnimator;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.animation.AccelerateInterpolator;
import android.widget.ImageView;
import android.widget.TextView;
public class SplashScreen extends AppCompatActivity {
private ImageView appIcon;
private TextView txtAppName;
private TextView txtFrom;
private TextView txtBtechMates;
private ImageView logo;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash_screen);
getSupportActionBar().hide();
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent intent=new Intent(SplashScreen.this,SendOtpActivity.class);
startActivity(intent);
finish();
}
},1400);
appIcon = findViewById(R.id.appIcon);
txtAppName = findViewById(R.id.txtAppName);
txtFrom = findViewById(R.id.txtFrom);
txtBtechMates = findViewById(R.id.txtBtechMates);
logo = findViewById(R.id.logo);
startAnimation();
}
private void startAnimation() {
ObjectAnimator fadeInAppIcon = ObjectAnimator.ofFloat(appIcon, "alpha", 0f, 1f);
fadeInAppIcon.setDuration(3000);
ObjectAnimator fadeInTxtAppName = ObjectAnimator.ofFloat(txtAppName, "alpha", 0f, 1f);
fadeInTxtAppName.setDuration(30000);
ObjectAnimator fadeInTxtFrom = ObjectAnimator.ofFloat(txtFrom, "alpha", 0f, 1f);
fadeInTxtFrom.setDuration(3000);
ObjectAnimator fadeInTxtBtechMates = ObjectAnimator.ofFloat(txtBtechMates, "alpha", 0f, 1f);
fadeInTxtBtechMates.setDuration(3000);
ObjectAnimator fadeInLogo = ObjectAnimator.ofFloat(logo, "alpha", 0f, 1f);
fadeInLogo.setDuration(3000);
android.animation.AnimatorSet animatorSet = new android.animation.AnimatorSet();
animatorSet.playTogether(fadeInAppIcon, fadeInTxtAppName, fadeInTxtFrom, fadeInTxtBtechMates, fadeInLogo);
animatorSet.setInterpolator(new AccelerateInterpolator());
animatorSet.start();
}
}