monitoring null drawable issue

This commit is contained in:
houxg
2017-02-17 20:10:47 +08:00
parent f616101010
commit acc1bc5cf1

View File

@@ -26,6 +26,8 @@ import android.widget.TextView;
import com.bumptech.glide.Glide;
import com.elvishew.xlog.XLog;
import com.tencent.bugly.Bugly;
import com.tencent.bugly.crashreport.CrashReport;
import org.houxg.leamonax.R;
import org.houxg.leamonax.adapter.AccountAdapter;
@@ -163,6 +165,11 @@ public class Navigation {
private void animateChangeAccount(View v, final Account account) {
ImageView itemAvatar = (ImageView) v.findViewById(R.id.iv_avatar);
if (itemAvatar.getDrawable() == null) {
CrashReport.postCatchedException(new IllegalStateException("account item's drawable is null"));
changeAccount(account);
return;
}
final ViewGroup rootView = (ViewGroup) mActivity.getWindow().getDecorView().getRootView();
float preSize = DisplayUtils.dp2px(30);
@@ -350,6 +357,7 @@ public class Navigation {
Glide.with(mActivity)
.load(account.getAvatar())
.centerCrop()
.placeholder(mAlphabetDrawable)
.bitmapTransform(new CropCircleTransformation(mActivity))
.into(mAvatarIv);
} else {