简体   繁体   English

Android Alpha动画非常慢

[英]Android Alpha Animation Very Slow

I have an app that show a SurfaceView that shows a camera preview, and on top of that a couple other UI elements (buttons). 我有一个应用程序,显示一个显示相机预览的SurfaceView,并在其他几个UI元素(按钮)之上。 Basically, the user inputs their code, i FadeOut the UI leaving the normal preview and take a picture which is later uploaded. 基本上,用户输入他们的代码,我FadeOut UI离开正常预览并拍摄后来上传的图片。 This all worked fine on an older tablet, however, switching to an XPERIA Z2 tablet this thing became VERY SLOW when calling view.animate(); 这一切都在较旧的平板电脑上运行良好,但是,当调用view.animate()时,切换到XPERIA Z2平板电脑时这个东西变得非常慢。 I have noticed that the tablet starts OpenGL, (I didn't notice that on the old tablet). 我注意到平板电脑启动了OpenGL,(我没有注意到旧平板电脑上的情况)。

: EGL 1.4 QUALCOMM build: () OpenGL ES Shader Compiler Version: E031.24.00.06 Build Date: 02/12/14 Wed Local Branch: au090 Remote Branch: Local Patches: Reconstruct Branch: :EGL 1.4 QUALCOMM构建:()OpenGL ES着色器编译器版本:E031.24.00.06构建日期:02/12/14 Wed Local Branch:au090 Remote Branch:Local Patches:Reconstruct Branch:

Now this might be the problem. 现在这可能是问题所在。 How do I turn it off? 我该如何关闭它? I will paste the animation here anyway: 无论如何我会在这里粘贴动画:

public static Animation fadeOut() {

    Animation fadeOut = new AlphaAnimation(1, 0);

    fadeOut.setInterpolator(new DecelerateInterpolator()); //add this

    fadeOut.setDuration(500);

    return fadeOut;
}

Any ideas? 有任何想法吗?

Well, if anyone expiriences something like this, the problem was I was setting the animation on the view and then calling view.animate(). 好吧,如果有人经历了这样的事情,问题是我在视图上设置动画然后调用view.animate()。 Using view.startAnimation(Animation) is working allright! 使用view.startAnimation(动画)工作正常!

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

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