also looking at this
feat(android): the widget pair in Zig — ratchet 77 → 75
#167
6 files
+456
-3
| @@ -3740,6 +3740,11 @@ class CraftBridge( | ||
| 3740 | 3740 | |
| 3741 | 3741 | @JavascriptInterface |
| 3742 | 3742 | fun updateWidget(dataJson: String) { |
| 3743 | // Zig answers through the reply channel, so returning here is what | |
| 3744 | // stops the promise being settled twice. The action is passed across | |
| 3745 | // rather than rebuilt there — see CraftNative.updateWidget. | |
| 3746 | if (CraftNative.updateWidget(activity, ".WIDGET_UPDATE", dataJson)) return | |
| 3747 | ||
| 3743 | 3748 | try { |
| 3744 | 3749 | val data = JSONObject(dataJson) |
| 3745 | 3750 | val editor = widgetPrefs.edit() |
| @@ -3782,6 +3787,8 @@ class CraftBridge( | ||
| 3782 | 3787 | |
| 3783 | 3788 | @JavascriptInterface |
| 3784 | 3789 | fun reloadWidgets() { |
| 3790 | if (CraftNative.reloadWidgets(activity, ".WIDGET_UPDATE")) return | |
| 3791 | ||
| 3785 | 3792 | val intent = Intent(".WIDGET_UPDATE") |
| 3786 | 3793 | intent.setPackage(activity.packageName) |
| 3787 | 3794 | activity.sendBroadcast(intent) |