mirror of
https://github.com/markqvist/Sideband.git
synced 2025-09-28 22:59:41 -04:00
Included local plyer
This commit is contained in:
parent
25f0d52260
commit
f23855fb68
166 changed files with 15862 additions and 0 deletions
29
sbapp/plyer/platforms/android/call.py
Normal file
29
sbapp/plyer/platforms/android/call.py
Normal file
|
@ -0,0 +1,29 @@
|
|||
'''
|
||||
Android Call
|
||||
-----------
|
||||
'''
|
||||
|
||||
from jnius import autoclass
|
||||
from plyer.facades import Call
|
||||
from plyer.platforms.android import activity
|
||||
|
||||
Intent = autoclass('android.content.Intent')
|
||||
uri = autoclass('android.net.Uri')
|
||||
|
||||
|
||||
class AndroidCall(Call):
|
||||
|
||||
def _makecall(self, **kwargs):
|
||||
|
||||
intent = Intent(Intent.ACTION_CALL)
|
||||
tel = kwargs.get('tel')
|
||||
intent.setData(uri.parse("tel:{}".format(tel)))
|
||||
activity.startActivity(intent)
|
||||
|
||||
def _dialcall(self, **kwargs):
|
||||
intent_ = Intent(Intent.ACTION_DIAL)
|
||||
activity.startActivity(intent_)
|
||||
|
||||
|
||||
def instance():
|
||||
return AndroidCall()
|
Loading…
Add table
Add a link
Reference in a new issue