mirror of
https://github.com/lizongying/my-tv.git
synced 2026-11-26 13:26:29 +08:00
remove left headers
This commit is contained in:
@@ -49,12 +49,12 @@ class CardPresenter(
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(viewHolder: ViewHolder, item: Any) {
|
||||
val tv = item as TV
|
||||
val tvViewModel = item as TVViewModel
|
||||
val cardView = viewHolder.view as ImageCardView
|
||||
|
||||
cardView.titleText = tv.title
|
||||
cardView.titleText = tvViewModel.title.value
|
||||
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT)
|
||||
cardView.tag = tv.videoUrl
|
||||
cardView.tag = tvViewModel.videoUrl.value
|
||||
|
||||
// lifecycleScope.launch(Dispatchers.IO) {
|
||||
// val videoThumbnail = tv.videoUrl?.let { getVideoThumbnail(it) }
|
||||
@@ -83,17 +83,17 @@ class CardPresenter(
|
||||
|
||||
private fun updateCardBackgroundColor(view: ImageCardView) {
|
||||
val currentTag = view.tag
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
delay(1000)
|
||||
if (view.isSelected && view.tag != null && currentTag == view.tag) {
|
||||
val videoThumbnail = view.tag.toString().let { getVideoThumbnail(it) }
|
||||
withContext(Dispatchers.Main) {
|
||||
if (view.isSelected && currentTag == view.tag) {
|
||||
view.mainImageView.setImageBitmap(videoThumbnail)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// lifecycleScope.launch(Dispatchers.IO) {
|
||||
// delay(1000)
|
||||
// if (view.isSelected && view.tag != null && currentTag == view.tag) {
|
||||
// val videoThumbnail = view.tag.toString().let { getVideoThumbnail(it) }
|
||||
// withContext(Dispatchers.Main) {
|
||||
// if (view.isSelected && currentTag == view.tag) {
|
||||
// view.mainImageView.setImageBitmap(videoThumbnail)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
private fun getVideoThumbnail(url: String): Bitmap? {
|
||||
@@ -112,7 +112,7 @@ class CardPresenter(
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CardPresenter"
|
||||
private const val CARD_WIDTH = 313
|
||||
private const val CARD_HEIGHT = 176
|
||||
private const val CARD_WIDTH = 300
|
||||
private const val CARD_HEIGHT = 169
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user