|
@@ -9,7 +9,9 @@ import com.kfzs.appstore.utils.string.HexUtils;
|
|
|
import com.kfzs.duanduan.react.upfile.UpFileListener;
|
|
import com.kfzs.duanduan.react.upfile.UpFileListener;
|
|
|
import com.kfzs.duanduan.react.upfile.UpFileUtils;
|
|
import com.kfzs.duanduan.react.upfile.UpFileUtils;
|
|
|
import com.sheep.gamegroup.model.entity.UploadResult;
|
|
import com.sheep.gamegroup.model.entity.UploadResult;
|
|
|
|
|
+import com.sheep.gamegroup.util.ListUtil;
|
|
|
import com.sheep.gamegroup.view.dialog.DialogShowLoading;
|
|
import com.sheep.gamegroup.view.dialog.DialogShowLoading;
|
|
|
|
|
+import com.sheep.jiuyan.samllsheep.utils.G;
|
|
|
import com.yalantis.ucrop.UCrop;
|
|
import com.yalantis.ucrop.UCrop;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.File;
|
|
@@ -55,6 +57,31 @@ public abstract class AbsChooseImageActivity extends BaseActivity implements UpF
|
|
|
.setPreviewEnabled(true)
|
|
.setPreviewEnabled(true)
|
|
|
.start(this, PhotoPicker.REQUEST_CODE);
|
|
.start(this, PhotoPicker.REQUEST_CODE);
|
|
|
}
|
|
}
|
|
|
|
|
+ public void showChooseDialog(boolean isCrop, boolean isUpload, int photoCount, File dir) {
|
|
|
|
|
+ if(dir.exists() && dir.listFiles().length > 0) {
|
|
|
|
|
+ photoCount = Math.max(1, photoCount);
|
|
|
|
|
+ this.isUpload = isUpload;
|
|
|
|
|
+ this.isCrop = isCrop && photoCount == 1;
|
|
|
|
|
+ this.photoCount = photoCount;
|
|
|
|
|
+ this.photos = null;
|
|
|
|
|
+ this.path = null;
|
|
|
|
|
+ this.urls.clear();
|
|
|
|
|
+ PhotoPicker.builder()
|
|
|
|
|
+ .setPhotoCount(photoCount)
|
|
|
|
|
+ .setShowCamera(showCamera)
|
|
|
|
|
+ .setShowGif(false)
|
|
|
|
|
+ .setPreviewEnabled(true)
|
|
|
|
|
+ .setPicker(ListUtil.asList(new ListUtil.CallBack<File, String>() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String call(File file) {
|
|
|
|
|
+ return file.getAbsolutePath();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, dir.listFiles()))
|
|
|
|
|
+ .start(this, PhotoPicker.REQUEST_CODE);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ G.showToast("暂无截图");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
private boolean showCamera = false;
|
|
private boolean showCamera = false;
|
|
|
|
|
|
|
|
public void setShowCamera(boolean showCamera) {
|
|
public void setShowCamera(boolean showCamera) {
|