开发者

On Android emulator (hw too?) an Activity style with backgroundDimEnabled also dims GLSurfaceView output

It seems that the emulator is treating GLSurfaceView renderered output the same as the background wallpaper when the backgroundDimEnabled style option is set, dimming them both when it should, if I understand correctly, only dim the wallpaper.

I have a RelativeLayout, whose first child extends GLSurfaceView, that gets expanded in an Activity with the following style:

   <item name="android:backgroundDimEnabled">true</item>

I used to omit the backgroundDimEnabled and set the opengl background clear color to 0x8000 to dim the wallpaper background, which works well, but I didn't like the hard edge between the faded activity and the unfaded wallpaper I would see when the activity slides into and o开发者_如何学Gout of view.

The problem is that when I set the opengl clear color to all 0 and add the "android:backgroundDimEnabled" the foreground native ui elements are displayed correctly but the opengl output is dimmed along with the wallpaper. If I go back and change backgroundDimEnabled to false or remove it, the opengl output is at full brightness, but if I ever turn it back on, rendered output is dimmed. The only difference is that style property.

I'm hoping someone knows if this behavior is specific to the emulator, every version from 2.1-3.0.

I haven't tried yet on physical hardware, maybe someone has an idea?

Thanks David


It's possible your issue could be solved by the solution presented here:

https://groups.google.com/forum/#!topic/android-developers/0OAFIb2ww2I

The developer in that post called:

setZOrderOnTop(true);

on his GL surface view.

I had the same issue as you, a surface view being "dimmed out", and his solution worked for me.


I can confirm that the problem exists on an HTC Desire running CM7 (Android 2.3). I've starred your bug report, but it seems that there is only three people in the world with this problem :/

You've probably moved on anyways, but let this be a warning to others before they look for bugs in their own code.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜