简体   繁体   English

Android启动画面延迟

[英]Android splash screen delay

I have an animation for my splash screen and on some phones which take longer to load things, it starts mid animation. 我在启动屏幕上有一个动画,在某些需要较长时间加载的手机上,它从动画开始。

The splash screen is really an activity that has a View, in which the animation is drawn. 初始屏幕实际上是一个具有View的活动,在其中绘制了动画。 Is it possible to wait for the screen to load and then start the thread in the View? 是否可以等待屏幕加载,然后在视图中启动线程? I mean can I somehow check if I can begin the animation and it will be shown, the whole thing 我的意思是我可以以某种方式检查是否可以开始播放动画,并且整个过程都会显示出来。

Do yourself a favor and DON'T use a splash screen. 帮自己一个忙,不要使用启动画面。 On Android guidelines Google is extremely against splash screens because they give some sort of slowish UI perception to the user, and it's not a good thing at all. 在Android准则上,Google极力反对初始屏幕,因为初始屏幕会给用户带来某种缓慢的UI感知,这根本不是一件好事。

If you absolutely need to wait for some sort of data to finish loading/network query you can do it much more elegantly by letting the app load normally and give the user a loading indicator (eg SwipeToRefreshLayout from the v7 support lib). 如果您绝对需要等待某种数据来完成加载/网络查询,则可以通过让应用正常加载并为用户提供加载指示符(例如v7支持库中的SwipeToRefreshLayout)来做得更好。

Not actually answering your question but this is a much more elegant solution for a completely wrong approach for a good UX. 实际上并不能回答您的问题,但是对于完全错误的优质UX方法而言,这是一种更为优雅的解决方案。 The Animation.AnimationListener has a callback called onAnimationEnd where you can do whatever after the animation has finished. Animation.AnimationListener具有一个名为onAnimationEnd的回调,您可以在动画完成后执行任何操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM