diff --git a/kivyblocks/android_rotation.py b/kivyblocks/android_rotation.py index 194ad3c..5129531 100644 --- a/kivyblocks/android_rotation.py +++ b/kivyblocks/android_rotation.py @@ -1,11 +1,12 @@ from kivy.utils import platform import plyer try: - from android import activity - # from plyer.platforms.android import activity - # return rotation is 0 forever + # + # from android import activity + # get_rotation() failed module 'android.activity' has no attribute 'getWindowManager' + from plyer.platforms.android import activity except: - print('android_rotation.py:from android import activity ERROR') + print('android_rotation.py:mport ERROR') activity = None def get_rotation(): diff --git a/kivyblocks/twosides.py b/kivyblocks/twosides.py index 3ccbad3..f076236 100644 --- a/kivyblocks/twosides.py +++ b/kivyblocks/twosides.py @@ -100,6 +100,9 @@ class TwoSides(WidgetReady, BoxLayout): def on_size(self,*args): if self.width >= self.height: + print('twosides.py:W-Window.rotation=', + self.app.get_rotation(), + Window.size) if not self.landscape_widget in self.children: self.dispatch('on_beforeswitch_landscape') self.clear_widgets() @@ -110,7 +113,8 @@ class TwoSides(WidgetReady, BoxLayout): self.dispatch('on_afterswitch_landscape') self.panel_shape = 'landscape' else: - print('twosides.py:Window.rotation=', self.app.get_rotation(), + print('twosides.py:H-Window.rotation=', + self.app.get_rotation(), Window.size) if not self.portrait_widget in self.children: self.dispatch('on_beforeswitch_landscape')