android-notify 1.51__tar.gz → 1.51.2__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.
Potentially problematic release.
This version of android-notify might be problematic. Click here for more details.
- {android_notify-1.51 → android_notify-1.51.2}/PKG-INFO +11 -9
- {android_notify-1.51 → android_notify-1.51.2}/README.md +10 -8
- {android_notify-1.51 → android_notify-1.51.2}/android_notify/sword.py +31 -21
- {android_notify-1.51 → android_notify-1.51.2}/android_notify.egg-info/PKG-INFO +11 -9
- {android_notify-1.51 → android_notify-1.51.2}/setup.py +1 -1
- {android_notify-1.51 → android_notify-1.51.2}/android_notify/__init__.py +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/android_notify/__main__.py +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/android_notify/core.py +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/android_notify/styles.py +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/android_notify.egg-info/SOURCES.txt +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/android_notify.egg-info/dependency_links.txt +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/android_notify.egg-info/requires.txt +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/android_notify.egg-info/top_level.txt +0 -0
- {android_notify-1.51 → android_notify-1.51.2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: android-notify
|
|
3
|
-
Version: 1.51
|
|
3
|
+
Version: 1.51.2
|
|
4
4
|
Summary: A Python package that simpilfies creating Android notifications in Kivy apps.
|
|
5
5
|
Home-page: https://github.com/fector101/android-notify
|
|
6
6
|
Author: Fabian
|
|
@@ -47,7 +47,7 @@ Dynamic: summary
|
|
|
47
47
|
|
|
48
48
|
- Also Compatible with Android 8.0+.
|
|
49
49
|
- Supports including images in notifications.
|
|
50
|
-
- All Notifications can take Functions (version 1.50+) [functions
|
|
50
|
+
- All Notifications can take Functions (version 1.50+) [functions section](#functions).
|
|
51
51
|
- Support for multiple notification styles:
|
|
52
52
|
- [Simple](#basic-usage)
|
|
53
53
|
- [Progress](#progress-bar-notification)
|
|
@@ -88,6 +88,7 @@ android.permissions = POST_NOTIFICATIONS
|
|
|
88
88
|
# Required dependencies (write exactly as shown, no quotation marks)
|
|
89
89
|
android.gradle_dependencies = androidx.core:core:1.6.0, androidx.core:core-ktx:1.15.0
|
|
90
90
|
android.enable_androidx = True
|
|
91
|
+
android.api = 35
|
|
91
92
|
```
|
|
92
93
|
|
|
93
94
|
---
|
|
@@ -142,10 +143,14 @@ Clock.schedule_once(lambda dt: notification.updateProgressBar(30, "30% downloade
|
|
|
142
143
|
**Sample Image:**
|
|
143
144
|

|
|
144
145
|
|
|
145
|
-
####
|
|
146
|
+
#### Images
|
|
147
|
+
|
|
148
|
+
##### Notification with an Image (Big Picture Style)
|
|
146
149
|
|
|
147
150
|
> [!NOTE]
|
|
148
|
-
> Online Images should start with `http://` or `https://`
|
|
151
|
+
> Online Images should start with `http://` or `https://`
|
|
152
|
+
> And request for permission, `android.permissions = INTERNET`
|
|
153
|
+
> No additionally permissions needed for images in App folder
|
|
149
154
|
|
|
150
155
|
```python
|
|
151
156
|
# Image notification
|
|
@@ -162,10 +167,7 @@ notification.send()
|
|
|
162
167
|
**Sample Image:**
|
|
163
168
|

|
|
164
169
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
> [!NOTE]
|
|
168
|
-
> Online Images should start with `http://` or `https://`
|
|
170
|
+
##### Notification with an Image (Large Icon Style)
|
|
169
171
|
|
|
170
172
|
```python
|
|
171
173
|
notification = Notification(
|
|
@@ -223,7 +225,7 @@ notification.send()
|
|
|
223
225
|
```python
|
|
224
226
|
notification = Notification(
|
|
225
227
|
title="Article",
|
|
226
|
-
subject="Histroy of Loerm Ipsuim"
|
|
228
|
+
subject="Histroy of Loerm Ipsuim",
|
|
227
229
|
message="Lorem Ipsum is simply dummy text of the printing and ...",
|
|
228
230
|
style="big_text"
|
|
229
231
|
)
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
|
|
12
12
|
- Also Compatible with Android 8.0+.
|
|
13
13
|
- Supports including images in notifications.
|
|
14
|
-
- All Notifications can take Functions (version 1.50+) [functions
|
|
14
|
+
- All Notifications can take Functions (version 1.50+) [functions section](#functions).
|
|
15
15
|
- Support for multiple notification styles:
|
|
16
16
|
- [Simple](#basic-usage)
|
|
17
17
|
- [Progress](#progress-bar-notification)
|
|
@@ -52,6 +52,7 @@ android.permissions = POST_NOTIFICATIONS
|
|
|
52
52
|
# Required dependencies (write exactly as shown, no quotation marks)
|
|
53
53
|
android.gradle_dependencies = androidx.core:core:1.6.0, androidx.core:core-ktx:1.15.0
|
|
54
54
|
android.enable_androidx = True
|
|
55
|
+
android.api = 35
|
|
55
56
|
```
|
|
56
57
|
|
|
57
58
|
---
|
|
@@ -106,10 +107,14 @@ Clock.schedule_once(lambda dt: notification.updateProgressBar(30, "30% downloade
|
|
|
106
107
|
**Sample Image:**
|
|
107
108
|

|
|
108
109
|
|
|
109
|
-
####
|
|
110
|
+
#### Images
|
|
111
|
+
|
|
112
|
+
##### Notification with an Image (Big Picture Style)
|
|
110
113
|
|
|
111
114
|
> [!NOTE]
|
|
112
|
-
> Online Images should start with `http://` or `https://`
|
|
115
|
+
> Online Images should start with `http://` or `https://`
|
|
116
|
+
> And request for permission, `android.permissions = INTERNET`
|
|
117
|
+
> No additionally permissions needed for images in App folder
|
|
113
118
|
|
|
114
119
|
```python
|
|
115
120
|
# Image notification
|
|
@@ -126,10 +131,7 @@ notification.send()
|
|
|
126
131
|
**Sample Image:**
|
|
127
132
|

|
|
128
133
|
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
> [!NOTE]
|
|
132
|
-
> Online Images should start with `http://` or `https://`
|
|
134
|
+
##### Notification with an Image (Large Icon Style)
|
|
133
135
|
|
|
134
136
|
```python
|
|
135
137
|
notification = Notification(
|
|
@@ -187,7 +189,7 @@ notification.send()
|
|
|
187
189
|
```python
|
|
188
190
|
notification = Notification(
|
|
189
191
|
title="Article",
|
|
190
|
-
subject="Histroy of Loerm Ipsuim"
|
|
192
|
+
subject="Histroy of Loerm Ipsuim",
|
|
191
193
|
message="Lorem Ipsum is simply dummy text of the printing and ...",
|
|
192
194
|
style="big_text"
|
|
193
195
|
)
|
|
@@ -172,6 +172,7 @@ class Notification:
|
|
|
172
172
|
self.message=new_message
|
|
173
173
|
if ON_ANDROID:
|
|
174
174
|
self.__builder.setContentText(new_message)
|
|
175
|
+
|
|
175
176
|
return True
|
|
176
177
|
return 'Updated'
|
|
177
178
|
def updateProgressBar(self,current_value,message:str=''):
|
|
@@ -271,11 +272,11 @@ class Notification:
|
|
|
271
272
|
def __startNotificationBuild(self):
|
|
272
273
|
self.__createBasicNotification()
|
|
273
274
|
if self.style not in ['simple','']:
|
|
274
|
-
self.
|
|
275
|
+
self.addNotificationStyle(self.style)
|
|
275
276
|
|
|
276
277
|
def __createBasicNotification(self):
|
|
277
278
|
# Notification Channel (Required for Android 8.0+)
|
|
278
|
-
# print("THis is cchannel is ",self.channel_id) #"
|
|
279
|
+
# print("THis is cchannel is ",self.channel_id) #"
|
|
279
280
|
if BuildVersion.SDK_INT >= 26 and self.notification_manager.getNotificationChannel(self.channel_id) is None:
|
|
280
281
|
importance=NotificationManagerCompat.IMPORTANCE_DEFAULT if self.silent else NotificationManagerCompat.IMPORTANCE_HIGH # pylint: disable=possibly-used-before-assignment
|
|
281
282
|
# importance = 3 or 4
|
|
@@ -299,37 +300,51 @@ class Notification:
|
|
|
299
300
|
self.__builder.setPriority(NotificationCompat.PRIORITY_DEFAULT if self.silent else NotificationCompat.PRIORITY_HIGH)
|
|
300
301
|
self.__builder.setOnlyAlertOnce(True)
|
|
301
302
|
self.__addIntentToOpenApp()
|
|
303
|
+
@run_on_ui_thread
|
|
304
|
+
def addNotificationStyle(self,style:str,already_sent=False):
|
|
305
|
+
"""Adds Style to Notification
|
|
306
|
+
Version 1.51.2+ Exposing to Users (Note): Always Call On UI Thread
|
|
302
307
|
|
|
303
|
-
|
|
304
|
-
|
|
308
|
+
Args:
|
|
309
|
+
style (str): required style
|
|
310
|
+
"""
|
|
311
|
+
|
|
312
|
+
if not ON_ANDROID:
|
|
313
|
+
# TODO for logs when not on android and style related to imgs etraxct app path from buildozer.spec and print
|
|
314
|
+
return
|
|
315
|
+
|
|
316
|
+
if style == NotificationStyles.BIG_TEXT:
|
|
305
317
|
big_text_style = NotificationCompatBigTextStyle() # pylint: disable=E0606
|
|
306
318
|
big_text_style.bigText(self.message)
|
|
307
319
|
self.__builder.setStyle(big_text_style)
|
|
308
320
|
|
|
309
|
-
elif
|
|
321
|
+
elif style == NotificationStyles.INBOX:
|
|
310
322
|
inbox_style = NotificationCompatInboxStyle() # pylint: disable=E0606
|
|
311
323
|
for line in self.message.split("\n"):
|
|
312
324
|
inbox_style.addLine(line)
|
|
313
325
|
self.__builder.setStyle(inbox_style)
|
|
314
326
|
|
|
315
|
-
elif
|
|
316
|
-
self.__buildImg(self.big_picture_path,
|
|
327
|
+
elif style == NotificationStyles.BIG_PICTURE and self.big_picture_path:
|
|
328
|
+
self.__buildImg(self.big_picture_path, style)
|
|
317
329
|
|
|
318
|
-
elif
|
|
319
|
-
self.__buildImg(self.large_icon_path,
|
|
330
|
+
elif style == NotificationStyles.LARGE_ICON and self.large_icon_path:
|
|
331
|
+
self.__buildImg(self.large_icon_path, style)
|
|
320
332
|
|
|
321
|
-
elif
|
|
333
|
+
elif style == NotificationStyles.BOTH_IMGS and (self.big_picture_path or self.large_icon_path):
|
|
322
334
|
if self.big_picture_path:
|
|
323
335
|
self.__buildImg(self.big_picture_path, NotificationStyles.BIG_PICTURE)
|
|
324
336
|
if self.large_icon_path:
|
|
325
337
|
self.__buildImg(self.large_icon_path, NotificationStyles.LARGE_ICON)
|
|
326
338
|
|
|
327
|
-
elif
|
|
339
|
+
elif style == 'progress':
|
|
328
340
|
self.__builder.setContentTitle(String(self.title))
|
|
329
341
|
self.__builder.setContentText(String(self.message))
|
|
330
342
|
self.__builder.setProgress(self.progress_max_value, self.progress_current_value, False)
|
|
331
343
|
|
|
332
|
-
|
|
344
|
+
if already_sent:
|
|
345
|
+
self.notification_manager.notify(self.__id, self.__builder.build())
|
|
346
|
+
|
|
347
|
+
# elif style == 'custom':
|
|
333
348
|
# self.__builder = self.__doCustomStyle()
|
|
334
349
|
|
|
335
350
|
# def __doCustomStyle(self):
|
|
@@ -344,15 +359,10 @@ class Notification:
|
|
|
344
359
|
)
|
|
345
360
|
thread.start()
|
|
346
361
|
else:
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
self.__builder.setStyle(big_picture_style)
|
|
352
|
-
elif NotificationStyles.LARGE_ICON:
|
|
353
|
-
bitmap = self.__getImgFromPath(user_img)
|
|
354
|
-
if bitmap:
|
|
355
|
-
self.__builder.setLargeIcon(bitmap)
|
|
362
|
+
bitmap = self.__getImgFromPath(user_img)
|
|
363
|
+
if bitmap:
|
|
364
|
+
self.__applyNotificationImage(bitmap,img_style)
|
|
365
|
+
|
|
356
366
|
|
|
357
367
|
def __getImgFromPath(self, relative_path):
|
|
358
368
|
app_folder=os.path.join(app_storage_path(),'app') # pylint: disable=possibly-used-before-assignment
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: android-notify
|
|
3
|
-
Version: 1.51
|
|
3
|
+
Version: 1.51.2
|
|
4
4
|
Summary: A Python package that simpilfies creating Android notifications in Kivy apps.
|
|
5
5
|
Home-page: https://github.com/fector101/android-notify
|
|
6
6
|
Author: Fabian
|
|
@@ -47,7 +47,7 @@ Dynamic: summary
|
|
|
47
47
|
|
|
48
48
|
- Also Compatible with Android 8.0+.
|
|
49
49
|
- Supports including images in notifications.
|
|
50
|
-
- All Notifications can take Functions (version 1.50+) [functions
|
|
50
|
+
- All Notifications can take Functions (version 1.50+) [functions section](#functions).
|
|
51
51
|
- Support for multiple notification styles:
|
|
52
52
|
- [Simple](#basic-usage)
|
|
53
53
|
- [Progress](#progress-bar-notification)
|
|
@@ -88,6 +88,7 @@ android.permissions = POST_NOTIFICATIONS
|
|
|
88
88
|
# Required dependencies (write exactly as shown, no quotation marks)
|
|
89
89
|
android.gradle_dependencies = androidx.core:core:1.6.0, androidx.core:core-ktx:1.15.0
|
|
90
90
|
android.enable_androidx = True
|
|
91
|
+
android.api = 35
|
|
91
92
|
```
|
|
92
93
|
|
|
93
94
|
---
|
|
@@ -142,10 +143,14 @@ Clock.schedule_once(lambda dt: notification.updateProgressBar(30, "30% downloade
|
|
|
142
143
|
**Sample Image:**
|
|
143
144
|

|
|
144
145
|
|
|
145
|
-
####
|
|
146
|
+
#### Images
|
|
147
|
+
|
|
148
|
+
##### Notification with an Image (Big Picture Style)
|
|
146
149
|
|
|
147
150
|
> [!NOTE]
|
|
148
|
-
> Online Images should start with `http://` or `https://`
|
|
151
|
+
> Online Images should start with `http://` or `https://`
|
|
152
|
+
> And request for permission, `android.permissions = INTERNET`
|
|
153
|
+
> No additionally permissions needed for images in App folder
|
|
149
154
|
|
|
150
155
|
```python
|
|
151
156
|
# Image notification
|
|
@@ -162,10 +167,7 @@ notification.send()
|
|
|
162
167
|
**Sample Image:**
|
|
163
168
|

|
|
164
169
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
> [!NOTE]
|
|
168
|
-
> Online Images should start with `http://` or `https://`
|
|
170
|
+
##### Notification with an Image (Large Icon Style)
|
|
169
171
|
|
|
170
172
|
```python
|
|
171
173
|
notification = Notification(
|
|
@@ -223,7 +225,7 @@ notification.send()
|
|
|
223
225
|
```python
|
|
224
226
|
notification = Notification(
|
|
225
227
|
title="Article",
|
|
226
|
-
subject="Histroy of Loerm Ipsuim"
|
|
228
|
+
subject="Histroy of Loerm Ipsuim",
|
|
227
229
|
message="Lorem Ipsum is simply dummy text of the printing and ...",
|
|
228
230
|
style="big_text"
|
|
229
231
|
)
|
|
@@ -6,7 +6,7 @@ with open("README.md", "r", encoding="utf-8") as readme_data:
|
|
|
6
6
|
|
|
7
7
|
setup(
|
|
8
8
|
name="android-notify",
|
|
9
|
-
version="1.51",
|
|
9
|
+
version="1.51.2",
|
|
10
10
|
author="Fabian",
|
|
11
11
|
author_email='fector101@yahoo.com',
|
|
12
12
|
description="A Python package that simpilfies creating Android notifications in Kivy apps.",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|