diff cagou/core/common.py @ 322:e2b51663d8b8

core, android: new share widget + added Cagou to "share" menu: - new intent filter to add Cagou to share menu for all media types - minimum Kivy version is now 1.11.0 - new "Share" widget to display data to share via SàT and select the target - new core.platform_ module (the suffix "_" avoid trouble with standard "platform" module), for platform specific code. - Android intent are now checked on startup and "on_new_intent" events - if a android.intent.action.SEND action is received (i.e. some data is shared), the "Share" widget is shown - new Cagou.share method to share data using "Share" widget - new Cagou.getAncestorWidget method to easily retrieve an instance of a specific class in a widget's ancestors - ContactList's Avatar and ContactItem widgets have been moved to core.common
author Goffi <goffi@goffi.org>
date Fri, 06 Dec 2019 13:23:03 +0100
parents 772c170b47a9
children 38fd457b2158
line wrap: on
line diff
--- a/cagou/core/common.py	Fri Dec 06 13:23:03 2019 +0100
+++ b/cagou/core/common.py	Fri Dec 06 13:23:03 2019 +0100
@@ -25,6 +25,7 @@
 from kivy.uix.behaviors import ButtonBehavior
 from kivy.uix.behaviors import ToggleButtonBehavior
 from kivy.uix.boxlayout import BoxLayout
+from kivy.metrics import dp
 from cagou.core.constants import Const as C
 from kivy import properties
 from cagou import G
@@ -40,6 +41,17 @@
     pass
 
 
+class Avatar(Image):
+    pass
+
+
+class ContactItem(BoxLayout):
+    base_width = dp(150)
+    profile = properties.StringProperty()
+    data = properties.DictProperty()
+    jid = properties.StringProperty('')
+
+
 class JidItem(BoxLayout):
     bg_color = properties.ListProperty([0.2, 0.2, 0.2, 1])
     color = properties.ListProperty([1, 1, 1, 1])