use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultNavigationAdapter method setRightItem.
public static void setRightItem(String params, final JSCallback jscallback) {
BaseToolBar navigationBar;
if (TextUtils.isEmpty(params)) {
navigationBar = getToolBar();
if (navigationBar == null)
return;
navigationBar.getRightText().setVisibility(View.GONE);
navigationBar.getRightIcon().setVisibility(View.GONE);
return;
}
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
NavigatorBarModel navigatorBarModel = parseManager.parseObject(params, NavigatorBarModel.class);
navigationBar = getToolBar();
if (navigationBar == null)
return;
setTextView(navigationBar.getRightText(), navigatorBarModel);
if (!TextUtils.isEmpty(navigatorBarModel.getImage())) {
setImage(BMWXEnvironment.mApplicationContext, navigatorBarModel.getImage(), navigationBar.getRightIcon());
}
if (jscallback != null) {
navigationBar.setOnRightListenner(new BaseToolBar.OnRightIconClick() {
@Override
public void onClick(View v) {
jscallback.invokeAndKeepAlive(new BaseResultBean());
}
});
}
}
use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultNavigationAdapter method setNavigationInfo.
public static void setNavigationInfo(String params, final JSCallback jscallback) {
BaseToolBar navigationBar;
if (TextUtils.isEmpty(params)) {
navigationBar = getToolBar();
if (navigationBar == null)
return;
navigationBar.setVisibility(View.GONE);
return;
}
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
// NavigatorBarModel navigatorBarModel = parseManager.parseObject(params, NavigatorBarModel
// .class);
NatigatorModel navigatorModel = parseManager.parseObject(params, NatigatorModel.class);
navigationBar = getToolBar();
if (navigationBar == null)
return;
navigationBar.setVisibility(navigatorModel.isNavShow() ? View.VISIBLE : View.GONE);
if (navigationBar.getVisibility() == View.GONE)
return;
navigationBar.getTitleTextView().setText(navigatorModel.getTitle());
if (navigatorModel.getStatusBarStyle() == null || "".equals(navigatorModel.getStatusBarStyle()) || "Default".equals(navigatorModel.getStatusBarStyle())) {
navigationBar.getTitleTextView().setTextColor(ColorUtils.getColor("#000000"));
} else {
navigationBar.getTitleTextView().setTextColor(ColorUtils.getColor("#ffffff"));
}
if (jscallback != null)
navigationBar.setOnTitleListenner(new BaseToolBar.OnTitleClick() {
@Override
public void onClick(View v) {
jscallback.invokeAndKeepAlive(new BaseResultBean());
}
});
}
use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultNavigationAdapter method setTabbarNavigation.
public static void setTabbarNavigation(Activity activity, NavigatorModel navigatorModel) {
if (activity instanceof AbstractWeexActivity) {
RouterModel routerModel = ((AbstractWeexActivity) activity).getRouterParam();
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
NatigatorModel model = parseManager.parseObject(navigatorModel.navigatorModel, NatigatorModel.class);
routerModel.navShow = model.isNavShow();
routerModel.navTitle = model.getTitle();
routerModel.canBack = false;
((AbstractWeexActivity) activity).setRouterParam(routerModel);
((AbstractWeexActivity) activity).setNavigationBar();
StatusBarManager.setHeaderBg(routerModel, (AbstractWeexActivity) activity);
}
}
use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class EventFetch method fetch.
public void fetch(String params, final Context context, final JSCallback jscallback) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
AxiosManager axiosManager = ManagerFactory.getManagerService(AxiosManager.class);
JSONObject object = parseManager.parseObject(params);
final String mUrl = object.getString("url");
Boolean noRepeat = object.getBoolean("noRepeat");
if (noRepeat != null && noRepeat) {
axiosManager.cancel(mUrl);
}
switch(object.getString("method").toUpperCase()) {
case OkHttpUtils.METHOD.GET:
AxiosGet axiosGet = parseManager.parseObject(params, AxiosGet.class);
get(context, axiosManager, axiosGet, jscallback);
break;
case OkHttpUtils.METHOD.POST:
AxiosPost axiosPost = parseManager.parseObject(params, AxiosPost.class);
post(context, axiosManager, axiosPost, jscallback);
break;
case OkHttpUtils.METHOD.HEAD:
AxiosGet axiosHead = parseManager.parseObject(params, AxiosGet.class);
head(context, axiosManager, axiosHead, jscallback);
break;
case OkHttpUtils.METHOD.DELETE:
AxiosPost axiosDelete = parseManager.parseObject(params, AxiosPost.class);
delete(context, axiosManager, axiosDelete, jscallback);
break;
case OkHttpUtils.METHOD.PUT:
AxiosPost axiosPut = parseManager.parseObject(params, AxiosPost.class);
put(context, axiosManager, axiosPut, jscallback);
break;
case OkHttpUtils.METHOD.PATCH:
AxiosPost axiosPatch = parseManager.parseObject(params, AxiosPost.class);
patch(context, axiosManager, axiosPatch, jscallback);
break;
}
}
use of com.eros.framework.manager.impl.ParseManager 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());
}
Aggregations