This commit is contained in:
yumoqing 2020-04-30 00:02:42 +08:00
parent 657616d49f
commit 053c131903
3 changed files with 14 additions and 0 deletions

View File

@ -67,6 +67,13 @@ if platform == 'android':
from .widgetExt.androidwebview import AWebView
from .widgetExt.camera import AndroidCamera
class WrapText(Label):
def __init__(self, **kw):
Label.__init__(self, **kw)
self.bind(width=lambda *x: self.setter('text_size')(self, (self.width, None)),
texture_size=lambda *x: self.setter('height')(self, self.texture_size[1]))
class Text(BGColorBehavior, Label):
def __init__(self,bgcolor=[],fgcolor=[],color_level=-1,**kw):
self.options = DictObject(**kw)

View File

@ -40,6 +40,7 @@ r('TextTree',TextTree)
r('PopupMenu',PopupMenu)
r('HostImage',HostImage)
r('APlayer',APlayer)
r('WrapText',WrapText)
if platform == 'android':
r('PhoneButton',PhoneButton)
r('AWebView',AWebView)

View File

@ -70,6 +70,12 @@ class SwipeBehavior(object):
self.dispatch('on_context_menu')
def check_swipe(self):
if not self.sb_end_point:
return
if not self.sb_start_point:
return
if abs(self.sb_end_point[0] - self.sb_start_point[0]) > \
abs(self.sb_end_point[1] - self.sb_start_point[1]):
Logger.info('SwipeBehavior:check_swipe x>y')