Search in sources :

Example 1 with NatigatorModel

use of com.eros.framework.model.NatigatorModel 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());
            }
        });
}
Also used : NatigatorModel(com.eros.framework.model.NatigatorModel) BaseResultBean(com.eros.framework.model.BaseResultBean) BaseToolBar(com.eros.widget.view.BaseToolBar) ParseManager(com.eros.framework.manager.impl.ParseManager) ImageView(android.widget.ImageView) View(android.view.View) TextView(android.widget.TextView)

Example 2 with NatigatorModel

use of com.eros.framework.model.NatigatorModel 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);
    }
}
Also used : NatigatorModel(com.eros.framework.model.NatigatorModel) RouterModel(com.eros.framework.model.RouterModel) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 3 with NatigatorModel

use of com.eros.framework.model.NatigatorModel in project WeexErosFramework by bmfe.

the class TableView method getNavStr.

private String getNavStr(PlatformConfigBean.TabItem item) {
    NatigatorModel model = new NatigatorModel();
    model.setNavShow(item.isNavShow());
    model.setTitle(item.getNavTitle());
    return JSON.toJSONString(model);
}
Also used : NatigatorModel(com.eros.framework.model.NatigatorModel)

Aggregations

NatigatorModel (com.eros.framework.model.NatigatorModel)3 ParseManager (com.eros.framework.manager.impl.ParseManager)2 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 AbstractWeexActivity (com.eros.framework.activity.AbstractWeexActivity)1 BaseResultBean (com.eros.framework.model.BaseResultBean)1 RouterModel (com.eros.framework.model.RouterModel)1 BaseToolBar (com.eros.widget.view.BaseToolBar)1