__init__.py 392 B

1234567891011121314151617181920
  1. from kivy import platform
  2. __all__ = ('toast')
  3. _toast = None
  4. def _get_ref():
  5. global _toast
  6. if _toast is None:
  7. p = platform()
  8. if p == 'android':
  9. from androidtoast import toast
  10. else:
  11. from kivytoast import toast
  12. _toast = toast
  13. return _toast
  14. def toast(text, length_long=False):
  15. _get_ref()(text, length_long=length_long)