|
|
@@ -1,15 +1,22 @@ |
|
|
|
package com.nsgk.ruralWeb; |
|
|
|
|
|
|
|
import android.animation.Animator; |
|
|
|
import android.animation.AnimatorListenerAdapter; |
|
|
|
import android.annotation.SuppressLint; |
|
|
|
import android.content.Intent; |
|
|
|
import android.os.Bundle; |
|
|
|
import android.os.Handler; |
|
|
|
import android.os.Message; |
|
|
|
import android.view.animation.Animation; |
|
|
|
import android.view.animation.AnimationUtils; |
|
|
|
import android.view.animation.AnticipateInterpolator; |
|
|
|
import android.widget.ImageView; |
|
|
|
|
|
|
|
import androidx.annotation.NonNull; |
|
|
|
import androidx.appcompat.app.AppCompatActivity; |
|
|
|
|
|
|
|
public class WelcomeActivity extends AppCompatActivity { |
|
|
|
private ImageView imageView; |
|
|
|
|
|
|
|
private Handler handler = new Handler() { |
|
|
|
@SuppressLint("HandlerLeak") |
|
|
@@ -22,7 +29,10 @@ public class WelcomeActivity extends AppCompatActivity { |
|
|
|
Intent intent = new Intent(WelcomeActivity.this, FullscreenActivity.class); |
|
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); |
|
|
|
startActivity(intent); |
|
|
|
overridePendingTransition(R.anim.activity_in, R.anim.activity_out); |
|
|
|
break; |
|
|
|
default: |
|
|
|
throw new IllegalStateException("Unexpected value: " + msg.what); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
@@ -31,13 +41,19 @@ public class WelcomeActivity extends AppCompatActivity { |
|
|
|
protected void onCreate(Bundle savedInstanceState) { |
|
|
|
super.onCreate(savedInstanceState); |
|
|
|
this.setContentView(R.layout.activity_welcome); |
|
|
|
|
|
|
|
|
|
|
|
handler.postDelayed(new Runnable() { |
|
|
|
@Override |
|
|
|
public void run() { |
|
|
|
handler.sendEmptyMessage(1); |
|
|
|
} |
|
|
|
}, 3000); |
|
|
|
imageView = findViewById(R.id.imageView); |
|
|
|
Animation animation = AnimationUtils.loadAnimation(this, R.anim.img_anim); |
|
|
|
animation.start(); |
|
|
|
imageView.animate() |
|
|
|
.scaleXBy(1.5f) |
|
|
|
.scaleYBy(1.5f) |
|
|
|
.setInterpolator(new AnticipateInterpolator()) |
|
|
|
.setDuration(2000) |
|
|
|
.setListener(new AnimatorListenerAdapter() { |
|
|
|
@Override |
|
|
|
public void onAnimationEnd(Animator animation) { |
|
|
|
handler.sendEmptyMessage(1); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} |