use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class EventNav method nav.
public void nav(String params, Context context) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
NavModule navModule = parseManager.parseObject(params, NavModule.class);
if (navModule != null) {
String type = navModule.getType();
if ("amap".equals(type)) {
navByAmap(context, navModule);
} else if ("baidu".equals(type)) {
navByBaidumap(context, navModule);
}
}
}
use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class TabbarEvent method showBadge.
private void showBadge(WeexEventBean weexEventBean) {
Context context = weexEventBean.getContext();
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
TabbarBadgeModule module = parseManager.parseObject(weexEventBean.getJsParams(), TabbarBadgeModule.class);
if (context instanceof MainActivity) {
((MainActivity) context).setBadge(module);
}
}
use of com.eros.framework.manager.impl.ParseManager 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.manager.impl.ParseManager 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.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class AppUtils method getJsVersion.
public static String getJsVersion(Context context) {
String jsVersion = SharePreferenceUtil.getVersion(context);
if (TextUtils.isEmpty(jsVersion)) {
AssetsUtil.AssetsJsVersion assetsVersionInfo = AssetsUtil.getAssetsVersionInfo(context);
if (assetsVersionInfo != null) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
SharePreferenceUtil.setVersion(context, parseManager.toJsonString(assetsVersionInfo));
}
return assetsVersionInfo == null ? "" : assetsVersionInfo.getJsVersion();
}
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
JsVersionInfoBean jsVersionInfoBean = parseManager.parseObject(jsVersion, JsVersionInfoBean.class);
return jsVersionInfoBean == null ? "" : jsVersionInfoBean.getJsVersion();
}
Aggregations