|
|
@@ -371,12 +371,9 @@ public class ImageRecoverViewModel extends BaseViewModel {
|
|
|
List<ImageDeepDetector.ImageFile> itemList = getList(liveData);
|
|
|
itemList.remove(item);
|
|
|
}
|
|
|
- detectedPhotoImg.postValue(getList(detectedPhotoImg));
|
|
|
- detectedWxImg.postValue(getList(detectedWxImg));
|
|
|
- detectedQQImg.postValue(getList(detectedQQImg));
|
|
|
- detectedOtherImg.postValue(getList(detectedOtherImg));
|
|
|
list.removeAll(pair.first);
|
|
|
selectedList.postValue(list);
|
|
|
+ notifyList.postValue(null);
|
|
|
}
|
|
|
return pair.second;
|
|
|
})
|
|
|
@@ -407,17 +404,27 @@ public class ImageRecoverViewModel extends BaseViewModel {
|
|
|
@Override
|
|
|
public void onSuccess(@NonNull Boolean result) {
|
|
|
showLoadingEvent.setValue(false);
|
|
|
- detectedPhotoImg.setValue(getList(detectedPhotoImg));
|
|
|
- detectedWxImg.setValue(getList(detectedWxImg));
|
|
|
- detectedQQImg.setValue(getList(detectedQQImg));
|
|
|
- detectedOtherImg.setValue(getList(detectedOtherImg));
|
|
|
- ToastUtil.show(R.string.delete_success, ToastUtil.LENGTH_SHORT);
|
|
|
- checkAll.setValue(false);
|
|
|
if (result) {
|
|
|
+ for (ImageDeepDetector.ImageFile item : list) {
|
|
|
+ MutableLiveData<List<ImageDeepDetector.ImageFile>> liveData;
|
|
|
+ if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_GALLERY) {
|
|
|
+ liveData = detectedPhotoImg;
|
|
|
+ } else if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_WECHAT) {
|
|
|
+ liveData = detectedWxImg;
|
|
|
+ } else if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_QQ) {
|
|
|
+ liveData = detectedQQImg;
|
|
|
+ } else {
|
|
|
+ liveData = detectedOtherImg;
|
|
|
+ }
|
|
|
+ List<ImageDeepDetector.ImageFile> itemList = getList(liveData);
|
|
|
+ itemList.remove(item);
|
|
|
+ }
|
|
|
+ ToastUtil.show(R.string.delete_success, ToastUtil.LENGTH_SHORT);
|
|
|
list.clear();
|
|
|
selectedList.setValue(list);
|
|
|
+ notifyList.call();
|
|
|
}
|
|
|
- notifyList.call();
|
|
|
+ checkAll.setValue(false);
|
|
|
}
|
|
|
|
|
|
@Override
|