def on_size(self, instance, value): width, height = value self._orientation = "landscape" if width > height else "portrait" global inch if not inch: from kivy.metrics import inch self._ui_mode = "tablet" if min(width, height) > inch(3.51) else "phone" Logger.debug("orientation: {} ui_mode: {}".format(self._orientation, self._ui_mode))
def on_size(self, instance, value): width, height = value self._orientation = 'landscape' if width > height else 'portrait' global inch if not inch: from kivy.metrics import inch self._ui_mode = 'tablet' if min(width, height) > inch(3.51) else 'phone' Logger.debug('orientation: {} ui_mode: {}'.format(self._orientation, self._ui_mode))
def on_size(self, instance, value): width, height = value self._orientation = 'landscape' if width > height else 'portrait' self._ui_mode = 'tablet' if min(width, height) > inch(3.51) else 'phone'
def on_size(self, instance, value): width, height = value self._orientation = "landscape" if width > height else "portrait" self._ui_mode = "tablet" if min(width, height) > inch(3.51) else "phone"