use of com.eros.framework.model.BaseResultBean 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.model.BaseResultBean 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.model.BaseResultBean 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.model.BaseResultBean 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);
}
});
}
}
Aggregations