Commit f7358530 by 严久程

导医入口

parent 9a54da45
......@@ -8,15 +8,15 @@ ext {
"m-confide" : "0.0.48.74",
"m-consultant" : "0.0.59.31",
"m-fm" : "0.0.30.00",
"m-user" : "0.0.60.22",
"m-home" : "0.0.22.20",
"m-user" : "0.0.60.23",
"m-home" : "0.0.22.30",
"m-im" : "0.0.18.15",
"m-dynamic" : "0.0.7.13",
"m-article" : "0.0.0.6",
"m-muse" : "0.0.28.20",
"m-tests" : "0.0.24.10",
"m-course" : "0.0.42.9",
"m-course" : "0.0.42.14",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
......
......@@ -18,6 +18,7 @@ public class CourseNewListAdapter extends CommonAdapter<Course> {
private Context context;
private int guideImageIndex = 0;
private int lastPosition = 0;
private List<GuideBean> guideList = new ArrayList<>();
public CourseNewListAdapter(Context context) {
......@@ -33,6 +34,12 @@ public class CourseNewListAdapter extends CommonAdapter<Course> {
}
public void refreshLatPosition() {
lastPosition = 0;
guideImageIndex = 0;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
if (convertView == null) {
......@@ -41,24 +48,36 @@ public class CourseNewListAdapter extends CommonAdapter<Course> {
((CourseItemNewView) convertView).setData(mDataList.get(position));
((CourseItemNewView) convertView).setBottomLineVisible();
if ((position + 1) % 10 == 0) {
GuideBean bean = getGuideData();
GuideBean bean = getGuideData(position);
if (bean != null) {
((CourseItemNewView) convertView).setGuideData(bean);
((CourseItemNewView) convertView).setGuideData(bean.pic, bean.location);
}
} else {
((CourseItemNewView) convertView).setGuideGone();
}
return convertView;
}
private GuideBean getGuideData() {
private GuideBean getGuideData(int position) {
if (guideList.size() == 0) {
return null;
}
if (position % 3 == 0) {
guideImageIndex = 0;
}
if (position % 3 == 1) {
guideImageIndex = 1;
}
if (position % 3 == 2) {
guideImageIndex = 2;
}
GuideBean bean = null;
if (guideImageIndex >= guideList.size() - 1) {
guideImageIndex = 0;
}
bean = guideList.get(guideImageIndex);
guideImageIndex++;
return bean;
}
......
......@@ -474,6 +474,9 @@ class CourseListContainerActivity : BaseActivity(), PtrHandler, LoadMoreHandler
} else {
page = 1
hasMore = true
if (adapter!=null){
adapter?.refreshLatPosition()
}
}
getCourses(loadMore)
}
......
......@@ -18,16 +18,12 @@ import com.ydl.media.view.PlayerFloatHelper
import com.ydl.media.view.PlayerFloatView
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydlcommon.modular.ModularServiceManager.provide
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.GuideBean
import com.yidianling.course.CourseConstants
import com.yidianling.course.R
import com.yidianling.course.bean.Course
......@@ -77,7 +73,6 @@ class CourseItemNewView : ConstraintLayout {
}
}
iv_guide_image.visibility = View.GONE
GlideApp.with(mContext)
.load(headUrl)
.into(iv_head)
......@@ -250,19 +245,33 @@ class CourseItemNewView : ConstraintLayout {
}
fun setGuideData(bean: GuideBean) {
fun setGuideData(pic: String, location: String) {
view_bottom_line.visibility = View.INVISIBLE
iv_guide_image.visibility = View.VISIBLE
GlideApp.with(mContext)
.load(bean.pic)
.load(pic)
.into(iv_guide_image)
iv_guide_image.setOnClickListener {
provide(IConsultantService::class.java).jumpConsultAssistant(mContext as Activity, bean.location.toInt())
provide(IConsultantService::class.java).jumpConsultAssistant(
mContext as Activity,
location.toInt()
)
}
}
fun setGuideGone(){
iv_guide_image.visibility = View.GONE
}
fun isGuideVisible(): Boolean {
return iv_guide_image.visibility == View.VISIBLE
}
private fun playMedia() {
if (PlayerFloatHelper.isShow(mContext)) {
PlayerFloatHelper.hide()
......
......@@ -241,7 +241,6 @@
android:layout_height="90dp"
android:visibility="gone"
android:layout_marginTop="20dp"
tools:visibility="visible"
app:pa_borderRadius="8dp"
app:pa_type="pa_round"
android:layout_marginStart="2dp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment