mirror of
https://github.com/lizongying/my-tv.git
synced 2026-10-26 22:26:29 +08:00
clean
This commit is contained in:
@@ -2,7 +2,6 @@ package com.lizongying.mytv
|
||||
|
||||
import android.graphics.Bitmap
|
||||
import android.media.MediaMetadataRetriever
|
||||
import android.util.Log
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.view.ViewGroup
|
||||
import androidx.leanback.widget.ImageCardView
|
||||
@@ -13,11 +12,6 @@ import kotlinx.coroutines.delay
|
||||
import kotlinx.coroutines.launch
|
||||
import kotlinx.coroutines.withContext
|
||||
|
||||
|
||||
/**
|
||||
* A CardPresenter is used to generate Views and bind Objects to them on demand.
|
||||
* It contains an ImageCardView.
|
||||
*/
|
||||
class CardPresenter(private val lifecycleScope: LifecycleCoroutineScope) : Presenter() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup): ViewHolder {
|
||||
@@ -91,9 +85,7 @@ class CardPresenter(private val lifecycleScope: LifecycleCoroutineScope) : Prese
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CardPresenter"
|
||||
|
||||
private const val CARD_WIDTH = 313
|
||||
|
||||
private const val CARD_HEIGHT = 176
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,6 @@ package com.lizongying.mytv
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
|
||||
data class Info(
|
||||
var rowPosition: Int = 0,
|
||||
var itemPosition: Int = 0,
|
||||
|
||||
@@ -13,10 +13,6 @@ import android.widget.Toast
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.fragment.app.FragmentActivity
|
||||
|
||||
|
||||
/**
|
||||
* Loads [MainFragment].
|
||||
*/
|
||||
class MainActivity : FragmentActivity() {
|
||||
|
||||
private val playbackFragment = PlaybackFragment()
|
||||
|
||||
@@ -18,9 +18,6 @@ import androidx.leanback.widget.Row
|
||||
import androidx.leanback.widget.RowPresenter
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
|
||||
/**
|
||||
* Loads a grid of cards with movies to browse.
|
||||
*/
|
||||
class MainFragment : BrowseSupportFragment() {
|
||||
|
||||
var itemPosition: Int = 0
|
||||
|
||||
@@ -10,7 +10,6 @@ import androidx.leanback.media.PlaybackTransportControlGlue
|
||||
import androidx.leanback.widget.PlaybackControlsRow
|
||||
import java.io.IOException
|
||||
|
||||
/** Handles video playback with media controls. */
|
||||
class PlaybackFragment : VideoSupportFragment() {
|
||||
|
||||
private lateinit var mTransportControlGlue: PlaybackTransportControlGlue<MediaPlayerAdapter>
|
||||
@@ -28,7 +27,6 @@ class PlaybackFragment : VideoSupportFragment() {
|
||||
}
|
||||
|
||||
override fun showControlsOverlay(runAnimation: Boolean) {
|
||||
// We will do nothing here, and thus controls will never be shown
|
||||
}
|
||||
|
||||
fun play(tv: TV) {
|
||||
|
||||
@@ -2,9 +2,6 @@ package com.lizongying.mytv
|
||||
|
||||
import java.io.Serializable
|
||||
|
||||
/**
|
||||
* Movie class represents video entity with title, description, image thumbs and video url.
|
||||
*/
|
||||
data class TV(
|
||||
var id: Int = 0,
|
||||
var title: String? = null,
|
||||
|
||||
Reference in New Issue
Block a user