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);
}
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;
}
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);
}
}
}
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);
}
}
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));
}
}
Aggregations