use of com.benmu.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.benmu.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultNavigationAdapter method setCenterItem.
public static void setCenterItem(String params, final JSCallback jscallback) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
NavigatorBarModel navigatorBarModel = parseManager.parseObject(params, NavigatorBarModel.class);
BaseToolBar navigationBar = getToolBar();
if (navigationBar == null)
return;
setTextView(navigationBar.getTitleTextView(), navigatorBarModel);
if (jscallback != null)
navigationBar.setOnTitleListenner(new BaseToolBar.OnTitleClick() {
@Override
public void onClick(View v) {
jscallback.invokeAndKeepAlive(new BaseResultBean());
}
});
}
use of com.benmu.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultShareAdapter method share.
public void share(Activity activity, String params, JSCallback success, JSCallback fail) {
if (activity == null || TextUtils.isEmpty(params))
return;
this.mAct = activity;
this.mSuccess = success;
this.mFailed = fail;
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
ShareInfoBean shareInfo = null;
try {
shareInfo = parseManager.parseObject(params, ShareInfoBean.class);
} catch (Exception e) {
e.printStackTrace();
}
if (shareInfo == null)
return;
if (shareInfo.isPopUp()) {
if (shareInfo.getPlatforms() == null || shareInfo.getPlatforms().size() > 1) {
JsPoster.postFailed("请确定分享平台", fail);
return;
}
shareDirectly(shareInfo, shareInfo.getPlatforms().get(0));
} else {
showShareDialog(shareInfo);
}
}
use of com.benmu.framework.manager.impl.ParseManager in project WeexErosFramework by bmfe.
the class DefaultRouterAdapter method open.
public boolean open(Context context, String params, JSCallback jsCallback) {
ParseManager parseManager = ManagerFactory.getManagerService(ParseManager.class);
RouterModel routerModel = parseManager.parseObject(params, RouterModel.class);
if (jsCallback != null) {
routerModel.backCallback = (SimpleJSCallback) jsCallback;
}
return !(routerModel == null || !(context instanceof Activity)) && performStartActivity((Activity) context, routerModel, Constant.BMPAGE_CATEGORY);
}
use of com.benmu.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;
}
Aggregations