|
@ -41,7 +41,7 @@ public class MobileUIWithSAD extends Plugin {
|
41
|
41
|
* @param param
|
42
|
42
|
* @throws Exception
|
43
|
43
|
*/
|
44
|
|
public void alert(JSONArray param) throws Exception {
|
|
44
|
public void sweetAlert(JSONArray param) throws Exception {
|
45
|
45
|
JSONObject jsonObject = param.getJSONObject(0);
|
46
|
46
|
JSONObject map = jsonObject.getJSONObject("map");
|
47
|
47
|
String content = map.getString("content");
|
|
@ -49,7 +49,7 @@ public class MobileUIWithSAD extends Plugin {
|
49
|
49
|
Boolean cancelable = map.getBoolean("cancelable");
|
50
|
50
|
int alertType = map.getInt("alertType");
|
51
|
51
|
int imageID = map.getInt("imageID");
|
52
|
|
alert(content, title, cancelable, alertType, imageID);
|
|
52
|
sweetAlert(content, title, cancelable, alertType, imageID);
|
53
|
53
|
}
|
54
|
54
|
/**
|
55
|
55
|
* 普通类型的几种提示框
|
|
@ -66,7 +66,7 @@ public class MobileUIWithSAD extends Plugin {
|
66
|
66
|
* 图片资源ID
|
67
|
67
|
* @throws Exception
|
68
|
68
|
*/
|
69
|
|
public void alert(String content, String title, boolean cancelable,
|
|
69
|
public void sweetAlert(String content, String title, boolean cancelable,
|
70
|
70
|
int alertType, int imageID) throws Exception {
|
71
|
71
|
final SweetAlertDialog dialog = new SweetAlertDialog(context, alertType);
|
72
|
72
|
if (title != null) {
|
|
@ -92,7 +92,7 @@ public class MobileUIWithSAD extends Plugin {
|
92
|
92
|
* @param param
|
93
|
93
|
* @throws Exception
|
94
|
94
|
*/
|
95
|
|
public void confirm(JSONArray param) throws Exception {
|
|
95
|
public void sweetConfirm(JSONArray param) throws Exception {
|
96
|
96
|
JSONObject jsonObject = param.getJSONObject(0);
|
97
|
97
|
JSONObject map = jsonObject.getJSONObject("map");
|
98
|
98
|
String content = map.getString("content");
|
|
@ -103,7 +103,7 @@ public class MobileUIWithSAD extends Plugin {
|
103
|
103
|
String cancelEvent = map.getString("cancelEvent");
|
104
|
104
|
String confirmEvent = map.getString("confirmEvent");
|
105
|
105
|
Boolean isCancel = map.getBoolean("isCancel");
|
106
|
|
confirm(content, title, cancelable, cancelText, confirmText, isCancel,
|
|
106
|
sweetConfirm(content, title, cancelable, cancelText, confirmText, isCancel,
|
107
|
107
|
cancelEvent, confirmEvent);
|
108
|
108
|
}
|
109
|
109
|
/**
|
|
@ -127,7 +127,7 @@ public class MobileUIWithSAD extends Plugin {
|
127
|
127
|
* 确认按钮点击事件
|
128
|
128
|
* @throws Exception
|
129
|
129
|
*/
|
130
|
|
public void confirm(String content, String title, boolean cancelable,
|
|
130
|
public void sweetConfirm(String content, String title, boolean cancelable,
|
131
|
131
|
String cancelText, String confirmText, boolean isCancel,
|
132
|
132
|
final String cancelEvent, final String confirmEvent)
|
133
|
133
|
throws Exception {
|
|
@ -191,7 +191,7 @@ public class MobileUIWithSAD extends Plugin {
|
191
|
191
|
* @param param
|
192
|
192
|
* @throws Exception
|
193
|
193
|
*/
|
194
|
|
public void loading(JSONArray param) throws Exception {
|
|
194
|
public void sweetLoading(JSONArray param) throws Exception {
|
195
|
195
|
JSONObject jsonObject = param.getJSONObject(0);
|
196
|
196
|
JSONObject map = jsonObject.getJSONObject("map");
|
197
|
197
|
String title = map.getString("title");
|
|
@ -200,7 +200,7 @@ public class MobileUIWithSAD extends Plugin {
|
200
|
200
|
Long countDownInterval = map.getLong("countDownInterval");
|
201
|
201
|
String nextEvent = map.getString("nextEvent");
|
202
|
202
|
Boolean hasNext = map.getBoolean("hasNext");
|
203
|
|
loading(title, cancelable, millisInFuture, countDownInterval, hasNext,
|
|
203
|
sweetLoading(title, cancelable, millisInFuture, countDownInterval, hasNext,
|
204
|
204
|
nextEvent);
|
205
|
205
|
}
|
206
|
206
|
/**
|
|
@ -220,7 +220,7 @@ public class MobileUIWithSAD extends Plugin {
|
220
|
220
|
* 对话框事件(JS定义弹出新对话框)
|
221
|
221
|
* @throws Exception
|
222
|
222
|
*/
|
223
|
|
public void loading(String title, boolean cancelable, long millisInFuture,
|
|
223
|
public void sweetLoading(String title, boolean cancelable, long millisInFuture,
|
224
|
224
|
long countDownInterval, final boolean hasNext,
|
225
|
225
|
final String nextEvent) throws Exception {
|
226
|
226
|
final SweetAlertDialog pDialog = new SweetAlertDialog(context,
|