use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultNavigationAdapter method setCenterItem.
public static void setCenterItem(String params, final JSCallback jscallback) {
BaseToolBar navigationBar;
if (TextUtils.isEmpty(params)) {
navigationBar = getToolBar();
if (navigationBar == null)
return;
navigationBar.getTitleTextView().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.getTitleTextView(), navigatorBarModel);
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 setLeftItem.
public static void setLeftItem(String params, final JSCallback jscallback) {
BaseToolBar navigationBar;
if (TextUtils.isEmpty(params)) {
navigationBar = getToolBar();
if (navigationBar == null)
return;
navigationBar.getLeftTextView().setVisibility(View.GONE);
navigationBar.getLeftIcon().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.getLeftTextView(), navigatorBarModel);
if (!TextUtils.isEmpty(navigatorBarModel.getImage())) {
setImage(BMWXEnvironment.mApplicationContext, navigatorBarModel.getImage(), navigationBar.getLeftIcon());
}
if (jscallback != null) {
navigationBar.setOnWebClosedListenner(new BaseToolBar.OnWebViewClosed() {
@Override
public void onClick(View v) {
jscallback.invokeAndKeepAlive(new BaseResultBean());
}
});
navigationBar.setOnLeftListenner(new BaseToolBar.OnLeftIconClick() {
@Override
public void onClick(View v) {
jscallback.invokeAndKeepAlive(null);
}
});
}
}
use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DebugActivity method initView.
private void initView() {
tv_appversion = (TextView) findViewById(R.id.tv_appversion);
tv_jsverision = (TextView) findViewById(R.id.tv_jsverision);
cb_inter = (CheckBox) findViewById(R.id.cb_inter);
cb_hotrefresh = (CheckBox) findViewById(R.id.cb_hotrefresh);
tv_appversion.setText(BaseCommonUtil.getVersionName(this));
String activeState = SharePreferenceUtil.getInterceptorActive(this);
if (Constant.INTERCEPTOR_ACTIVE.equals(activeState)) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
String jsVersion = parseManager.parseObject(SharePreferenceUtil.getVersion(this), JsVersionInfoBean.class).getJsVersion();
tv_jsverision.setText(jsVersion);
}
cb_hotrefresh.setEnabled(!Constant.INTERCEPTOR_ACTIVE.equals(activeState));
cb_inter.setChecked(Constant.INTERCEPTOR_ACTIVE.equals(activeState));
cb_inter.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
SharePreferenceUtil.setInterceptorActive(mAct, isChecked ? Constant.INTERCEPTOR_ACTIVE : Constant.INTERCEPTOR_DEACTIVE);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(new Intent(WXConstant.ACTION_INTERCEPTOR_SWTICH));
if (isChecked) {
cb_hotrefresh.setEnabled(false);
cb_hotrefresh.setChecked(false);
} else {
cb_hotrefresh.setEnabled(true);
}
}
});
cb_hotrefresh.setChecked(SharePreferenceUtil.getHotRefreshSwitch(this));
cb_hotrefresh.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
Log.e("DebugActivity", "onCheckedChanged -> " + isChecked);
SharePreferenceUtil.setHotRefreshSwitch(mAct, isChecked);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(new Intent(WXConstant.ACTION_INTERCEPTOR_SWTICH));
}
});
}
use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultRouterAdapter method open.
public boolean open(Context context, String params, JSCallback jsCallback) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
RouterModel routerModel = parseManager.parseObject(params, RouterModel.class);
if (jsCallback != null) {
routerModel.backCallback = (SimpleJSCallback) jsCallback;
}
return !(routerModel == null || !(context instanceof Activity)) && performStartActivity((Activity) context, routerModel, getPageCategory(context));
}
use of com.eros.framework.manager.impl.ParseManager 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