Search in sources :

Example 1 with ModalBean

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());
}
Also used : ModalBean(com.eros.framework.model.ModalBean) DialogInterface(android.content.DialogInterface) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 2 with ModalBean

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());
}
Also used : ModalBean(com.eros.framework.model.ModalBean) DialogInterface(android.content.DialogInterface) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 3 with ModalBean

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());
}
Also used : ModalBean(com.eros.framework.model.ModalBean) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 4 with ModalBean

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);
    }
}
Also used : ModalBean(com.eros.framework.model.ModalBean) ParseManager(com.eros.framework.manager.impl.ParseManager)

Aggregations

ParseManager (com.eros.framework.manager.impl.ParseManager)4 ModalBean (com.eros.framework.model.ModalBean)4 DialogInterface (android.content.DialogInterface)2