Search in sources :

Example 1 with BaseToolBar

use of com.eros.widget.view.BaseToolBar 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());
            }
        });
    }
}
Also used : BaseResultBean(com.eros.framework.model.BaseResultBean) NavigatorBarModel(com.eros.framework.model.NavigatorBarModel) 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 BaseToolBar

use of com.eros.widget.view.BaseToolBar 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 3 with BaseToolBar

use of com.eros.widget.view.BaseToolBar 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());
            }
        });
}
Also used : BaseResultBean(com.eros.framework.model.BaseResultBean) NavigatorBarModel(com.eros.framework.model.NavigatorBarModel) 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 4 with BaseToolBar

use of com.eros.widget.view.BaseToolBar 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);
            }
        });
    }
}
Also used : BaseResultBean(com.eros.framework.model.BaseResultBean) NavigatorBarModel(com.eros.framework.model.NavigatorBarModel) 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)

Aggregations

View (android.view.View)4 ImageView (android.widget.ImageView)4 TextView (android.widget.TextView)4 ParseManager (com.eros.framework.manager.impl.ParseManager)4 BaseResultBean (com.eros.framework.model.BaseResultBean)4 BaseToolBar (com.eros.widget.view.BaseToolBar)4 NavigatorBarModel (com.eros.framework.model.NavigatorBarModel)3 NatigatorModel (com.eros.framework.model.NatigatorModel)1