From 3b6219a873e9f9f46817438d0593bf9366084dc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E4=B8=9C=E9=B2=81?= Date: Wed, 25 May 2016 22:34:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96..?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PhotoPicker/build.gradle | 2 +- .../java/me/iwf/photopicker/adapter/PhotoGridAdapter.java | 6 ++++++ .../me/iwf/photopicker/fragment/ImagePagerFragment.java | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/PhotoPicker/build.gradle b/PhotoPicker/build.gradle index 572c863..8584725 100644 --- a/PhotoPicker/build.gradle +++ b/PhotoPicker/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion 23 - buildToolsVersion "23.0.2" + buildToolsVersion "23.0.3" resourcePrefix "__picker_" defaultConfig { diff --git a/PhotoPicker/src/main/java/me/iwf/photopicker/adapter/PhotoGridAdapter.java b/PhotoPicker/src/main/java/me/iwf/photopicker/adapter/PhotoGridAdapter.java index 3303f2b..cf0a178 100644 --- a/PhotoPicker/src/main/java/me/iwf/photopicker/adapter/PhotoGridAdapter.java +++ b/PhotoPicker/src/main/java/me/iwf/photopicker/adapter/PhotoGridAdapter.java @@ -199,4 +199,10 @@ public void setShowCamera(boolean hasCamera) { public boolean showCamera() { return (hasCamera && currentDirectoryIndex == MediaStoreHelper.INDEX_ALL_PHOTOS); } + + @Override public void onViewDetachedFromWindow(PhotoViewHolder holder) { + super.onViewDetachedFromWindow(holder); + + Glide.clear(holder.ivPhoto); + } } diff --git a/PhotoPicker/src/main/java/me/iwf/photopicker/fragment/ImagePagerFragment.java b/PhotoPicker/src/main/java/me/iwf/photopicker/fragment/ImagePagerFragment.java index 12cb01a..be89b84 100644 --- a/PhotoPicker/src/main/java/me/iwf/photopicker/fragment/ImagePagerFragment.java +++ b/PhotoPicker/src/main/java/me/iwf/photopicker/fragment/ImagePagerFragment.java @@ -301,5 +301,7 @@ public int getCurrentItem() { paths.clear(); paths = null; + + mViewPager.setAdapter(null); } }