lmw
2025-04-24 718f31c92e2029d05260810435a2c70cef6e6ce5
app/src/main/java/com/sinata/xqmuse/ui/course/CourseDetailActivity.kt
@@ -28,6 +28,7 @@
import com.sinata.xqmuse.ui.course.adapter.ChapterAdapter
import com.sinata.xqmuse.ui.course.adapter.CourseGridAdapter
import com.sinata.xqmuse.utils.AppBarStateChangeListener
import com.sinata.xqmuse.utils.Const
import com.sinata.xqmuse.utils.interfaces.StringCallback
import com.umeng.socialize.bean.SHARE_MEDIA
import kotlinx.android.synthetic.main.activity_course_deatil.*
@@ -79,11 +80,11 @@
                override fun onResult(rst: String) {
                    if (rst == "wx"){
                        ShareUtils.share(this@CourseDetailActivity,
                            SHARE_MEDIA.WEIXIN,data?.courseTitle,"分享你一个课程",
                            SHARE_MEDIA.WEIXIN,data?.courseTitle, Const.SHARE.SHARE_COURSE_TITLE,
                            Apis.SHARE_COURSE.format(data?.id),null,"")
                    }else{
                        ShareUtils.share(this@CourseDetailActivity,
                            SHARE_MEDIA.WEIXIN_CIRCLE,data?.courseTitle,"分享你一个课程",
                            SHARE_MEDIA.WEIXIN_CIRCLE,data?.courseTitle,Const.SHARE.SHARE_COURSE_TITLE,
                            Apis.SHARE_COURSE.format(data?.id),null,"")
                    }
                }
@@ -102,7 +103,7 @@
            scroll2Position(2)
            checkTab(2)
        }
        scrollView.setOnScrollChangeListener { v: NestedScrollView?, scrollX: Int, scrollY: Int, oldScrollX: Int, oldScrollY: Int ->
        scrollView.setOnScrollChangeListener { _: NestedScrollView?, _: Int, scrollY: Int, _: Int, _: Int ->
            if (!scrollByTab)
                when {
                    scrollY>=tv_2.top -> checkTab(2)
@@ -110,13 +111,13 @@
                    else -> checkTab(0)
                }
        }
        chapterAdapter.setOnItemClickListener { view, position ->
        chapterAdapter.setOnItemClickListener { _, position ->
            if (tv_action.text == "立即学习")
                startActivity<StudyActivity>("id" to data?.list?.get(position)?.id,"index" to position)
            else
                getData(false)
        }
        courseAdapter.setOnItemClickListener { view, position ->
        courseAdapter.setOnItemClickListener { _, position ->
            showDialog()
            HttpManager.getPayCourseInfoById(courseList[position].id?:"").request(this,success = { _, data->
                dismissDialog()
@@ -154,11 +155,17 @@
                    State.EXPANDED -> {
                        //展开状态
                        iv_back.imageResource = R.mipmap.icon_back_white
                        iv_share.imageResource = R.mipmap.ic_share
                        if (data?.isCollect!=1)
                            iv_collect.imageResource = R.mipmap.uncollect
                        tvTitle.textColorResource = R.color.white
                    }
                    State.COLLAPSED -> {
                        //折叠状态
                        iv_back.imageResource = R.mipmap.back
                        iv_share.imageResource = R.mipmap.ic_share_black
                        if (data?.isCollect!=1)
                            iv_collect.imageResource = R.mipmap.uncollect_b
                        tvTitle.textColorResource = R.color.textColor
                    }
                }