|
@@ -3,18 +3,19 @@ package com.cooleshow.teacher.adapter
|
|
import android.annotation.SuppressLint
|
|
import android.annotation.SuppressLint
|
|
import android.text.TextUtils
|
|
import android.text.TextUtils
|
|
import android.view.View
|
|
import android.view.View
|
|
|
|
+import android.view.ViewGroup
|
|
import android.widget.ImageView
|
|
import android.widget.ImageView
|
|
import android.widget.TextView
|
|
import android.widget.TextView
|
|
|
|
+import androidx.recyclerview.widget.RecyclerView
|
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
|
import com.chad.library.adapter.base.BaseQuickAdapter
|
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
|
import com.chad.library.adapter.base.viewholder.BaseViewHolder
|
|
import com.cooleshow.base.ext.setVisible
|
|
import com.cooleshow.base.ext.setVisible
|
|
import com.cooleshow.base.utils.GlideUtils
|
|
import com.cooleshow.base.utils.GlideUtils
|
|
-import com.cooleshow.base.utils.TimeUtils
|
|
|
|
|
|
+import com.cooleshow.base.utils.SizeUtils
|
|
import com.cooleshow.base.utils.UiUtils
|
|
import com.cooleshow.base.utils.UiUtils
|
|
import com.cooleshow.teacher.R
|
|
import com.cooleshow.teacher.R
|
|
import com.cooleshow.teacher.bean.CourseTableDataBean
|
|
import com.cooleshow.teacher.bean.CourseTableDataBean
|
|
import com.cooleshow.teacher.helper.CourseHelper
|
|
import com.cooleshow.teacher.helper.CourseHelper
|
|
-import kotlin.math.abs
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* Author by pq, Date on 2022/4/21.
|
|
* Author by pq, Date on 2022/4/21.
|
|
@@ -145,7 +146,11 @@ class CourseTableListAdapter(layoutResId: Int) :
|
|
|
|
|
|
COMPLETE -> {
|
|
COMPLETE -> {
|
|
//已完成
|
|
//已完成
|
|
- if (TextUtils.equals(VIP_COURSE, data?.courseType) || TextUtils.equals(OTHER_COURSE, data?.courseType)) {
|
|
|
|
|
|
+ if (TextUtils.equals(VIP_COURSE, data?.courseType) || TextUtils.equals(
|
|
|
|
+ OTHER_COURSE,
|
|
|
|
+ data?.courseType
|
|
|
|
+ )
|
|
|
|
+ ) {
|
|
tvCourseStatusBt.setVisible(true)
|
|
tvCourseStatusBt.setVisible(true)
|
|
} else {
|
|
} else {
|
|
//直播课隐藏
|
|
//直播课隐藏
|
|
@@ -165,6 +170,25 @@ class CourseTableListAdapter(layoutResId: Int) :
|
|
tvCourseStatusBt.setTextColor(context.resources.getColor(com.cooleshow.base.R.color.color_2dc7aa))
|
|
tvCourseStatusBt.setTextColor(context.resources.getColor(com.cooleshow.base.R.color.color_2dc7aa))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ val csRoot = baseViewHolder.getView<ViewGroup>(R.id.cs_root);
|
|
|
|
+ val layoutParams: RecyclerView.LayoutParams =
|
|
|
|
+ csRoot.layoutParams as RecyclerView.LayoutParams
|
|
|
|
+ if (this.data.size - 1 != baseViewHolder.layoutPosition) {
|
|
|
|
+ layoutParams.setMargins(
|
|
|
|
+ SizeUtils.dp2px(14f),
|
|
|
|
+ SizeUtils.dp2px(12f),
|
|
|
|
+ SizeUtils.dp2px(14f),
|
|
|
|
+ SizeUtils.dp2px(0f)
|
|
|
|
+ )
|
|
|
|
+ } else {
|
|
|
|
+ layoutParams.setMargins(
|
|
|
|
+ SizeUtils.dp2px(14f),
|
|
|
|
+ SizeUtils.dp2px(12f),
|
|
|
|
+ SizeUtils.dp2px(14f),
|
|
|
|
+ SizeUtils.dp2px(12f)
|
|
|
|
+ )
|
|
|
|
+ }
|
|
|
|
+ csRoot.layoutParams = layoutParams;
|
|
}
|
|
}
|
|
|
|
|
|
fun setConfigData(sysConfig: CourseTableDataBean.SysConfigBean?) {
|
|
fun setConfigData(sysConfig: CourseTableDataBean.SysConfigBean?) {
|