启动画面动画循环开始

时间:2021-05-27 14:57:55

标签: java android splash-screen

我有一个简单的闪屏动画活动,我添加了 public class loadingScreen extends AppCompatActivity { Animation topAnimation, bottomAnimation, middleAnimation; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.activity_loading_screen); ButterKnife.bind(this); topAnimation = AnimationUtils.loadAnimation(loadingScreen.this, R.anim.slide_down); bottomAnimation = AnimationUtils.loadAnimation(loadingScreen.this,R.anim.bottom_up); middleAnimation = AnimationUtils.loadAnimation(loadingScreen.this,R.anim.fade_in2); final ImageView image1 = findViewById(R.id.image1); final ImageView image2 = findViewById(R.id.image2); final ImageView image3 = findViewById(R.id.image3); final ImageView image4 = findViewById(R.id.image4); final ImageView image5 = findViewById(R.id.image5); final ImageView image6 = findViewById(R.id.image6); final TextView text1 = findViewById(R.id.app_title); final TextView text2 = findViewById(R.id.app_desc); text1.setAnimation(middleAnimation); text2.setAnimation(middleAnimation); image1.setAnimation(topAnimation); image2.setAnimation(topAnimation); image3.setAnimation(topAnimation); image4.setAnimation(bottomAnimation); image5.setAnimation(bottomAnimation); image6.setAnimation(bottomAnimation); int SPLASH_TIME_OUT = 1500; new Handler().postDelayed(() -> { Intent intent = new Intent(loadingScreen.this, MainActivity.class); startActivity(intent); finish(); }, SPLASH_TIME_OUT); } } 来传递意图启动活动,但我发现动画中有一个循环 here is a video displaying the loop

代码:

splashScreen

我不知道为什么我会在动画结束时出现循环。

如果我尝试使用带有空 Main activitygolem::create_golem() 的应用程序,我在结尾处看不到循环。

0 个答案:

没有答案
相关问题