Search in sources :

Example 1 with MainActivity

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

the class TabbarEvent method showBadge.

private void showBadge(WeexEventBean weexEventBean) {
    Context context = weexEventBean.getContext();
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    TabbarBadgeModule module = parseManager.parseObject(weexEventBean.getJsParams(), TabbarBadgeModule.class);
    if (context instanceof MainActivity) {
        ((MainActivity) context).setBadge(module);
    }
}
Also used : Context(android.content.Context) MainActivity(com.eros.framework.activity.MainActivity) ParseManager(com.eros.framework.manager.impl.ParseManager) TabbarBadgeModule(com.eros.framework.model.TabbarBadgeModule)

Example 2 with MainActivity

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

the class TabbarEvent method hideBadge.

private void hideBadge(WeexEventBean weexEventBean) {
    Context context = weexEventBean.getContext();
    String index = JSON.parseObject(weexEventBean.getJsParams()).get("index").toString();
    if (context instanceof MainActivity) {
        ((MainActivity) context).hideBadge(Integer.parseInt(index));
    }
}
Also used : Context(android.content.Context) MainActivity(com.eros.framework.activity.MainActivity)

Example 3 with MainActivity

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

the class TabbarEvent method openPage.

private void openPage(WeexEventBean weexEventBean) {
    Context context = weexEventBean.getContext();
    String index = JSON.parseObject(weexEventBean.getJsParams()).get("index").toString();
    RouterTracker.clearActivitySurplus(1);
    Activity activity = RouterTracker.peekActivity();
    if (activity instanceof MainActivity) {
        ((MainActivity) activity).openPage(Integer.parseInt(index));
    }
}
Also used : Context(android.content.Context) MainActivity(com.eros.framework.activity.MainActivity) Activity(android.app.Activity) MainActivity(com.eros.framework.activity.MainActivity)

Aggregations

Context (android.content.Context)3 MainActivity (com.eros.framework.activity.MainActivity)3 Activity (android.app.Activity)1 ParseManager (com.eros.framework.manager.impl.ParseManager)1 TabbarBadgeModule (com.eros.framework.model.TabbarBadgeModule)1