kivy android app set full screen using pyjnius

278 views
Skip to first unread message

Degenerate Tech

unread,
May 30, 2021, 11:51:19 AM5/30/21
to Kivy users support
i want to get full screen kivy android app .
i have added in build method in kivy.app class 
 please tell me how to solve? 
from jnius import autoclass, cast, JavaException


Window=autoclass('android.view.Window')
WindowManagerNLayoutParams= autoclass('android.view.WindowManager$LayoutParams')

mActivity.requestWindowFeature(Window.FEATURE_NO_TITLE)
mActivity.getWindow().setFlags(WindowManagerNLayoutParams.FLAG_FULLSCREEN, WindowManagerNLayoutParams.FLAG_FULLSCREEN)
    


error
File "jnius/jnius_export_class.pxi", line 769, in jnius.jnius.JavaMethod.__call__
05-30 21:16:28.559 16742 16742 I python  :    File "jnius/jnius_export_class.pxi", line 863, in jnius.jnius.JavaMethod.call_method
05-30 21:16:28.560 16742 16742 I python  :    File "jnius/jnius_utils.pxi", line 91, in jnius.jnius.check_exception
05-30 21:16:28.562 16742 16742 I python  :  jnius.jnius.JavaException: JVM exception occurred: requestFeature() must be called before adding content
05-30 21:16:28.570 16742 16849 I python  : [INFO   ] [GL          ] NPOT texture support is available
05-30 21:16:28.571 16742 16742 I python  : can write

Robert

unread,
May 30, 2021, 1:07:08 PM5/30/21
to Kivy users support

Degenerate Tech

unread,
May 30, 2021, 2:22:31 PM5/30/21
to Kivy users support
yes it is doing full screen but status hiding.

@run_on_ui_thread
def set_full_screen():
    #mActivity.requestWindowFeature(Window.FEATURE_NO_TITLE)
    #mActivity.getWindow().setFlags(WindowManagerNLayoutParams.FLAG_FULLSCREEN, WindowManagerNLayoutParams.FLAG_FULLSCREEN)
    #Window.setContentView(mActivity)
    print("screen ###############")
    mActivity.getWindow().getDecorView().setSystemUiVisibility( View.SYSTEM_UI_FLAG_LAYOUT_STABLE
                   |View.SYSTEM_UI_FLAG_FULLSCREEN 
                   |View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN 
                   | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY  
                   | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
                   | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION)
    


Degenerate Tech

unread,
May 30, 2021, 2:51:04 PM5/30/21
to Kivy users support
but status bar not hiding .

Degenerate Tech

unread,
May 30, 2021, 3:19:51 PM5/30/21
to Kivy users support
see top portion .. Android status bar blocking Kivy UI 

--
You received this message because you are subscribed to a topic in the Google Groups "Kivy users support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/kivy-users/DQ2zZ8yjvM4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/cdf56429-ac06-4d17-b5a5-2d0295b01c84n%40googlegroups.com.
Screenshot_20210531-004740.jpg

Robert

unread,
May 30, 2021, 5:01:48 PM5/30/21
to Kivy users support

Degenerate Tech

unread,
May 30, 2021, 5:49:25 PM5/30/21
to Kivy users support
As you did in layoutx .I did same thing .but Kivy app starting with full screen mode but status bar not hiding .

Reply all
Reply to author
Forward
0 new messages