Search in sources :

Example 11 with ParseManager

use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.

the class EventNav method nav.

public void nav(String params, Context context) {
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    NavModule navModule = parseManager.parseObject(params, NavModule.class);
    if (navModule != null) {
        String type = navModule.getType();
        if ("amap".equals(type)) {
            navByAmap(context, navModule);
        } else if ("baidu".equals(type)) {
            navByBaidumap(context, navModule);
        }
    }
}
Also used : NavModule(com.eros.framework.model.NavModule) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 12 with ParseManager

use of com.eros.framework.manager.impl.ParseManager 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 13 with ParseManager

use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.

the class EventAlert method alert.

public void alert(String options, final JSCallback callback, Context Context) {
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    ModalBean bean = parseManager.parseObject(options, ModalBean.class);
    String okTitle = bean.getOkTitle();
    if (TextUtils.isEmpty(okTitle)) {
        okTitle = Context.getResources().getString(R.string.str_ensure);
    }
    ModalManager.BmAlert.showAlert(Context, bean.getTitle(), bean.getMessage(), okTitle, new DialogInterface.OnClickListener() {

        @Override
        public void onClick(DialogInterface dialog, int which) {
            if (callback != null) {
                callback.invoke(null);
            }
        }
    }, null, null, bean.getTitleAlign(), bean.getMessageAlign());
}
Also used : ModalBean(com.eros.framework.model.ModalBean) DialogInterface(android.content.DialogInterface) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 14 with ParseManager

use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.

the class EventToast method toast.

public void toast(String options, Context Context) {
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    ModalBean bean = parseManager.parseObject(options, ModalBean.class);
    ModalManager.BmToast.toast(Context, bean.getMessage(), bean.getDuration() == 0 ? Toast.LENGTH_SHORT : bean.getDuration());
}
Also used : ModalBean(com.eros.framework.model.ModalBean) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 15 with ParseManager

use of com.eros.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.

the class AppUtils method getJsVersion.

public static String getJsVersion(Context context) {
    String jsVersion = SharePreferenceUtil.getVersion(context);
    if (TextUtils.isEmpty(jsVersion)) {
        AssetsUtil.AssetsJsVersion assetsVersionInfo = AssetsUtil.getAssetsVersionInfo(context);
        if (assetsVersionInfo != null) {
            ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
            SharePreferenceUtil.setVersion(context, parseManager.toJsonString(assetsVersionInfo));
        }
        return assetsVersionInfo == null ? "" : assetsVersionInfo.getJsVersion();
    }
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    JsVersionInfoBean jsVersionInfoBean = parseManager.parseObject(jsVersion, JsVersionInfoBean.class);
    return jsVersionInfoBean == null ? "" : jsVersionInfoBean.getJsVersion();
}
Also used : JsVersionInfoBean(com.eros.framework.model.JsVersionInfoBean) ParseManager(com.eros.framework.manager.impl.ParseManager)

Aggregations

ParseManager (com.eros.framework.manager.impl.ParseManager)20 AbstractWeexActivity (com.eros.framework.activity.AbstractWeexActivity)5 Activity (android.app.Activity)4 View (android.view.View)4 ImageView (android.widget.ImageView)4 TextView (android.widget.TextView)4 BaseResultBean (com.eros.framework.model.BaseResultBean)4 ModalBean (com.eros.framework.model.ModalBean)4 RouterModel (com.eros.framework.model.RouterModel)4 BaseToolBar (com.eros.widget.view.BaseToolBar)4 DialogInterface (android.content.DialogInterface)3 NavigatorBarModel (com.eros.framework.model.NavigatorBarModel)3 Intent (android.content.Intent)2 AxiosManager (com.eros.framework.manager.impl.AxiosManager)2 JsVersionInfoBean (com.eros.framework.model.JsVersionInfoBean)2 NatigatorModel (com.eros.framework.model.NatigatorModel)2 Context (android.content.Context)1 Bitmap (android.graphics.Bitmap)1 CompoundButton (android.widget.CompoundButton)1 JSONObject (com.alibaba.fastjson.JSONObject)1