I'm doing a Android LiveWallpaper with LibGDX and I want my application to start rendering below the notification bar, and not under it.
In the picture: Left is what I get, right what I want. Any advice? Thanks
Asked
Active
Viewed 370 times
3
-
2Is it not possible to get the height of the status bar, and add padding to the view accordingly? The answers to the following question might help: [Height of status bar](http://stackoverflow.com/questions/3355367/height-of-statusbar) – SamSPICA Jan 16 '14 at 06:05
-
are you using a static view port for all devices? – sandeep kundliya Jan 16 '14 at 06:39
-
@zappp do you have some issues with this again or why did you unaccept my answer? If you run into any issue please update your question and mybe someone can help you. Thanks – Robert P Mar 05 '14 at 09:29
1 Answers
2
You could use this: Height of Android statusbar
And simply draw under it. If you are using Worldunit based drawing (not Pixelbased) you can use this:
Gdx.gl.glViewport(x, statusbar.height, width, height);
To show you what this does look at this link: Keep aspect with black borders
-
-
It does help, but you can't actually get the height of status bar with the getWindow method because it's only for a Activity, on a LiveWallpaperService you need to do some tricky one. It's a good answer though. Thanks to you – zappp Mar 09 '14 at 23:04
-
If you tell me how to get the height of the status bar i can update the answer. – Robert P Mar 10 '14 at 06:56