This commit is contained in:
Li ZongYing 2023-12-15 14:32:02 +08:00
parent b0083722ce
commit dc5f988baa
3 changed files with 8 additions and 8 deletions

View File

@ -55,7 +55,6 @@ class CardPresenter(
cardView.titleText = tv.title
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT)
cardView.tag = tv.videoUrl
Log.i(TAG, "bind ${tv.videoUrl}")
// lifecycleScope.launch(Dispatchers.IO) {
// val videoThumbnail = tv.videoUrl?.let { getVideoThumbnail(it) }

View File

@ -102,7 +102,6 @@ class MainFragment : BrowseSupportFragment() {
)
listRowAdapter.add(v1)
idx2++
tvListViewModel.addTV(v1)
}
val header = HeaderItem(idx, k)

View File

@ -71,12 +71,15 @@ class TVViewModel(private var tv: TV) : ViewModel() {
val backgroundImage: LiveData<String>
get() = _backgroundImage
// 方法用于更新背景图信息
fun getBackgroundImage(): String {
return tv.logo ?: ""
}
fun updateBackgroundImage(url: String) {
_backgroundImage.value = url
}
fun updateVideoUrl(url: String) {
private fun updateVideoUrl(url: String) {
tv.videoUrl = listOf(url)
tv.videoIndex = 0
_videoUrl.value = listOf(url)
@ -106,10 +109,9 @@ class TVViewModel(private var tv: TV) : ViewModel() {
}
fun ysp(): String? {
if (tv.pid == "") {
return null
}
return mapping[tv.title]
}
fun getBackgroundImage(): String {
return tv.logo ?: ""
}
}