Author Topic: Screen Size +FullScreen  (Read 3020 times)

Offline PaniX

  • byte
  • *
  • Posts: 18
    • View Profile
Screen Size +FullScreen
« on: September 20, 2013, 07:12:44 pm »
Two hopefully smaller questions, which aren't direct about JPCT-AE, but which may be helpful for others using the engine too.
1) How to get the screen size from the smartphone the user uses?
2) How to make the application full screen, without the status bar on the upper part of the screen?
Thanks!
« Last Edit: September 20, 2013, 08:06:15 pm by PaniX »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Screen Size +FullScreen
« Reply #1 on: September 20, 2013, 09:53:49 pm »
There might be other ways, but at least the onSurfaceChanged()-method will be called with the current dimensions.

About the status bar, i'm doing:

Code: [Select]
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().addFlags(LayoutParams.FLAG_FULLSCREEN);

Offline PaniX

  • byte
  • *
  • Posts: 18
    • View Profile
Re: Screen Size +FullScreen
« Reply #2 on: September 21, 2013, 07:01:57 am »
Hm, I've also found the method adding
Code: [Select]
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >to the Manifest...
Is it a good way?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Screen Size +FullScreen
« Reply #3 on: September 21, 2013, 05:17:45 pm »
That's fine too. I prefer code over XML but that's just me.

Offline PaniX

  • byte
  • *
  • Posts: 18
    • View Profile
Re: Screen Size +FullScreen
« Reply #4 on: September 21, 2013, 07:27:01 pm »
I don't like the XML that much, because it was confusing when I've started learning java on Android.