This commit is contained in:
yumoqing 2020-07-12 08:54:13 +08:00
parent 08f34c65e7
commit 89e0868a88

View File

@ -6,6 +6,8 @@ from kivy.uix.button import Button, ButtonBehavior
from kivy.uix.accordion import Accordion,AccordionItem from kivy.uix.accordion import Accordion,AccordionItem
from kivy.uix.label import Label from kivy.uix.label import Label
from kivy.event import EventDispatcher from kivy.event import EventDispatcher
from kivy.metrics import dp
from kivy.core.window import Window
from kivy.uix.actionbar import ActionBar,ActionView,ActionPrevious,ActionItem,ActionButton from kivy.uix.actionbar import ActionBar,ActionView,ActionPrevious,ActionItem,ActionButton
from kivy.uix.actionbar import ActionToggleButton, ActionCheck,ActionSeparator,ActionGroup from kivy.uix.actionbar import ActionToggleButton, ActionCheck,ActionSeparator,ActionGroup
@ -192,3 +194,11 @@ def getDataHandler(url,**kwargs):
return FILEDataHandler(url,**kwargs) return FILEDataHandler(url,**kwargs)
return HTTPDataHandler(url, **kwaegs) return HTTPDataHandler(url, **kwaegs)
def device_type():
if platform != "android" and platform != "ios":
return "desktop"
elif Window.width >= dp(600) and Window.height >= dp(600):
return "tablet"
else:
return "mobile"