From 618e629ef3c8e9899cd8e524e743cd2a2a478b3f Mon Sep 17 00:00:00 2001 From: "Gao.QiLin" Date: Sun, 20 Aug 2017 13:51:05 +0800 Subject: [PATCH] fixed RN-0.43+bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复0.43+android不支持情况 --- .../main/java/cn/reactnative/httpcache/HttpCacheModule.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/android/src/main/java/cn/reactnative/httpcache/HttpCacheModule.java b/android/src/main/java/cn/reactnative/httpcache/HttpCacheModule.java index fea1db7..905d7c5 100644 --- a/android/src/main/java/cn/reactnative/httpcache/HttpCacheModule.java +++ b/android/src/main/java/cn/reactnative/httpcache/HttpCacheModule.java @@ -66,7 +66,8 @@ private void updateCacheSize(DiskStorageCache cache) throws NoSuchMethodExceptio @ReactMethod public void getImageCacheSize(Promise promise){ - FileCache cache1 = ImagePipelineFactory.getInstance().getMainDiskStorageCache(); + //FileCache cache1 = ImagePipelineFactory.getInstance().getMainDiskStorageCache(); + FileCache cache1 = ImagePipelineFactory.getInstance().getMainFileCache(); // fixed RN-0.43+ long size1 = cache1.getSize(); if (size1 < 0){ try { @@ -77,7 +78,8 @@ public void getImageCacheSize(Promise promise){ } size1 = cache1.getSize(); } - FileCache cache2 = ImagePipelineFactory.getInstance().getSmallImageDiskStorageCache(); + //FileCache cache2 = ImagePipelineFactory.getInstance().getSmallImageDiskStorageCache(); + FileCache cache2 = ImagePipelineFactory.getInstance().getSmallImageFileCache(); //fixed RN-0.43+ long size2 = cache2.getSize(); if (size2 < 0){ try {