com.cprot.ead 1.0.8280 → 1.0.8301
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.
package/android/build.gradle
CHANGED
|
@@ -196,6 +196,48 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
|
|
199
|
+
@ReactMethod
|
|
200
|
+
fun setNotificationIcon(resourceName: String?) {
|
|
201
|
+
val context = reactApplicationContext
|
|
202
|
+
val resId = try {
|
|
203
|
+
if (resourceName.isNullOrBlank()) {
|
|
204
|
+
0
|
|
205
|
+
} else {
|
|
206
|
+
context.resources.getIdentifier(
|
|
207
|
+
resourceName,
|
|
208
|
+
"drawable",
|
|
209
|
+
context.packageName
|
|
210
|
+
).takeIf { it != 0 } ?: 0
|
|
211
|
+
}
|
|
212
|
+
} catch (e: Exception) {
|
|
213
|
+
Log.e("CProtEadModule", "Error resolving drawable: $resourceName", e)
|
|
214
|
+
0
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
module?.setNotificationIconIntCode(resId)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
@ReactMethod
|
|
221
|
+
fun setNotificationColor(resourceName: String?) {
|
|
222
|
+
val context = reactApplicationContext
|
|
223
|
+
val resId = try {
|
|
224
|
+
if (resourceName.isNullOrBlank()) {
|
|
225
|
+
0
|
|
226
|
+
} else {
|
|
227
|
+
context.resources.getIdentifier(
|
|
228
|
+
resourceName,
|
|
229
|
+
"color",
|
|
230
|
+
context.packageName
|
|
231
|
+
).takeIf { it != 0 } ?: 0
|
|
232
|
+
}
|
|
233
|
+
} catch (e: Exception) {
|
|
234
|
+
Log.e("CProtEadModule", "Error resolving color: $resourceName", e)
|
|
235
|
+
0
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
module?.setNotificationColorIntCode(resId)
|
|
239
|
+
}
|
|
240
|
+
|
|
199
241
|
@ReactMethod
|
|
200
242
|
fun stopRealtime() {
|
|
201
243
|
module?.let {
|