This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# utils.py file. | |
class Proxy(object): | |
... | |
def __init__(self, name, facade): | |
... | |
def _ensure_obj(self): | |
... | |
name = object.__getattribute__(self, '_name') | |
module = 'plyer.platforms.{}.{}'.format( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# __init__.py file. | |
from plyer import facades | |
from plyer.utils import Proxy | |
#: Accelerometer proxy to :class:`plyer.facades.Accelerometer` | |
accelerometer = Proxy('accelerometer', facades.Accelerometer) | |
#other features... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plyer import call | |
call.makecall('9997654321') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Text2SpeechDemo>: | |
BoxLayout: | |
orientation: 'vertical' | |
padding: 20 | |
TextInput: | |
id: notification_text | |
text: 'Put message here' | |
Button: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import kivy | |
kivy.require('1.8.0') | |
from kivy.app import App | |
from kivy.uix.boxlayout import BoxLayout | |
from kivy.uix.popup import Popup | |
from plyer import tts | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plyer import flash | |
flash.on() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plyer import battery | |
battery.status | |
// {'percentage': 82.0, 'isCharging': False} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from plyer import accelerometer | |
accelerometer.enable() | |
accelerometer.acceleration | |
//(-10.048464775085449, 6.825869083404541, 7.7260890007019043) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ProgressBar>: | |
canvas: | |
Color: | |
rgb: 1, 1, 1 | |
BorderImage: | |
border: (12, 12, 12, 12) | |
pos: self.x, self.center_y - 12 | |
size: self.width, 24 | |
source: 'atlas://textures/red-lightgrey/myatlas/progressbar_background' | |
BorderImage: |