android-notify 1.56__tar.gz → 1.57.1__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: android-notify
3
- Version: 1.56
3
+ Version: 1.57.1
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
@@ -31,6 +31,7 @@ try:
31
31
  ON_ANDROID = True
32
32
  except Exception as e:# pylint: disable=W0718
33
33
  MESSAGE='This Package Only Runs on Android !!! ---> Check "https://github.com/Fector101/android_notify/" to see design patterns and more info.' # pylint: disable=C0301
34
+ # from .types_idea import *
34
35
  # print(MESSAGE) Already Printing in core.py
35
36
 
36
37
  # This is so no crashes when developing on PC
@@ -138,34 +139,34 @@ class Notification(BaseNotification):
138
139
  self.__builder.setContentText(String(self.message))
139
140
  self.__dispatchNotification()
140
141
 
141
- def updateProgressBar(self,current_value:int,message:str='',title:str=''):
142
+ def updateProgressBar(self,current_value:int,message:str='',title:str='',buffer=0.5):
142
143
  """Updates progress bar current value
143
144
 
144
145
  Args:
145
146
  current_value (int): the value from progressbar current progress
146
147
  message (str): defaults to last message
147
148
  title (str): defaults to last title
148
-
149
- NOTE: There is a 0.5sec delay, if updating title,msg with progressbar frequenlty pass them in too to avoid update issues
149
+ buffer (float, optional): Avoid Updating progressbar value too frequently Defaults to 0.5secs
150
+ NOTE: There is a 0.5sec delay for value change, if updating title,msg with progressbar frequenlty pass them in too to avoid update issues
150
151
  """
152
+ # replacing new value for when timer is called
153
+ self.progress_current_value = current_value
151
154
 
152
- # Cancel any existing timer before setting a new one
153
155
  if self.__update_timer:
154
- self.__update_timer.cancel()
155
- self.__update_timer = None
156
-
156
+ if self.logs:
157
+ print('Progressbar update too soon Doing bounce 0.5sec')
158
+ return
159
+
157
160
  def delayed_update():
158
161
  if self.__update_timer is None:
159
162
  # Ensure we are not executing an old timer
160
163
  return
161
164
  if self.logs:
162
- print(f'Progress Bar Update value: {current_value}')
165
+ print(f'Progress Bar Update value: {self.progress_current_value}')
163
166
 
164
- self.progress_current_value = current_value
165
-
166
167
  if not ON_ANDROID:
167
168
  return
168
- self.__builder.setProgress(self.progress_max_value, current_value, False)
169
+ self.__builder.setProgress(self.progress_max_value, self.progress_current_value, False)
169
170
  if message:
170
171
  self.updateMessage(message)
171
172
  if title:
@@ -175,10 +176,10 @@ class Notification(BaseNotification):
175
176
 
176
177
 
177
178
  # Start a new timer that runs after 0.5 seconds
178
- self.__update_timer = threading.Timer(0.5, delayed_update)
179
+ self.__update_timer = threading.Timer(buffer, delayed_update)
179
180
  self.__update_timer.start()
180
181
 
181
- def removeProgressBar(self,message='',show_on_update=True, title:str='') -> None:
182
+ def removeProgressBar(self,message='',show_on_update=True, title:str='') -> bool:
182
183
  """Removes Progress Bar from Notification
183
184
 
184
185
  Args:
@@ -301,6 +302,7 @@ class Notification(BaseNotification):
301
302
 
302
303
  Args:
303
304
  style (str): required style
305
+ already_sent (bool,False): If notification was already sent
304
306
  """
305
307
 
306
308
  if not ON_ANDROID:
@@ -0,0 +1,72 @@
1
+ # class Bundle:
2
+ # pass
3
+ # class PythonActivity:
4
+ # mActivity=''# Get the app's context
5
+ # pass
6
+ # class String(str):
7
+ # pass
8
+ # class Intent:
9
+ # def __init__(self,context,activity):
10
+ # pass
11
+ # class PendingIntent:
12
+ # FLAG_IMMUTABLE=''
13
+ # FLAG_UPDATE_CURRENT=''
14
+ # def getActivity(self,context,value,action_intent,pending_intent_type):
15
+ # pass
16
+ # class BitmapFactory:
17
+ # def decodeStream(self,stream):
18
+ # pass
19
+ # class BuildVersion:
20
+ # SDK_INT=0
21
+ # class NotificationManager:
22
+ # pass
23
+ # class NotificationChannel:
24
+ # def __init__(self,channel_id,channel_name,importance):
25
+ # pass
26
+ # def createNotificationChannel(self, channel):
27
+ # pass
28
+ #
29
+ # def getNotificationChannel(self, channel_id):
30
+ # pass
31
+ # class IconCompat:
32
+ # def createWithBitmap(self,bitmap):
33
+ # pass
34
+ #
35
+ # class NotificationManagerCompat:
36
+ # IMPORTANCE_DEFAULT=3
37
+ # IMPORTANCE_HIGH=4
38
+ #
39
+ #
40
+ # class NotificationCompat:
41
+ # DEFAULT_ALL=3
42
+ # PRIORITY_HIGH=4
43
+ #
44
+ # def __init__(self,context):
45
+ # pass
46
+ # def Builder(self,context,channel_id):
47
+ # pass
48
+ # class NotificationCompatBuilder:
49
+ # def __init__(self,context,channel_id):
50
+ # pass
51
+ # def setContentTitle(self,title):
52
+ # pass
53
+ # def setContentText(self,text):
54
+ # pass
55
+ # def setSmallIcon(self,icon):
56
+ # pass
57
+ # def setLargeIcon(self,icon):
58
+ # pass
59
+ # def setAutoCancel(self,auto_cancel):
60
+ # pass
61
+ # def setPriority(self,priority):
62
+ # pass
63
+ # def setDefaults(self,defaults):
64
+ # pass
65
+ # def build(self):
66
+ # pass
67
+ # class NotificationCompatBigTextStyle:
68
+ # pass
69
+ # class NotificationCompatBigPictureStyle:
70
+ # pass
71
+ # class NotificationCompatInboxStyle:
72
+ # pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: android-notify
3
- Version: 1.56
3
+ Version: 1.57.1
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
@@ -6,6 +6,7 @@ android_notify/base.py
6
6
  android_notify/core.py
7
7
  android_notify/styles.py
8
8
  android_notify/sword.py
9
+ android_notify/types_idea.py
9
10
  android_notify.egg-info/PKG-INFO
10
11
  android_notify.egg-info/SOURCES.txt
11
12
  android_notify.egg-info/dependency_links.txt
@@ -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.56",
9
+ version="1.57.1",
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