use of com.eros.framework.model.ModalBean in project WeexErosFramework by bmfe.
the class EventConfirm method confirm.
public void confirm(String options, final JSCallback cancel, final JSCallback ok, Context context) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
ModalBean bean = parseManager.parseObject(options, ModalBean.class);
ModalManager.BmAlert.showAlert(context, bean.getTitle(), bean.getMessage(), bean.getOkTitle(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (ok != null) {
ok.invoke(null);
}
}
}, bean.getCancelTitle(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (cancel != null) {
cancel.invoke(null);
}
}
}, bean.getTitleAlign(), bean.getMessageAlign());
}
use of com.eros.framework.model.ModalBean in project WeexErosFramework by bmfe.
the class EventAlert method alert.
public void alert(String options, final JSCallback callback, Context Context) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
ModalBean bean = parseManager.parseObject(options, ModalBean.class);
String okTitle = bean.getOkTitle();
if (TextUtils.isEmpty(okTitle)) {
okTitle = Context.getResources().getString(R.string.str_ensure);
}
ModalManager.BmAlert.showAlert(Context, bean.getTitle(), bean.getMessage(), okTitle, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
if (callback != null) {
callback.invoke(null);
}
}
}, null, null, bean.getTitleAlign(), bean.getMessageAlign());
}
use of com.eros.framework.model.ModalBean in project WeexErosFramework by bmfe.
the class EventToast method toast.
public void toast(String options, Context Context) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
ModalBean bean = parseManager.parseObject(options, ModalBean.class);
ModalManager.BmToast.toast(Context, bean.getMessage(), bean.getDuration() == 0 ? Toast.LENGTH_SHORT : bean.getDuration());
}
use of com.eros.framework.model.ModalBean in project WeexErosFramework by bmfe.
the class EventShowLoading method showLoading.
public void showLoading(String options, JSCallback callback, Context Context) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
ModalBean bean = parseManager.parseObject(options, ModalBean.class);
ModalManager.BmLoading.showLoading(Context, bean.getMessage(), false);
if (callback != null) {
callback.invoke(null);
}
}
Aggregations