android-notify 1.60.4.dev0__tar.gz → 1.60.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/PKG-INFO +88 -18
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/README.md +87 -17
- android_notify-1.60.5/android_notify/an_types.py +328 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify/an_utils.py +68 -17
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify/config.py +74 -43
- android_notify-1.60.5/android_notify/core.py +240 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify/sword.py +197 -165
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify.egg-info/PKG-INFO +88 -18
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify.egg-info/SOURCES.txt +0 -2
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/pyproject.toml +1 -4
- android_notify-1.60.4.dev0/android_notify/an_types.py +0 -251
- android_notify-1.60.4.dev0/android_notify/core.py +0 -211
- android_notify-1.60.4.dev0/android_notify/fallback-icons/flet-appicon.png +0 -0
- android_notify-1.60.4.dev0/android_notify/fallback-icons/pydroid3-appicon.png +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify/__init__.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify/__main__.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify/base.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify/styles.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify.egg-info/dependency_links.txt +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify.egg-info/entry_points.txt +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify.egg-info/requires.txt +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/android_notify.egg-info/top_level.txt +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/examples/flet-working/src/core.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/examples/flet-working/src/main.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/tests/flet/adv/main.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/tests/flet/adv/tests/__init__.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/tests/flet/adv/tests/test_android_notify_full.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/tests/flet/basic/src/core.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/tests/flet/basic/src/main.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/docs/website/src/pages/data/laner_Sent.py +0 -0
- {android_notify-1.60.4.dev0 → android_notify-1.60.5}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: android-notify
|
|
3
|
-
Version: 1.60.
|
|
3
|
+
Version: 1.60.5
|
|
4
4
|
Summary: A Python package that simplifies creating Android notifications in Kivy and Flet apps.
|
|
5
5
|
Author-email: Fabian <fector101@yahoo.com>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -79,32 +79,81 @@ In your **`buildozer.spec`** file, ensure you include the following:
|
|
|
79
79
|
|
|
80
80
|
```ini
|
|
81
81
|
# Add pyjnius so ensure it's packaged with the build
|
|
82
|
-
requirements = python3, kivy, pyjnius, android-notify
|
|
82
|
+
requirements = python3, kivy, pyjnius, android-notify
|
|
83
83
|
# Add permission for notifications
|
|
84
84
|
android.permissions = POST_NOTIFICATIONS
|
|
85
|
+
|
|
86
|
+
# Required dependencies (write exactly as shown, no quotation marks)
|
|
87
|
+
android.gradle_dependencies = androidx.core:core:1.6.0, androidx.core:core-ktx:1.15.0
|
|
88
|
+
android.enable_androidx = True
|
|
89
|
+
android.api = 35
|
|
85
90
|
```
|
|
86
91
|
|
|
87
92
|
### Flet apps:
|
|
88
|
-
|
|
89
|
-
In your `pyproject.toml` file, ensure you include the following:
|
|
90
|
-
|
|
93
|
+
In your `pyproject.toml` file, ensure you include the following:
|
|
91
94
|
```toml
|
|
92
95
|
[tool.flet.android]
|
|
93
96
|
dependencies = [
|
|
94
|
-
"pyjnius","android-notify==1.60.
|
|
97
|
+
"pyjnius","android-notify==1.60.5.dev0"
|
|
95
98
|
]
|
|
96
99
|
|
|
97
100
|
[tool.flet.android.permission]
|
|
98
101
|
"android.permission.POST_NOTIFICATIONS" = true
|
|
99
102
|
```
|
|
103
|
+
- example of [complete flet pyproject.toml](https://github.com/Fector101/flet-app/blob/main/pyproject.toml)
|
|
104
|
+
------
|
|
105
|
+
## Installing without Androidx
|
|
106
|
+
How to use without `gradle_dependencies`
|
|
107
|
+
Use `android-notify==1.60.5.dev0` to install via `pip`
|
|
108
|
+
### In Kivy
|
|
109
|
+
```ini
|
|
110
|
+
# buildozer.spec
|
|
111
|
+
requirements = python3, kivy, pyjnius, android-notify==1.60.5.dev0
|
|
112
|
+
```
|
|
100
113
|
|
|
101
|
-
### Pydroid 3
|
|
102
|
-
|
|
103
|
-
- In pip section where you're asked to insert `Libary name` paste `android-notify==1.60.
|
|
104
|
-
|
|
114
|
+
### On Pydroid 3
|
|
115
|
+
On the [pydroid 3](https://play.google.com/store/apps/details?id=ru.iiec.pydroid3) mobile app for running python code you can test some features.
|
|
116
|
+
- In pip section where you're asked to insert `Libary name` paste `android-notify==1.60.5.dev0`
|
|
117
|
+
- Minimal working example
|
|
118
|
+
```py
|
|
119
|
+
# Testing with `android-notify==1.60.5.dev0` on pydroid
|
|
120
|
+
from kivy.app import App
|
|
121
|
+
from kivy.uix.boxlayout import BoxLayout
|
|
122
|
+
from kivy.uix.button import Button
|
|
123
|
+
from android_notify import Notification
|
|
124
|
+
from android_notify.core import asks_permission_if_needed
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class AndroidNotifyDemoApp(App):
|
|
128
|
+
def build(self):
|
|
129
|
+
layout = BoxLayout(orientation='vertical', spacing=10, padding=20)
|
|
130
|
+
layout.add_widget(Button(
|
|
131
|
+
text="Ask Notification Permission",
|
|
132
|
+
on_release=self.request_permission
|
|
133
|
+
))
|
|
134
|
+
layout.add_widget(Button(
|
|
135
|
+
text="Send Notification",
|
|
136
|
+
on_release=self.send_notification
|
|
137
|
+
))
|
|
138
|
+
return layout
|
|
139
|
+
|
|
140
|
+
def request_permission(self, *args):
|
|
141
|
+
asks_permission_if_needed(no_androidx=True)
|
|
142
|
+
|
|
143
|
+
def send_notification(self, *args):
|
|
144
|
+
Notification(
|
|
145
|
+
title="Hello from Android Notify",
|
|
146
|
+
message="This is a basic notification.",
|
|
147
|
+
channel_id="android_notify_demo",
|
|
148
|
+
channel_name="Android Notify Demo"
|
|
149
|
+
).send()
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
if __name__ == "__main__":
|
|
153
|
+
AndroidNotifyDemoApp().run()
|
|
154
|
+
```
|
|
105
155
|
|
|
106
|
-
|
|
107
|
-
Can be installed via `pip` For testing purposes:
|
|
156
|
+
For IDE IntelliSense Can be installed via `pip install`:
|
|
108
157
|
|
|
109
158
|
```bash
|
|
110
159
|
pip install android_notify
|
|
@@ -113,7 +162,7 @@ android-notify -v
|
|
|
113
162
|
|
|
114
163
|
## Documentation
|
|
115
164
|
For Dev Version use
|
|
116
|
-
```requirements = python3, kivy, pyjnius, https://github.com/Fector101/android_notify/archive/
|
|
165
|
+
```requirements = python3, kivy, pyjnius, https://github.com/Fector101/android_notify/archive/main.zip```
|
|
117
166
|
|
|
118
167
|
|
|
119
168
|
To use colored text in your notifications:
|
|
@@ -121,13 +170,34 @@ To use colored text in your notifications:
|
|
|
121
170
|
Lastly in your `buildozer.spec` file
|
|
122
171
|
- Add `source.include_exts = xml` and `android.add_resources = ./res`
|
|
123
172
|
|
|
173
|
+
To use Custom Sounds
|
|
174
|
+
- Put audio files in `res/raw` folder,
|
|
175
|
+
- Then from `buildozer.spec` point to res folder `android.add_resources = res`
|
|
176
|
+
- and includes it's format `source.include_exts = wav`.
|
|
177
|
+
|
|
178
|
+
Lastly From the code
|
|
179
|
+
```py
|
|
180
|
+
# Create a custom notification channel with a unique sound resource for android 8+
|
|
181
|
+
Notification.createChannel(
|
|
182
|
+
id="weird_sound_tester",
|
|
183
|
+
name="Weird Sound Tester",
|
|
184
|
+
description="A test channel used to verify custom notification sounds from the res/raw folder.",
|
|
185
|
+
res_sound_name="sneeze" # file name without .wav or .mp3
|
|
186
|
+
)
|
|
187
|
+
|
|
188
|
+
# Send a notification through the created channel
|
|
189
|
+
n=Notification(
|
|
190
|
+
title="Custom Sound Notification",
|
|
191
|
+
message="This tests playback of a custom sound (sneeze.wav) stored in res/raw.",
|
|
192
|
+
channel_id="weird_sound_tester" # important tells notification to use right channel
|
|
193
|
+
)
|
|
194
|
+
n.setSound("sneeze")# for android 7 below
|
|
195
|
+
n.send()
|
|
196
|
+
```
|
|
124
197
|
For full documentation, examples, and advanced usage, API reference visit the
|
|
125
198
|
[documentation](https://android-notify.vercel.app)
|
|
126
199
|
|
|
127
200
|
## ☕ Support the Project
|
|
128
201
|
|
|
129
|
-
If you find this project helpful,
|
|
130
|
-
|
|
131
|
-
<a href="https://www.buymeacoffee.com/fector101" target="_blank">
|
|
132
|
-
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
|
|
133
|
-
</a>
|
|
202
|
+
If you find this project helpful, any support would help me continue working on open-source projects. I’m currently saving for a laptop to keep developing.
|
|
203
|
+
[donate](https://www.buymeacoffee.com/fector101)
|
|
@@ -56,32 +56,81 @@ In your **`buildozer.spec`** file, ensure you include the following:
|
|
|
56
56
|
|
|
57
57
|
```ini
|
|
58
58
|
# Add pyjnius so ensure it's packaged with the build
|
|
59
|
-
requirements = python3, kivy, pyjnius, android-notify
|
|
59
|
+
requirements = python3, kivy, pyjnius, android-notify
|
|
60
60
|
# Add permission for notifications
|
|
61
61
|
android.permissions = POST_NOTIFICATIONS
|
|
62
|
+
|
|
63
|
+
# Required dependencies (write exactly as shown, no quotation marks)
|
|
64
|
+
android.gradle_dependencies = androidx.core:core:1.6.0, androidx.core:core-ktx:1.15.0
|
|
65
|
+
android.enable_androidx = True
|
|
66
|
+
android.api = 35
|
|
62
67
|
```
|
|
63
68
|
|
|
64
69
|
### Flet apps:
|
|
65
|
-
|
|
66
|
-
In your `pyproject.toml` file, ensure you include the following:
|
|
67
|
-
|
|
70
|
+
In your `pyproject.toml` file, ensure you include the following:
|
|
68
71
|
```toml
|
|
69
72
|
[tool.flet.android]
|
|
70
73
|
dependencies = [
|
|
71
|
-
"pyjnius","android-notify==1.60.
|
|
74
|
+
"pyjnius","android-notify==1.60.5.dev0"
|
|
72
75
|
]
|
|
73
76
|
|
|
74
77
|
[tool.flet.android.permission]
|
|
75
78
|
"android.permission.POST_NOTIFICATIONS" = true
|
|
76
79
|
```
|
|
80
|
+
- example of [complete flet pyproject.toml](https://github.com/Fector101/flet-app/blob/main/pyproject.toml)
|
|
81
|
+
------
|
|
82
|
+
## Installing without Androidx
|
|
83
|
+
How to use without `gradle_dependencies`
|
|
84
|
+
Use `android-notify==1.60.5.dev0` to install via `pip`
|
|
85
|
+
### In Kivy
|
|
86
|
+
```ini
|
|
87
|
+
# buildozer.spec
|
|
88
|
+
requirements = python3, kivy, pyjnius, android-notify==1.60.5.dev0
|
|
89
|
+
```
|
|
77
90
|
|
|
78
|
-
### Pydroid 3
|
|
79
|
-
|
|
80
|
-
- In pip section where you're asked to insert `Libary name` paste `android-notify==1.60.
|
|
81
|
-
|
|
91
|
+
### On Pydroid 3
|
|
92
|
+
On the [pydroid 3](https://play.google.com/store/apps/details?id=ru.iiec.pydroid3) mobile app for running python code you can test some features.
|
|
93
|
+
- In pip section where you're asked to insert `Libary name` paste `android-notify==1.60.5.dev0`
|
|
94
|
+
- Minimal working example
|
|
95
|
+
```py
|
|
96
|
+
# Testing with `android-notify==1.60.5.dev0` on pydroid
|
|
97
|
+
from kivy.app import App
|
|
98
|
+
from kivy.uix.boxlayout import BoxLayout
|
|
99
|
+
from kivy.uix.button import Button
|
|
100
|
+
from android_notify import Notification
|
|
101
|
+
from android_notify.core import asks_permission_if_needed
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
class AndroidNotifyDemoApp(App):
|
|
105
|
+
def build(self):
|
|
106
|
+
layout = BoxLayout(orientation='vertical', spacing=10, padding=20)
|
|
107
|
+
layout.add_widget(Button(
|
|
108
|
+
text="Ask Notification Permission",
|
|
109
|
+
on_release=self.request_permission
|
|
110
|
+
))
|
|
111
|
+
layout.add_widget(Button(
|
|
112
|
+
text="Send Notification",
|
|
113
|
+
on_release=self.send_notification
|
|
114
|
+
))
|
|
115
|
+
return layout
|
|
116
|
+
|
|
117
|
+
def request_permission(self, *args):
|
|
118
|
+
asks_permission_if_needed(no_androidx=True)
|
|
119
|
+
|
|
120
|
+
def send_notification(self, *args):
|
|
121
|
+
Notification(
|
|
122
|
+
title="Hello from Android Notify",
|
|
123
|
+
message="This is a basic notification.",
|
|
124
|
+
channel_id="android_notify_demo",
|
|
125
|
+
channel_name="Android Notify Demo"
|
|
126
|
+
).send()
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
if __name__ == "__main__":
|
|
130
|
+
AndroidNotifyDemoApp().run()
|
|
131
|
+
```
|
|
82
132
|
|
|
83
|
-
|
|
84
|
-
Can be installed via `pip` For testing purposes:
|
|
133
|
+
For IDE IntelliSense Can be installed via `pip install`:
|
|
85
134
|
|
|
86
135
|
```bash
|
|
87
136
|
pip install android_notify
|
|
@@ -90,7 +139,7 @@ android-notify -v
|
|
|
90
139
|
|
|
91
140
|
## Documentation
|
|
92
141
|
For Dev Version use
|
|
93
|
-
```requirements = python3, kivy, pyjnius, https://github.com/Fector101/android_notify/archive/
|
|
142
|
+
```requirements = python3, kivy, pyjnius, https://github.com/Fector101/android_notify/archive/main.zip```
|
|
94
143
|
|
|
95
144
|
|
|
96
145
|
To use colored text in your notifications:
|
|
@@ -98,13 +147,34 @@ To use colored text in your notifications:
|
|
|
98
147
|
Lastly in your `buildozer.spec` file
|
|
99
148
|
- Add `source.include_exts = xml` and `android.add_resources = ./res`
|
|
100
149
|
|
|
150
|
+
To use Custom Sounds
|
|
151
|
+
- Put audio files in `res/raw` folder,
|
|
152
|
+
- Then from `buildozer.spec` point to res folder `android.add_resources = res`
|
|
153
|
+
- and includes it's format `source.include_exts = wav`.
|
|
154
|
+
|
|
155
|
+
Lastly From the code
|
|
156
|
+
```py
|
|
157
|
+
# Create a custom notification channel with a unique sound resource for android 8+
|
|
158
|
+
Notification.createChannel(
|
|
159
|
+
id="weird_sound_tester",
|
|
160
|
+
name="Weird Sound Tester",
|
|
161
|
+
description="A test channel used to verify custom notification sounds from the res/raw folder.",
|
|
162
|
+
res_sound_name="sneeze" # file name without .wav or .mp3
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
# Send a notification through the created channel
|
|
166
|
+
n=Notification(
|
|
167
|
+
title="Custom Sound Notification",
|
|
168
|
+
message="This tests playback of a custom sound (sneeze.wav) stored in res/raw.",
|
|
169
|
+
channel_id="weird_sound_tester" # important tells notification to use right channel
|
|
170
|
+
)
|
|
171
|
+
n.setSound("sneeze")# for android 7 below
|
|
172
|
+
n.send()
|
|
173
|
+
```
|
|
101
174
|
For full documentation, examples, and advanced usage, API reference visit the
|
|
102
175
|
[documentation](https://android-notify.vercel.app)
|
|
103
176
|
|
|
104
177
|
## ☕ Support the Project
|
|
105
178
|
|
|
106
|
-
If you find this project helpful,
|
|
107
|
-
|
|
108
|
-
<a href="https://www.buymeacoffee.com/fector101" target="_blank">
|
|
109
|
-
<img src="https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png" alt="Buy Me A Coffee" height="60">
|
|
110
|
-
</a>
|
|
179
|
+
If you find this project helpful, any support would help me continue working on open-source projects. I’m currently saving for a laptop to keep developing.
|
|
180
|
+
[donate](https://www.buymeacoffee.com/fector101)
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
"""For autocomplete Storing Reference to Available Methods"""
|
|
2
|
+
from typing import Literal
|
|
3
|
+
|
|
4
|
+
Importance = Literal['urgent', 'high', 'medium', 'low', 'none']
|
|
5
|
+
"""
|
|
6
|
+
:argument urgent - Makes a sound and appears as a heads-up notification.
|
|
7
|
+
|
|
8
|
+
:argument high - Makes a sound.
|
|
9
|
+
|
|
10
|
+
:argument urgent - Makes no sound.
|
|
11
|
+
|
|
12
|
+
:argument urgent - Makes no sound and doesn't appear in the status bar.
|
|
13
|
+
|
|
14
|
+
:argument urgent - Makes no sound and doesn't in the status bar or shade.
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# For Dev
|
|
19
|
+
# Idea for typing autocompletion and reference
|
|
20
|
+
class Bundle:
|
|
21
|
+
def putString(self, key, value):
|
|
22
|
+
print(f"[MOCK] Bundle.putString called with key={key}, value={value}")
|
|
23
|
+
|
|
24
|
+
def putInt(self, key, value):
|
|
25
|
+
print(f"[MOCK] Bundle.putInt called with key={key}, value={value}")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class String(str):
|
|
29
|
+
def __new__(cls, value):
|
|
30
|
+
print(f"[MOCK] String created with value={value}")
|
|
31
|
+
return str.__new__(cls, value)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class Intent:
|
|
35
|
+
FLAG_ACTIVITY_NEW_TASK = 'FACADE_FLAG_ACTIVITY_NEW_TASK'
|
|
36
|
+
CATEGORY_DEFAULT = 'FACADE_FLAG_CATEGORY_DEFAULT'
|
|
37
|
+
|
|
38
|
+
def __init__(self, context='', activity=''):
|
|
39
|
+
self.obj = {}
|
|
40
|
+
print(f"[MOCK] Intent initialized with context={context}, activity={activity}")
|
|
41
|
+
|
|
42
|
+
def setAction(self, action):
|
|
43
|
+
print(f"[MOCK] Intent.setAction called with: {action}")
|
|
44
|
+
return self
|
|
45
|
+
|
|
46
|
+
def addFlags(self, *flags):
|
|
47
|
+
print(f"[MOCK] Intent.addFlags called with: {flags}")
|
|
48
|
+
return self
|
|
49
|
+
|
|
50
|
+
def setData(self, uri):
|
|
51
|
+
print(f"[MOCK] Intent.setData called with: {uri}")
|
|
52
|
+
return self
|
|
53
|
+
|
|
54
|
+
def setFlags(self, intent_flag):
|
|
55
|
+
print(f"[MOCK] Intent.setFlags called with: {intent_flag}")
|
|
56
|
+
return self
|
|
57
|
+
|
|
58
|
+
def addCategory(self, intent_category):
|
|
59
|
+
print(f"[MOCK] Intent.addCategory called with: {intent_category}")
|
|
60
|
+
return self
|
|
61
|
+
|
|
62
|
+
def getAction(self):
|
|
63
|
+
print("[MOCK] Intent.getAction called")
|
|
64
|
+
return self
|
|
65
|
+
|
|
66
|
+
def getStringExtra(self, key):
|
|
67
|
+
print(f"[MOCK] Intent.getStringExtra called with key={key}")
|
|
68
|
+
return self
|
|
69
|
+
|
|
70
|
+
def putExtra(self, key, value):
|
|
71
|
+
self.obj[key] = value
|
|
72
|
+
print(f"[MOCK] Intent.putExtra called with key={key}, value={value}")
|
|
73
|
+
|
|
74
|
+
def putExtras(self, bundle: Bundle):
|
|
75
|
+
self.obj['bundle'] = bundle
|
|
76
|
+
print(f"[MOCK] Intent.putExtras called with bundle={bundle}")
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
class PendingIntent:
|
|
80
|
+
FLAG_IMMUTABLE = ''
|
|
81
|
+
FLAG_UPDATE_CURRENT = ''
|
|
82
|
+
|
|
83
|
+
def getActivity(self, context, value, action_intent, pending_intent_type):
|
|
84
|
+
print(
|
|
85
|
+
f"[MOCK] PendingIntent.getActivity called with context={context}, value={value}, action_intent={action_intent}, type={pending_intent_type}")
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
class BitmapFactory:
|
|
89
|
+
def decodeStream(self, stream):
|
|
90
|
+
print(f"[MOCK] BitmapFactory.decodeStream called with stream={stream}")
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
class BuildVersion:
|
|
94
|
+
SDK_INT = 0
|
|
95
|
+
|
|
96
|
+
class Manifest:
|
|
97
|
+
POST_NOTIFICATIONS = 'FACADE_IMPORT'
|
|
98
|
+
|
|
99
|
+
class Settings:
|
|
100
|
+
ACTION_APP_NOTIFICATION_SETTINGS = 'FACADE_IMPORT_ACTION_APP_NOTIFICATION_SETTINGS'
|
|
101
|
+
EXTRA_APP_PACKAGE = 'FACADE_IMPORT_EXTRA_APP_PACKAGE'
|
|
102
|
+
ACTION_APPLICATION_DETAILS_SETTINGS = 'FACADE_IMPORT_ACTION_APPLICATION_DETAILS_SETTINGS'
|
|
103
|
+
|
|
104
|
+
class Uri:
|
|
105
|
+
def __init__(self,package_name):
|
|
106
|
+
print("FACADE_URI")
|
|
107
|
+
|
|
108
|
+
class NotificationManager:
|
|
109
|
+
pass
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
class NotificationChannel:
|
|
113
|
+
def __init__(self, channel_id, channel_name, importance):
|
|
114
|
+
self.description = None
|
|
115
|
+
self.channel_id = channel_id
|
|
116
|
+
self.channel = None
|
|
117
|
+
print(
|
|
118
|
+
f"[MOCK] NotificationChannel initialized with id={channel_id}, name={channel_name}, importance={importance}")
|
|
119
|
+
|
|
120
|
+
def createNotificationChannel(self, channel):
|
|
121
|
+
self.channel = channel
|
|
122
|
+
print(f"[MOCK] NotificationChannel.createNotificationChannel called with channel={channel}")
|
|
123
|
+
|
|
124
|
+
def getNotificationChannel(self, channel_id):
|
|
125
|
+
self.channel_id = channel_id
|
|
126
|
+
print(f"[MOCK] NotificationChannel.getNotificationChannel called with id={channel_id}")
|
|
127
|
+
|
|
128
|
+
def setDescription(self, description):
|
|
129
|
+
self.description = description
|
|
130
|
+
print(f"[MOCK] NotificationChannel.setDescription called with description={description}")
|
|
131
|
+
|
|
132
|
+
def getId(self):
|
|
133
|
+
print(f"[MOCK] NotificationChannel.getId called, returning {self.channel_id}")
|
|
134
|
+
return self.channel_id
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class IconCompat:
|
|
138
|
+
def createWithBitmap(self, bitmap):
|
|
139
|
+
print(f"[MOCK] IconCompat.createWithBitmap called with bitmap={bitmap}")
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
class Color:
|
|
143
|
+
def __init__(self):
|
|
144
|
+
print("[MOCK] Color initialized")
|
|
145
|
+
|
|
146
|
+
def parseColor(self, color: str):
|
|
147
|
+
print(f"[MOCK] Color.parseColor called with color={color}")
|
|
148
|
+
return self
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
class RemoteViews:
|
|
152
|
+
def __init__(self, package_name, small_layout_id):
|
|
153
|
+
print(f"[MOCK] RemoteViews initialized with package_name={package_name}, layout_id={small_layout_id}")
|
|
154
|
+
|
|
155
|
+
def createWithBitmap(self, bitmap):
|
|
156
|
+
print(f"[MOCK] RemoteViews.createWithBitmap called with bitmap={bitmap}")
|
|
157
|
+
|
|
158
|
+
def setTextViewText(self, id, text):
|
|
159
|
+
print(f"[MOCK] RemoteViews.setTextViewText called with id={id}, text={text}")
|
|
160
|
+
|
|
161
|
+
def setTextColor(self, id, color: Color):
|
|
162
|
+
print(f"[MOCK] RemoteViews.setTextColor called with id={id}, color={color}")
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
class NotificationManagerCompat:
|
|
166
|
+
IMPORTANCE_HIGH = 4
|
|
167
|
+
IMPORTANCE_DEFAULT = 3
|
|
168
|
+
IMPORTANCE_LOW = ''
|
|
169
|
+
IMPORTANCE_MIN = ''
|
|
170
|
+
IMPORTANCE_NONE = ''
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
class NotificationCompat:
|
|
174
|
+
DEFAULT_ALL = 3
|
|
175
|
+
PRIORITY_HIGH = 4
|
|
176
|
+
PRIORITY_DEFAULT = ''
|
|
177
|
+
PRIORITY_LOW = ''
|
|
178
|
+
PRIORITY_MIN = ''
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
class MActions:
|
|
182
|
+
def clear(self):
|
|
183
|
+
"""This Removes all buttons"""
|
|
184
|
+
print('[MOCK] MActions.clear called')
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class NotificationCompatBuilder:
|
|
188
|
+
def __init__(self, context, channel_id):
|
|
189
|
+
self.mActions = MActions()
|
|
190
|
+
pass
|
|
191
|
+
def setProgress(self,max_value,current_value,endless):
|
|
192
|
+
pass
|
|
193
|
+
def setStyle(self,style):
|
|
194
|
+
pass
|
|
195
|
+
def setContentTitle(self,title):
|
|
196
|
+
pass
|
|
197
|
+
def setContentText(self,text):
|
|
198
|
+
pass
|
|
199
|
+
|
|
200
|
+
def setSmallIcon(self, icon):
|
|
201
|
+
print(f"[MOCK] setSmallIcon called with icon={icon}")
|
|
202
|
+
|
|
203
|
+
def setLargeIcon(self, icon):
|
|
204
|
+
print(f"[MOCK] setLargeIcon called with icon={icon}")
|
|
205
|
+
|
|
206
|
+
def setAutoCancel(self, auto_cancel: bool):
|
|
207
|
+
print(f"[MOCK] setAutoCancel called with auto_cancel={auto_cancel}")
|
|
208
|
+
|
|
209
|
+
def setPriority(self, priority: Importance):
|
|
210
|
+
print(f"[MOCK] setPriority called with priority={priority}")
|
|
211
|
+
|
|
212
|
+
def setDefaults(self, defaults):
|
|
213
|
+
print(f"[MOCK] setDefaults called with defaults={defaults}")
|
|
214
|
+
|
|
215
|
+
def setOngoing(self, persistent: bool):
|
|
216
|
+
print(f"[MOCK] setOngoing called with persistent={persistent}")
|
|
217
|
+
|
|
218
|
+
def setOnlyAlertOnce(self, state):
|
|
219
|
+
print(f"[MOCK] setOnlyAlertOnce called with state={state}")
|
|
220
|
+
|
|
221
|
+
def build(self):
|
|
222
|
+
print("[MOCK] build called")
|
|
223
|
+
|
|
224
|
+
def setContentIntent(self, pending_action_intent: PendingIntent):
|
|
225
|
+
print(f"[MOCK] setContentIntent called with {pending_action_intent}")
|
|
226
|
+
|
|
227
|
+
def addAction(self, icon_int, action_text, pending_action_intent):
|
|
228
|
+
print(f"[MOCK] addAction called with icon={icon_int}, text={action_text}, intent={pending_action_intent}")
|
|
229
|
+
|
|
230
|
+
def setShowWhen(self, state):
|
|
231
|
+
print(f"[MOCK] setShowWhen called with state={state}")
|
|
232
|
+
|
|
233
|
+
def setWhen(self, time_ms):
|
|
234
|
+
print(f"[MOCK] setWhen called with time_ms={time_ms}")
|
|
235
|
+
|
|
236
|
+
def setCustomContentView(self, layout):
|
|
237
|
+
print(f"[MOCK] setCustomContentView called with layout={layout}")
|
|
238
|
+
|
|
239
|
+
def setCustomBigContentView(self, layout):
|
|
240
|
+
print(f"[MOCK] setCustomBigContentView called with layout={layout}")
|
|
241
|
+
|
|
242
|
+
def setSubText(self, text):
|
|
243
|
+
print(f"[MOCK] setSubText called with text={text}")
|
|
244
|
+
|
|
245
|
+
def setColor(self, color: Color) -> None:
|
|
246
|
+
print(f"[MOCK] setColor called with color={color}")
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class NotificationCompatBigTextStyle:
|
|
250
|
+
def bigText(self, body):
|
|
251
|
+
print(f"[MOCK] NotificationCompatBigTextStyle.bigText called with body={body}")
|
|
252
|
+
return self
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
class NotificationCompatBigPictureStyle:
|
|
256
|
+
def bigPicture(self, bitmap):
|
|
257
|
+
print(f"[MOCK] NotificationCompatBigPictureStyle.bigPicture called with bitmap={bitmap}")
|
|
258
|
+
return self
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
class NotificationCompatInboxStyle:
|
|
262
|
+
def addLine(self, line):
|
|
263
|
+
print(f"[MOCK] NotificationCompatInboxStyle.addLine called with line={line}")
|
|
264
|
+
return self
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
class NotificationCompatDecoratedCustomViewStyle:
|
|
268
|
+
def __init__(self):
|
|
269
|
+
print("[MOCK] NotificationCompatDecoratedCustomViewStyle initialized")
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
class Permission:
|
|
273
|
+
POST_NOTIFICATIONS = ''
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
def check_permission(permission: Permission.POST_NOTIFICATIONS):
|
|
277
|
+
print(f"[MOCK] check_permission called with {permission}")
|
|
278
|
+
print(permission)
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
def request_permissions(_list: [], _callback):
|
|
282
|
+
print(f"[MOCK] request_permissions called with {_list}")
|
|
283
|
+
_callback()
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
class AndroidActivity:
|
|
287
|
+
def bind(self, on_new_intent):
|
|
288
|
+
print(f"[MOCK] AndroidActivity.bind called with {on_new_intent}")
|
|
289
|
+
|
|
290
|
+
def unbind(self, on_new_intent):
|
|
291
|
+
print(f"[MOCK] AndroidActivity.unbind called with {on_new_intent}")
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
class PythonActivity:
|
|
295
|
+
mActivity = "[MOCK] mActivity used"
|
|
296
|
+
def __init__(self):
|
|
297
|
+
print("[MOCK] PythonActivity initialized")
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
class DummyIcon:
|
|
301
|
+
icon = 101
|
|
302
|
+
|
|
303
|
+
def __init__(self):
|
|
304
|
+
print("[MOCK] DummyIcon initialized")
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
class Context:
|
|
308
|
+
def __init__(self):
|
|
309
|
+
print("[MOCK] Context initialized")
|
|
310
|
+
pass
|
|
311
|
+
|
|
312
|
+
@staticmethod
|
|
313
|
+
def getApplicationInfo():
|
|
314
|
+
print("[MOCK] Context.getApplicationInfo called")
|
|
315
|
+
return DummyIcon
|
|
316
|
+
|
|
317
|
+
@staticmethod
|
|
318
|
+
def getResources():
|
|
319
|
+
print("[MOCK] Context.getResources called")
|
|
320
|
+
return None
|
|
321
|
+
|
|
322
|
+
@staticmethod
|
|
323
|
+
def getPackageName():
|
|
324
|
+
print("[MOCK] Context.getPackageName called")
|
|
325
|
+
return None # TODO get package name from buildozer.spec file
|
|
326
|
+
|
|
327
|
+
# Now writing Knowledge from errors
|
|
328
|
+
# notify.(int, Builder.build()) # must be int
|