diff --git a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java index 498a01a39..53a9d1d98 100644 --- a/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java +++ b/live/src/main/java/com/yunbao/live/adapter/LiveChatAdapter.java @@ -409,7 +409,7 @@ public class LiveChatAdapter extends RecyclerView.Adapter { new LoadDian9TuUtil().loadDian9TuAssets(mContext, mBg, 1); xydComplete.setVisibility(View.VISIBLE); textTxt2.setText(userNicenamehighlight(bean.getContent(), bean.getAtUserName(), bean.getUserNiceName())); - new LiveTextRender().getLiveLevelImage(mContext, bean.getLevel(), new ImgLoader.DrawableCallback() { + new LiveTextRender().getLiveLevelImage(mContext, bean.getLevel(), false,new ImgLoader.DrawableCallback() { @Override public void onLoadSuccess(Drawable drawable) { ImgLoader.display2(mContext, drawable, textLeave); diff --git a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java index b0340ed96..255fe860f 100644 --- a/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java +++ b/live/src/main/java/com/yunbao/live/utils/LiveTextRender.java @@ -178,7 +178,7 @@ public class LiveTextRender { } public void aiAutomaticSpeech(Context activity, TextView textView, AiAutomaticSpeechModel model) { - Log.i("AI小助手", "aiAutomaticSpeech: "+model.getIcon()); + Log.i("AI小助手", "aiAutomaticSpeech: " + model.getIcon()); ImgLoader.displayDrawable(activity, model.getIcon(), new ImgLoader.DrawableCallback() { @Override public void onLoadSuccess(Drawable drawable) { @@ -485,7 +485,7 @@ public class LiveTextRender { }); } - public void getLiveLevelImage(Context mContext, int userLevel, ImgLoader.DrawableCallback callback) { + public void getLiveLevelImage(Context mContext, int userLevel, boolean max, ImgLoader.DrawableCallback callback) { if (mContext instanceof Activity) { if (((Activity) mContext).isDestroyed()) { mContext = CommonAppContext.getTopActivity(); @@ -493,12 +493,17 @@ public class LiveTextRender { } List models = new NewLevelManager(mContext).getNewLevelModels(); String imgUrl = "https://downs.yaoulive.com/level1/img_1-9.png"; - for (NewLevelModel newLevelModel : models) { - if (newLevelModel.getLeveMin() <= userLevel && userLevel <= newLevelModel.getLeveMax()) { - imgUrl = newLevelModel.getLiveIcon(); + if (max) { + imgUrl = models.get(models.size() - 1).getLiveIcon(); + } else { + for (NewLevelModel newLevelModel : models) { + if (newLevelModel.getLeveMin() <= userLevel && userLevel <= newLevelModel.getLeveMax()) { + imgUrl = newLevelModel.getLiveIcon(); + } } } + Glide.with(mContext).asBitmap().load(imgUrl).into(new CustomTarget() { @Override public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition transition) { @@ -548,13 +553,13 @@ public class LiveTextRender { if (textView != null) { - getLiveLevelImage(context, bean.getLevel(), new ImgLoader.DrawableCallback() { + getLiveLevelImage(context, bean.getLevel(), false,new ImgLoader.DrawableCallback() { @Override public void onLoadSuccess(Drawable drawable) { SpannableStringBuilder builder = createPrefix(drawable, bean); int color = Color.parseColor("#68F1F4"); if (bean.isAnchor()) { - color =Color.parseColor("#FBEABF"); + color = Color.parseColor("#FBEABF"); } else { color = Color.parseColor("#68F1F4"); } @@ -617,11 +622,11 @@ public class LiveTextRender { mPaint.setTypeface(font); mCanvas.drawText(level, 3, 38, mPaint); } else if (level.length() == 2) { - mPaint.setTextSize(30 ); + mPaint.setTextSize(30); mPaint.setTypeface(font); mCanvas.drawText(level, 10, 38, mPaint); - }else if (level.length() == 1) { - mPaint.setTextSize(37 ); + } else if (level.length() == 1) { + mPaint.setTextSize(37); mPaint.setTypeface(font); mCanvas.drawText(level, 16, 38, mPaint); } diff --git a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java index 9d6598143..446e9ae46 100644 --- a/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java +++ b/live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java @@ -4557,7 +4557,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis enterRoomLeave2.setBackgroundResource(R.drawable.bg_100_leave); } - new LiveTextRender().getLiveLevelImage(mContext, model.getLevel(), new ImgLoader.DrawableCallback() { + new LiveTextRender().getLiveLevelImage(mContext, model.getLevel(), true,new ImgLoader.DrawableCallback() { @Override public void onLoadSuccess(Drawable drawable) { ImgLoader.display2(mContext, drawable, imageView);