com.cprot.ead 1.0.8301 → 1.0.8319
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
|
@@ -197,46 +197,48 @@ class CProtEadModuleModule(reactContext: ReactApplicationContext) :
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
@ReactMethod
|
|
200
|
-
fun
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
200
|
+
fun updateNotificationSettings(
|
|
201
|
+
iconResourceName: String?,
|
|
202
|
+
colorResourceName: String?,
|
|
203
|
+
shouldUseNotificationColor: Boolean?
|
|
204
|
+
) {
|
|
205
|
+
val context = reactApplicationContext
|
|
206
|
+
val iconResId: Int? = try {
|
|
207
|
+
when {
|
|
208
|
+
iconResourceName == null -> null
|
|
209
|
+
iconResourceName.isBlank() -> 0
|
|
210
|
+
else -> context.resources.getIdentifier(
|
|
211
|
+
iconResourceName,
|
|
212
|
+
"drawable",
|
|
213
|
+
context.packageName
|
|
214
|
+
).takeIf { it != 0 } ?: 0
|
|
215
|
+
}
|
|
216
|
+
} catch (e: Exception) {
|
|
217
|
+
Log.e("CProtEadModule", "Error resolving drawable: $iconResourceName", e)
|
|
218
|
+
0
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
val colorResId: Int? = try {
|
|
222
|
+
when {
|
|
223
|
+
colorResourceName == null -> null
|
|
224
|
+
colorResourceName.isBlank() -> 0
|
|
225
|
+
else -> context.resources.getIdentifier(
|
|
226
|
+
colorResourceName,
|
|
227
|
+
"color",
|
|
228
|
+
context.packageName
|
|
229
|
+
).takeIf { it != 0 } ?: 0
|
|
230
|
+
}
|
|
231
|
+
} catch (e: Exception) {
|
|
232
|
+
Log.e("CProtEadModule", "Error resolving color: $colorResourceName", e)
|
|
233
|
+
0
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
module?.updateNotificationSettings(
|
|
237
|
+
iconResId,
|
|
238
|
+
colorResId,
|
|
239
|
+
shouldUseNotificationColor
|
|
240
|
+
)
|
|
241
|
+
}
|
|
240
242
|
|
|
241
243
|
@ReactMethod
|
|
242
244
|
fun stopRealtime() {
|