Search in sources :

Example 6 with ParseManager

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

the class DefaultImageAdapter method UpMultipleImageData.

public void UpMultipleImageData(Context context, ArrayList<ImageItem> items, UploadImageBean bean) {
    ModalManager.BmLoading.showLoading(context, null, false);
    ArrayList imagesFilrUrl = new ArrayList();
    if (items != null && items.size() > 0) {
        for (ImageItem item : items) {
            Bitmap bitmap = ImageUtil.getBitmap(item.path, context);
            // TODO 图片改为全路径
            String path = new File(FileManager.getTempFilePath(context), String.valueOf(SystemClock.currentThreadTimeMillis())).getAbsolutePath();
            String imageFileUrl = ImageUtil.zoomImage(context, bitmap, bean == null ? 0 : (int) bean.imageWidth, Constant.ImageConstants.BIGGESTWIDTH, path);
            imagesFilrUrl.add(imageFileUrl);
            bitmap.recycle();
        }
    }
    HashMap<String, String> uploadParams = null;
    HashMap<String, String> heads = null;
    if (bean != null) {
        String params = bean.params;
        ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
        uploadParams = parseManager.parseObject(params, HashMap.class);
        heads = parseManager.parseObject(bean.header, HashMap.class);
    }
    AxiosManager axiosManager = ManagerFactory.getManagerService(AxiosManager.class);
    String url = TextUtils.isEmpty(bean.url) ? Api.UPLOAD_URL : bean.url;
    axiosManager.upload(url, imagesFilrUrl, uploadParams, heads);
}
Also used : Bitmap(android.graphics.Bitmap) AxiosManager(com.eros.framework.manager.impl.AxiosManager) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ImageItem(com.lzy.imagepicker.bean.ImageItem) ParseManager(com.eros.framework.manager.impl.ParseManager) File(java.io.File)

Example 7 with ParseManager

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

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

the class DefaultRouterAdapter method toWebView.

public void toWebView(Context context, String params) {
    if (TextUtils.isEmpty(params))
        return;
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    WebViewParamBean webViewParamBean = parseManager.parseObject(params, WebViewParamBean.class);
    String title = webViewParamBean.getTitle();
    Intent intent = new Intent(Intent.ACTION_VIEW);
    intent.addCategory(getWebViewCategory(context));
    String type = webViewParamBean.getType() == null ? Constant.ACTIVITIES_ANIMATION.ANIMATION_PUSH : webViewParamBean.getType();
    RouterModel routerModel = new RouterModel(null, type, null, title, webViewParamBean.isNavShow(), null);
    intent.putExtra(Constant.ROUTERPARAMS, routerModel);
    intent.putExtra(Constant.WEBVIEW_PARAMS, webViewParamBean);
    if (context instanceof Activity) {
        Activity activity = (Activity) context;
        activity.startActivity(intent);
        if (Constant.ACTIVITIES_ANIMATION.ANIMATION_PUSH.equals(routerModel.type)) {
            activity.overridePendingTransition(R.anim.right_in, R.anim.view_stay);
        } else if (Constant.ACTIVITIES_ANIMATION.ANIMATION_PRESENT.equals(routerModel.type)) {
            activity.overridePendingTransition(R.anim.bottom_in, R.anim.view_stay);
        } else if (Constant.ACTIVITIES_ANIMATION.ANIMATION_TRANSLATION.equals(routerModel.type)) {
            activity.overridePendingTransition(R.anim.left_in, R.anim.view_stay);
        } else {
            activity.overridePendingTransition(R.anim.right_in, R.anim.view_stay);
        }
    }
}
Also used : RouterModel(com.eros.framework.model.RouterModel) AbstractWeexActivity(com.eros.framework.activity.AbstractWeexActivity) Activity(android.app.Activity) Intent(android.content.Intent) ParseManager(com.eros.framework.manager.impl.ParseManager) WebViewParamBean(com.eros.framework.model.WebViewParamBean)

Example 9 with ParseManager

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

the class DefaultRouterAdapter method dialing.

public void dialing(final Context context, String params) {
    ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
    CallPhoneBean callPhone = null;
    callPhone = parseManager.parseObject(params, CallPhoneBean.class);
    if (callPhone == null) {
        callPhone = new CallPhoneBean();
        callPhone.to = "110";
    }
    if (TextUtils.isEmpty(callPhone.to) || context == null)
        return;
    final String finalPhone = callPhone.to;
    if (!callPhone.tip) {
        callPhone(String.valueOf(finalPhone), context);
    } else {
        ModalManager.BmAlert.showAlert(context, null, String.valueOf(finalPhone), "呼叫", new DialogInterface.OnClickListener() {

            @Override
            public void onClick(DialogInterface dialog, int which) {
                callPhone(String.valueOf(finalPhone), context);
                dialog.dismiss();
            }
        }, "取消", null, null, null);
    }
}
Also used : CallPhoneBean(com.eros.framework.model.CallPhoneBean) DialogInterface(android.content.DialogInterface) ParseManager(com.eros.framework.manager.impl.ParseManager)

Example 10 with ParseManager

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

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