|
@@ -1,5 +1,6 @@
|
|
|
package com.cooleshow.teacher.adapter;
|
|
|
|
|
|
+import android.text.TextUtils;
|
|
|
import android.view.View;
|
|
|
import android.widget.ImageView;
|
|
|
import android.widget.TextView;
|
|
@@ -10,6 +11,7 @@ import com.chad.library.adapter.base.BaseQuickAdapter;
|
|
|
import com.chad.library.adapter.base.module.BaseLoadMoreModule;
|
|
|
import com.chad.library.adapter.base.module.LoadMoreModule;
|
|
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
|
|
|
+import com.cooleshow.base.utils.GlideUtils;
|
|
|
import com.cooleshow.base.utils.TimeUtils;
|
|
|
import com.cooleshow.teacher.R;
|
|
|
import com.cooleshow.teacher.bean.SystemMessageBean;
|
|
@@ -44,7 +46,21 @@ public class MessageBoxAdapter extends BaseQuickAdapter<SystemMessageBean.RowsBe
|
|
|
} else {
|
|
|
view_unread.setVisibility(View.GONE);
|
|
|
}
|
|
|
- switch (item.subType) {
|
|
|
+ loadIcon(im_type, item.img, item.subType);
|
|
|
+ }
|
|
|
+
|
|
|
+ @NonNull
|
|
|
+ @Override
|
|
|
+ public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
|
|
|
+ return new BaseLoadMoreModule(baseQuickAdapter);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void loadIcon(ImageView im_type, String img, String subType) {
|
|
|
+ if(!TextUtils.isEmpty(img)){
|
|
|
+ GlideUtils.INSTANCE.loadImage(getContext(),img,im_type,R.drawable.icon_message_other);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ switch (subType) {
|
|
|
case "TEACHER_AUTH":
|
|
|
//老师认证
|
|
|
im_type.setBackgroundResource(R.drawable.icon_message_teacher_auth);
|
|
@@ -107,11 +123,4 @@ public class MessageBoxAdapter extends BaseQuickAdapter<SystemMessageBean.RowsBe
|
|
|
im_type.setBackgroundResource(R.drawable.icon_message_other);
|
|
|
break;
|
|
|
}
|
|
|
- }
|
|
|
-
|
|
|
- @NonNull
|
|
|
- @Override
|
|
|
- public BaseLoadMoreModule addLoadMoreModule(@NonNull BaseQuickAdapter<?, ?> baseQuickAdapter) {
|
|
|
- return new BaseLoadMoreModule(baseQuickAdapter);
|
|
|
- }
|
|
|
}
|