Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fullscreen set to zero not working Android 15 #1877

Open
Fector101 opened this issue Dec 30, 2024 · 14 comments
Open

Fullscreen set to zero not working Android 15 #1877

Fector101 opened this issue Dec 30, 2024 · 14 comments

Comments

@Fector101
Copy link

Fector101 commented Dec 30, 2024

Versions

  • Python3
  • Built on Linux, for Android
  • Buildozer version -- latest

Description

Everything was working perfectly till I tested on Android 15 - the only problem I faced was when I set fullscreen = 0 the app still enters full screen mode

@kuzeyron
Copy link
Contributor

What's the results after running buildozer android clean and then rerun the compiler?

@Fector101
Copy link
Author

@kuzeyron
I got the same results, I even tired reverting to a previous commit i tested and ran
buildozer android clean && buildozer android debug
it scale right on other devices and but not on mine. It was working perfectly before i updated my phone here is what the structure of my code looks like the header and the bottom nav doesn't show completely

from kivy.core.window import Window
from kivy.properties import  StringProperty
from kivy.uix.behaviors import ButtonBehavior

from kivymd.app import MDApp
from kivymd.uix.behaviors import RectangularRippleBehavior
from kivymd.uix.screenmanager import MDScreenManager
from kivymd.uix.screen import MDScreen
from kivymd.uix.boxlayout import MDBoxLayout
from kivymd.uix.label import MDLabel
from kivymd.uix.label import MDIcon
from kivymd.uix.bottomsheet.bottomsheet import MDBottomSheet
from kivymd.uix.navigationdrawer import MDNavigationDrawer, MDNavigationLayout


class MyScreenTemplate(MDScreen):
    def __init__(self,**kwargs):
        super().__init__(**kwargs)
        header_box = MDBoxLayout(padding=[10,0,0,0],md_bg_color=[1,1,0,1],size_hint=[1,None],height='50sp',pos_hint={'top': 1})
        header_box.add_widget(MDLabel(text=self.name))
        self.add_widget(header_box)

class WindowManager(MDScreenManager):
    def __init__(self,**kwargs):
        super().__init__(**kwargs)
        self.size_hint_y=None
        self.height=Window.height-70
        self.pos_hint={'top': 1}
        self.md_bg_color=[1,1,0,1]
        self.add_widget(MyScreenTemplate(name='home', md_bg_color=[1,0,0,1]))
        self.add_widget(MyScreenTemplate(name='download', md_bg_color=[0,1,0,1]))
        self.add_widget(MyScreenTemplate(name='connection', md_bg_color=[0,0,1,1]))
    
class TabButton(RectangularRippleBehavior,ButtonBehavior,MDBoxLayout):
    text=StringProperty()
    icon=StringProperty()
    def __init__(self, **kwargs):
        super().__init__(**kwargs)
        self.orientation='vertical'
        self._radius=1
        self.size_hint=[None,1]
        self.width=Window.width/3
        self.add_widget(MDIcon(icon=self.icon, pos_hint={'center_x': 0.5}))
        self.add_widget(MDLabel(text=self.text, halign='center'))
    def on_release(self):
      screenmanager=MDApp.get_running_app()
      screenmanager.my_screen_manager.current=self.text

class BottomNavigationBar(MDNavigationDrawer):
    def __init__(self,**kwargs):
        super().__init__(**kwargs)
        self.size_hint =[ 1, None]
        self.height='70sp'
        self.drawer_type='standard'
        self.set_state('open')
        self.size_hint_y= None
        self.height='70sp'
        self.radius=0
        icons = ['home', 'download', 'connection']
        for index in range(len(icons)):
            btn = TabButton(icon=icons[index], text=icons[index])
            self.add_widget(btn)
class Laner(MDApp):
    def build(self):
        root_screen = MDScreen()
        nav_layout = MDNavigationLayout()
        
        self.my_screen_manager = WindowManager()
        bottom_navigation_bar = BottomNavigationBar()
        nav_layout.add_widget(self.my_screen_manager)
        nav_layout.add_widget(bottom_navigation_bar)
        nav_layout.add_widget(MDBottomSheet(sheet_type="standard"))
        
        root_screen.add_widget(nav_layout)
        return root_screen
if __name__ == '__main__':
    Laner().run()

And here's a copy of my buildozer.spec, sorry i forget the add this in the original question
buildozer.spec
Thanks in advance for taking a look—I really appreciate your help!

@kuzeyron
Copy link
Contributor

kuzeyron commented Jan 1, 2025

You could try setting p4a.branch = develop . And then just rm -rf .buildozer before you rerun the compiler.

@Fector101
Copy link
Author

You could try setting p4a.branch = develop . And then just rm -rf .buildozer before you rerun the compiler.

Thank you will try this now and get back to you

@Fector101
Copy link
Author

@kuzeyron sorry for the late reply, it's a little better now I can see through the android buttons but it's still entering fullscreen
Here's a picture of what i see
Screenshot_2025-01-01-16-51-23-653_org laner lan_ft

@kuzeyron
Copy link
Contributor

kuzeyron commented Jan 1, 2025

My guess is that this style is triggering something. So if you open up the file .../.buildozer/android/platform/python-for-android/pythonforandroid/bootstraps/sdl2/build/templates/AndroidManifest.tmpl.xml you should see on line 73, android:theme="@style/KivySupportCutout". If you delete that line and only run buildozer android clean and rerun the compiler, is it still behaving the same?

@Fector101
Copy link
Author

@kuzeyron This time the phone buttons aren't transparent anymore and the app is still taking full screen
Screenshot_2025-01-01-20-49-01-219_org.laner.lan_ft.jpg

@kuzeyron
Copy link
Contributor

kuzeyron commented Jan 2, 2025

Now that is how it should be

@Fector101
Copy link
Author

Fector101 commented Jan 2, 2025

Yeah, Please do you have any workarounds so it stops entering fullscreen

@kuzeyron
Copy link
Contributor

kuzeyron commented Jan 2, 2025

What do you expect? Can you share what other devices are showing?
Fullscreen means it uses 100% of the available size and it also hides the bars. When it's not set the size is between the bars and both bars are visible.

@Fector101
Copy link
Author

I expected when I set fullscreen=0 it won't enter fullscreen mode, This is what I wanted what it looks like on other android devices
IMG-20250102-WA0004

@kuzeyron
Copy link
Contributor

kuzeyron commented Jan 2, 2025

I now see a problem with your code:

 def build(self):
        root_screen = MDScreen()
        nav_layout = MDNavigationLayout()
        
        self.my_screen_manager = WindowManager()
        bottom_navigation_bar = BottomNavigationBar()
        nav_layout.add_widget(self.my_screen_manager)
        nav_layout.add_widget(bottom_navigation_bar)
        nav_layout.add_widget(MDBottomSheet(sheet_type="standard"))
        
        root_screen.add_widget(nav_layout)
        return root_screen
    You are returning MDScreen when it should be MDScreenManager.

@Fector101
Copy link
Author

I thought so too, tired putting the main screen in a MDScreenManager widget and returning that but still same results, 😓 I'm using this structure because I need a feature from kivymd MDBottomSheet and it depends on it

@kuzeyron
Copy link
Contributor

kuzeyron commented Jan 6, 2025

If you move everything to be inside of a ScrollView. Will that solve the sizing issue for you?
I assume MD is having fixed sizes and it doesn't fit on your device which encounter this problem.

Edit: By just lowering the font size should do the trick.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants