From 57b6ff7283b5667da0d3df1810b1e4eb5d15242f Mon Sep 17 00:00:00 2001 From: tateisu Date: Sun, 21 May 2017 10:31:58 +0900 Subject: [PATCH] =?UTF-8?q?=E7=94=BB=E5=83=8F=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E4=B8=AD=E3=81=ABView=E3=81=A8=E7=94=BB=E5=83=8FURL=E3=81=AE?= =?UTF-8?q?=E7=B5=84=E3=81=BF=E5=90=88=E3=82=8F=E3=81=9B=E3=81=8C=E5=A4=89?= =?UTF-8?q?=E3=82=8F=E3=81=A3=E3=81=9F=E3=82=89=E3=83=AD=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=9F=E7=94=BB=E5=83=8F=E3=82=92=E7=84=A1?= =?UTF-8?q?=E8=A6=96=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 4 ++-- .../subwaytooter/view/MyNetworkImageView.java | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 48e0d96e..461ab5b3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "jp.juggler.subwaytooter" minSdkVersion 21 targetSdkVersion 25 - versionCode 63 - versionName "0.6.3" + versionCode 64 + versionName "0.6.4" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/jp/juggler/subwaytooter/view/MyNetworkImageView.java b/app/src/main/java/jp/juggler/subwaytooter/view/MyNetworkImageView.java index 18370671..60217aa6 100644 --- a/app/src/main/java/jp/juggler/subwaytooter/view/MyNetworkImageView.java +++ b/app/src/main/java/jp/juggler/subwaytooter/view/MyNetworkImageView.java @@ -12,8 +12,6 @@ import android.view.ViewGroup; import android.support.v7.widget.AppCompatImageView; import com.bumptech.glide.Glide; -import com.bumptech.glide.load.resource.drawable.GlideDrawable; -import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.animation.GlideAnimation; import com.bumptech.glide.request.target.SimpleTarget; import com.bumptech.glide.request.target.Target; @@ -21,6 +19,7 @@ import com.bumptech.glide.request.target.Target; import java.util.concurrent.atomic.AtomicBoolean; import jp.juggler.subwaytooter.Pref; +import jp.juggler.subwaytooter.util.Utils; public class MyNetworkImageView extends AppCompatImageView { @@ -144,6 +143,9 @@ public class MyNetworkImageView extends AppCompatImageView { .into( new SimpleTarget< Bitmap >( desiredWidth, desiredHeight ) { @Override public void onLoadFailed( Exception e, Drawable errorDrawable ){ + // このViewは別の画像を表示するように指定が変わっていた + if( mTargetUrl == null || ! mTargetUrl.equals( mUrl ) ) return; + e.printStackTrace(); if( mErrorImageId != 0 ) setImageResource( mErrorImageId ); } @@ -154,14 +156,16 @@ public class MyNetworkImageView extends AppCompatImageView { ){ if( isImmediate.get() && isInLayoutPass ){ post( new Runnable() { - @Override - public void run(){ + @Override public void run(){ onResourceReady( bitmap, glideAnimation ); } } ); return; } + // このViewは別の画像を表示するように指定が変わっていた + if( mTargetUrl == null || ! mTargetUrl.equals( mUrl ) ) return; + if( bitmap == null ){ setDefaultImageOrNull(); }else if( mCornerRadius <= 0f ){