Search in sources :

Example 1 with AbstractWeexActivity

use of com.eros.framework.activity.AbstractWeexActivity in project WeexErosFramework by bmfe.

the class DefaultWXHttpAdapter method hideError.

private void hideError() {
    if (!DebugableUtil.isDebug())
        return;
    Activity activity = RouterTracker.peekActivity();
    if (activity != null && activity instanceof AbstractWeexActivity) {
        AbstractWeexActivity abs = (AbstractWeexActivity) activity;
        abs.hideError();
    }
}
Also used : AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) Activity(android.app.Activity) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity)

Example 2 with AbstractWeexActivity

use of com.eros.framework.activity.AbstractWeexActivity 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 AbstractWeexActivity

use of com.eros.framework.activity.AbstractWeexActivity in project WeexErosFramework by bmfe.

the class DefaultRouterAdapter method back.

public boolean back(Context context, String params) {
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    RouterModel routerModel = parseManager.parseObject(params, RouterModel.class);
    int backLength = routerModel.length;
    if (backLength >= RouterTracker.length()) {
        RouterTracker.clearActivitySurplus(1);
    } else {
        for (int i = 0; i < backLength; i++) {
            RouterTracker.popActivity();
        }
    }
    Object backParams = routerModel.params;
    if (backParams instanceof Map) {
        if (((Map) backParams).size() > 0) {
            Activity activity = RouterTracker.peekActivity();
            if (activity instanceof AbstractWeexActivity) {
                // 设置back参数
                ((AbstractWeexActivity) activity).setRouterParam(routerModel);
            }
        }
    }
    return true;
}
Also used : RouterModel(com.eros.framework.model.RouterModel) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) Activity(android.app.Activity) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) ParseManager(com.eros.framework.manager.impl.ParseManager) Map(java.util.Map)

Example 4 with AbstractWeexActivity

use of com.eros.framework.activity.AbstractWeexActivity in project WeexErosFramework by bmfe.

the class GlobalEvent method eventPushMessage.

private void eventPushMessage(Context context, BaseEventBean eventBean) {
    Activity activity = RouterTracker.peekActivity();
    if (activity instanceof AbstractWeexActivity) {
        WXSDKInstance instance = ((AbstractWeexActivity) activity).getWXSDkInstance();
        ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
        GlobalEventManager.pushMessage(instance, parseManager.parseObject(eventBean.param));
    }
}
Also used : WXSDKInstance(com.taobao.weex.WXSDKInstance) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) Activity(android.app.Activity) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 5 with AbstractWeexActivity

use of com.eros.framework.activity.AbstractWeexActivity in project WeexErosFramework by bmfe.

the class TitleModule method statusBarHidden.

@JSMethod(uiThread = true)
public void statusBarHidden(String param) {
    boolean isFullScreen = false;
    try {
        isFullScreen = Boolean.parseBoolean(param);
    } catch (Exception e) {
        Log.d("jsLog", "bmNavigator statusBarHidden() param is not Boolean --> " + param);
    }
    Context context = mWXSDKInstance.getContext();
    if (context instanceof AbstractWeexActivity) {
        BMWXApplication.getWXApplication().IS_FULL_SCREEN = isFullScreen;
        ((AbstractWeexActivity) context).statusBarHidden(isFullScreen);
    }
}
Also used : Context(android.content.Context) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) JSMethod(com.taobao.weex.annotation.JSMethod)

Aggregations

AbstractWeexActivity (com.eros.framework.activity.AbstractWeexActivity)6 Activity (android.app.Activity)4 ParseManager (com.eros.framework.manager.impl.ParseManager)3 RouterModel (com.eros.framework.model.RouterModel)2 Context (android.content.Context)1 LifecycleManager (com.eros.framework.manager.impl.LifecycleManager)1 NatigatorModel (com.eros.framework.model.NatigatorModel)1 WXSDKInstance (com.taobao.weex.WXSDKInstance)1 JSMethod (com.taobao.weex.annotation.JSMethod)1 Map (java.util.Map)1