use of com.benmu.framework.model.UploadResultBean in project WeexErosFramework by bmfe.
the class AbstractWeexActivity method cameraResult.
/**
* 照片拍摄完成读取结果
*/
private void cameraResult() {
ImagePicker.galleryAddPic(this, this.imagePicker.getTakeImageFile());
String path = this.imagePicker.getTakeImageFile().getAbsolutePath();
int degree = BitmapUtil.getBitmapDegree(path);
if (degree != 0) {
Bitmap bitmap = BitmapUtil.rotateBitmapByDegree(path, degree);
if (bitmap != null) {
File file = new File(path);
try {
FileOutputStream bos = new FileOutputStream(file);
bitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos);
bos.flush();
bos.close();
} catch (IOException var9) {
var9.printStackTrace();
}
}
}
UploadResultBean uploadResultBean = new UploadResultBean();
uploadResultBean.resCode = 0;
uploadResultBean.msg = "拍照成功";
List<String> dataList = new ArrayList<>();
dataList.add(path);
uploadResultBean.setData(dataList);
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(uploadResultBean);
}
use of com.benmu.framework.model.UploadResultBean in project WeexErosFramework by bmfe.
the class AbstractWeexActivity method pickReturn.
/**
* 选择图片结果返回。
*/
private void pickReturn(ArrayList<ImageItem> items) {
UploadResultBean bean = new UploadResultBean();
List<String> data = new ArrayList<>();
for (ImageItem path : items) {
data.add(path.path);
}
bean.data = data;
ManagerFactory.getManagerService(DispatchEventManager.class).getBus().post(bean);
}
use of com.benmu.framework.model.UploadResultBean in project WeexErosFramework by bmfe.
the class AxiosManager method resultBean.
/**
* 组合返回给前端的Js 数据
*/
public UploadResultBean resultBean(int code, String message, ArrayList<String> arrayList) {
UploadResultBean uploadResultBean = new UploadResultBean();
uploadResultBean.resCode = code;
uploadResultBean.msg = message;
uploadResultBean.setData(arrayList);
return uploadResultBean;
}
Aggregations