diff --git a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java index bb5fbc53c..fdbe5d2b4 100644 --- a/common/src/main/java/com/yunbao/common/glide/ImgLoader.java +++ b/common/src/main/java/com/yunbao/common/glide/ImgLoader.java @@ -12,10 +12,15 @@ import androidx.annotation.Nullable; import com.bumptech.glide.Glide; import com.bumptech.glide.RequestBuilder; +import com.bumptech.glide.load.DataSource; +import com.bumptech.glide.load.engine.GlideException; +import com.bumptech.glide.request.RequestListener; import com.bumptech.glide.request.RequestOptions; import com.bumptech.glide.request.target.CustomTarget; +import com.bumptech.glide.request.target.Target; import com.bumptech.glide.request.transition.Transition; import com.yunbao.common.R; +import com.yunbao.common.utils.StringUtil; import java.io.File; @@ -152,7 +157,13 @@ public class ImgLoader { if (!contextIsExist(context) || imageView == null) { return; } - + if(StringUtil.isEmpty(url)){ + return; + } + if (!url.startsWith("http")) { + imageView.setImageResource(R.mipmap.chat_head_mo); + return; + } RequestBuilder builder = Glide.with(context) .load(url) .thumbnail(thumbnail) diff --git a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java index b2ce2fc78..fea3d1712 100644 --- a/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java +++ b/main/src/main/java/com/yunbao/main/views/MainMeViewHolder.java @@ -128,7 +128,7 @@ public class MainMeViewHolder extends AbsMainViewHolder implements OnItemClickLi @SuppressLint("WrongViewCast") @Override public void init() { - mAvatar = (ImageView) findViewById(R.id.avatar); + mAvatar = (ImageView) findViewById(R.id.edit_me_avatar); redPoint = findViewById(R.id.red_point); ViewClicksAntiShake.clicksAntiShake(mAvatar, new ViewClicksAntiShake.ViewClicksCallBack() { @Override diff --git a/main/src/main/res/layout/view_main_me.xml b/main/src/main/res/layout/view_main_me.xml index 033f99346..e862b751c 100644 --- a/main/src/main/res/layout/view_main_me.xml +++ b/main/src/main/res/layout/view_main_me.xml @@ -212,7 +212,7 @@ android:gravity="center|right">