Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set AlphaAnimation on GLSurfaceView

Is there a way to set the animation on a GLSurfaceView to fade from fully Opaque to 0 alpha transparency? I have the following code which does nothing:

AlphaAnimation anim = new AlphaAnimation(1f, 0f);
anim.setDuration (5000);
anim.setFillAfter(true);
glSurfaceView.startAnimation(anim);

I understand a SurfaceView doesn't normally behave like a normal View object so is this the right way to go about this? Is there another better way? Is it possible at all?

like image 580
SamRowley Avatar asked Dec 06 '25 02:12

SamRowley


1 Answers

I know it's an old thread, but it's possible to fade in/out SurfaceView by placing blank view with black background on top of it. Then you just apply AlphaAnimation on this view.

like image 152
dop2000 Avatar answered Dec 08 '25 15:12

dop2000