Browse Source

解决删除仍显示的问题

zk 1 year ago
parent
commit
8af4684689

+ 5 - 1
app/src/main/java/com/datarecovery/master/module/imgrecover/ImageRecoverViewModel.java

@@ -391,7 +391,6 @@ public class ImageRecoverViewModel extends BaseViewModel {
                     } else {
                         return (SingleSource<Boolean>) observer -> this.dealMediaObserver = observer;
                     }
-
                 })
                 .compose(RxJavaUtil.SingleSchedule.io2Main())
                 .subscribe(new SingleObserver<Boolean>() {
@@ -406,6 +405,11 @@ public class ImageRecoverViewModel extends BaseViewModel {
                         showLoadingEvent.setValue(false);
                         if (result) {
                             for (ImageDeepDetector.ImageFile item : list) {
+                                try {
+                                    item.delete();
+                                } catch (Exception e) {
+                                    e.printStackTrace();
+                                }
                                 MutableLiveData<List<ImageDeepDetector.ImageFile>> liveData;
                                 if (item.getCategory() == ImageDeepDetector.ImageFile.CATEGORY_GALLERY) {
                                     liveData = detectedPhotoImg;

+ 0 - 7
app/src/main/java/com/datarecovery/master/utils/ImageDeepDetector.java

@@ -295,13 +295,6 @@ public class ImageDeepDetector {
 
     private static boolean isAcceptFile(XFile file) {
         try {
-            if (Objects.equals("8915a353c46c42a78a33bb9180fae9f5d7ca08392735469cb067b781cd464462.jpg", file.getName())) {
-                String path = file.getPath();
-            }
-        } catch (Exception e) {
-
-        }
-        try {
             if (file.length() == 0) {
                 return false;
             }