EGL, NativeActivity and statusbar size

73 views
Skip to first unread message

NoAngel

unread,
Jun 14, 2016, 10:50:58 AM6/14/16
to android-ndk
Hi,

I need to support show statusbar in my Android app.
It's NativeActivity, EGL context created using C++ API.

I tried to show status bar by getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
from Java onCreate() (part of my code is in Java, by class MyNativeActivity extends android.app.NativeActivity)
and via AndroidManifest.xml, setting android:theme="Theme.Holo".

Both methods worked, and statusbar is shown but I have a problem.
My EGL view is displayed under status bar, so user cannot see part of it.
I need to support show status bar all time app running.

How should I set my project or maybe need some code changes
to make EGL view displayed only in screen area not used by status bar,
without being overlapped?

Any hint will help a lot, Thanks!

NoAngel

unread,
Jun 15, 2016, 10:30:27 AM6/15/16
to android-ndk
Damn it!
Solved it by myself.

draw: OpenGL virtual screen height-=statusbar height
input: touchy-=statusbar height
Reply all
Reply to author
Forward
0 new messages