mirror of
https://github.com/lizongying/my-tv.git
synced 2026-10-27 06:36:29 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
74b62870c6 | ||
|
|
a3a9bdc762 | ||
|
|
019c5a8e66 | ||
|
|
fd897f68c0 | ||
|
|
65c4b0cf52 | ||
|
|
8290a86909 | ||
|
|
4e05fe91d7 | ||
|
|
d5de8a8d2a | ||
|
|
c232099d29 | ||
|
|
3fb4b1e585 | ||
|
|
7b0e144cb1 | ||
|
|
06b8df5f82 | ||
|
|
7bed18ee6d | ||
|
|
0c2beb936a | ||
|
|
51ab79b5ca | ||
|
|
c8de039d05 | ||
|
|
c9494f7bf3 | ||
|
|
79b6cfcd11 | ||
|
|
31988d0d86 | ||
|
|
e55e8ceb18 | ||
|
|
0b62742350 | ||
|
|
558fe7e4e7 | ||
|
|
e2145f8d0d | ||
|
|
46b4df1306 | ||
|
|
358539f9c3 | ||
|
|
17d8d4cb46 | ||
|
|
dc81112a3d | ||
|
|
95ea83e45c | ||
|
|
a6078e75e1 | ||
|
|
8a3720049f | ||
|
|
ede420a190 | ||
|
|
f94d136a03 | ||
|
|
e7780434d7 | ||
|
|
67edb2830c | ||
|
|
2869164368 | ||
|
|
83a70291d4 | ||
|
|
872f668c59 | ||
|
|
426839c747 | ||
|
|
3e513d5adf | ||
|
|
86d4081d03 | ||
|
|
f76aa37169 | ||
|
|
d944777fc6 | ||
|
|
a45244c552 | ||
|
|
809ec920a5 | ||
|
|
8e4f7df8d4 | ||
|
|
fe209183ea | ||
|
|
b7ec58ac5b | ||
|
|
096acdf55e | ||
|
|
c8d59d5aab | ||
|
|
2b4b823946 | ||
|
|
127ceeb0b0 | ||
|
|
9dd6a2155f | ||
|
|
526a7c5c40 | ||
|
|
960f890ddd | ||
|
|
0a7837c577 | ||
|
|
d8342e8c6a | ||
|
|
6387f48409 | ||
|
|
807300918c | ||
|
|
36eacb7a57 | ||
|
|
b4abe0ccc6 | ||
|
|
fd1dc8d3c7 | ||
|
|
ea56bf1b80 | ||
|
|
4fb27ba502 | ||
|
|
a746fe6c65 | ||
|
|
594d5e3499 | ||
|
|
6061187bc8 | ||
|
|
cd8b37e63c | ||
|
|
aa3ba1d41f | ||
|
|
c778ac07ba | ||
|
|
700c8b4c04 | ||
|
|
825a872a09 | ||
|
|
54b43664ec | ||
|
|
a93cfb455c | ||
|
|
8535689e95 | ||
|
|
1714633cb7 | ||
|
|
f7b024f6da | ||
|
|
dd8df63b01 | ||
|
|
a4c95efd71 | ||
|
|
9f32fa3673 | ||
|
|
b3d0093ab0 | ||
|
|
5798d3a5fe | ||
|
|
4eb90de79d | ||
|
|
b8232971e2 | ||
|
|
bc3681b0a6 | ||
|
|
088808c3fd | ||
|
|
73239a6677 | ||
|
|
cc2514a81a | ||
|
|
bcf9bab25f | ||
|
|
f7eebb3f7a | ||
|
|
0f4a33a3fc | ||
|
|
c17d62c698 | ||
|
|
33d3da97e5 | ||
|
|
ba95ce5374 | ||
|
|
e1ee909071 | ||
|
|
1fd0951f92 | ||
|
|
42b072f5ec | ||
|
|
a23b1e11ce | ||
|
|
1ac6d87c3c | ||
|
|
b075a7db81 |
+11
-9
@@ -1,19 +1,21 @@
|
||||
## 更新日志
|
||||
|
||||
### v1.7.8(通用)
|
||||
|
||||
* 修复播放过程中的卡顿问题
|
||||
* 增加时间显示
|
||||
* 频道号优化
|
||||
* 遥控器左键打开频道列表
|
||||
* 遥控器右键打开设置菜单
|
||||
* 频道列表空白处点击隐藏频道列表
|
||||
|
||||
### v1.7.6(通用)
|
||||
|
||||
* 临时去掉部分频道,提高频道的可用性
|
||||
* 部分频道增加节目单
|
||||
|
||||
### v1.7.4(通用)
|
||||
|
||||
* 修复368
|
||||
|
||||
### v1.7.3(安卓5及以上专用)
|
||||
|
||||
* 临时去掉部分频道,提高频道的可用性
|
||||
* 部分频道增加节目单
|
||||
* 遥控器左键进入节目列表
|
||||
* 遥控器右键进入菜单
|
||||
|
||||
### v1.7.2(通用)
|
||||
|
||||
* 支持节目列表网格样式和行样式切换,软件重启后生效
|
||||
|
||||
@@ -31,16 +31,13 @@ adb install my-tv.apk
|
||||
* CHC高清三个电影频道
|
||||
* 地方频道
|
||||
* 收藏夹
|
||||
* 自定义源
|
||||
* 海外
|
||||
* 1.5.0 无法安装,1.5.1 可以安装
|
||||
* 节目增加预告
|
||||
* 频道列表优化
|
||||
* epg更新后菜单更新
|
||||
* 防止菜单第一个获取焦点
|
||||
* 隐藏
|
||||
* 亮度调节
|
||||
* 音量调节
|
||||
* 自动更新
|
||||
* 显示时间
|
||||
* 软解
|
||||
* 不同分辨率
|
||||
|
||||
## 赞赏
|
||||
|
||||
|
||||
+1
-3
@@ -106,7 +106,7 @@ dependencies {
|
||||
implementation "androidx.media3:media3-exoplayer-hls:$media3_version"
|
||||
|
||||
// 21:2.9.0 17:2.6.4
|
||||
def retrofit2_version = "2.6.4"
|
||||
def retrofit2_version = "2.9.0"
|
||||
|
||||
implementation 'com.google.protobuf:protobuf-kotlin:3.25.1'
|
||||
implementation "com.squareup.retrofit2:converter-gson:$retrofit2_version"
|
||||
@@ -122,6 +122,4 @@ dependencies {
|
||||
implementation 'com.google.android.exoplayer:exoplayer-ui:2.13.3'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-core:2.13.3'
|
||||
implementation 'com.google.android.exoplayer:exoplayer-hls:2.13.3'
|
||||
|
||||
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
||||
}
|
||||
@@ -1,43 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<uses-feature
|
||||
android:name="android.hardware.touchscreen"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.software.leanback"
|
||||
android:required="true" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
|
||||
<application
|
||||
android:name=".MyApplication"
|
||||
android:allowBackup="true"
|
||||
android:banner="@drawable/banner"
|
||||
android:icon="@drawable/logo"
|
||||
android:label="@string/app_name"
|
||||
android:largeHeap="true"
|
||||
android:icon="@drawable/logo"
|
||||
android:logo="@drawable/logo"
|
||||
android:networkSecurityConfig="@xml/network"
|
||||
android:banner="@drawable/banner"
|
||||
android:label="@string/app_name"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.MyTV"
|
||||
android:usesCleartextTraffic="true">
|
||||
android:networkSecurityConfig="@xml/network"
|
||||
android:usesCleartextTraffic="true"
|
||||
android:theme="@style/Theme.MyTV">
|
||||
<activity
|
||||
android:keepScreenOn="true"
|
||||
android:name=".MainActivity"
|
||||
android:exported="true"
|
||||
android:keepScreenOn="true"
|
||||
android:screenOrientation="landscape">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
|
||||
<receiver
|
||||
android:name=".BootReceiver"
|
||||
android:exported="true">
|
||||
@@ -46,17 +40,15 @@
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
<receiver
|
||||
android:name=".NetworkChangeReceiver"
|
||||
<receiver android:name=".NetworkChangeReceiver"
|
||||
android:exported="true">
|
||||
<intent-filter>
|
||||
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
|
||||
</intent-filter>
|
||||
</receiver>
|
||||
|
||||
<provider
|
||||
android:name=".InitializerProvider"
|
||||
android:authorities="${applicationId}.InitializerProvider"
|
||||
android:exported="false" />
|
||||
android:exported="false"/>
|
||||
</application>
|
||||
</manifest>
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,140 +0,0 @@
|
||||
package com.lizongying.mytv
|
||||
|
||||
import android.graphics.Color
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.view.KeyEvent
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.animation.ScaleAnimation
|
||||
import android.widget.ImageView
|
||||
import androidx.core.view.updatePadding
|
||||
import androidx.leanback.widget.ImageCardView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.bumptech.glide.Glide
|
||||
import com.lizongying.mytv.models.TVListViewModel
|
||||
import com.lizongying.mytv.models.TVViewModel
|
||||
|
||||
|
||||
class CardAdapter(
|
||||
private val recyclerView: RecyclerView,
|
||||
private val mainFragment: MainFragment,
|
||||
private var tvListViewModel: TVListViewModel,
|
||||
) :
|
||||
RecyclerView.Adapter<CardAdapter.ViewHolder>() {
|
||||
|
||||
private var listener: ItemListener? = null
|
||||
private var focused: View? = null
|
||||
|
||||
var visiable = false
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder {
|
||||
val cardView = object :
|
||||
ImageCardView(ContextThemeWrapper(parent.context, R.style.CustomImageCardTheme)) {}
|
||||
cardView.isFocusable = true
|
||||
cardView.isFocusableInTouchMode = true
|
||||
cardView.updatePadding(1, 0, 1, 0)
|
||||
return ViewHolder(cardView)
|
||||
}
|
||||
|
||||
fun clear() {
|
||||
focused?.clearFocus()
|
||||
recyclerView.invalidate()
|
||||
}
|
||||
|
||||
private fun startScaleAnimation(view: View, fromScale: Float, toScale: Float, duration: Long) {
|
||||
val scaleAnimation = ScaleAnimation(
|
||||
fromScale, toScale,
|
||||
fromScale, toScale,
|
||||
ScaleAnimation.RELATIVE_TO_SELF, 0.5f,
|
||||
ScaleAnimation.RELATIVE_TO_SELF, 0.5f
|
||||
)
|
||||
scaleAnimation.duration = duration
|
||||
scaleAnimation.fillAfter = false
|
||||
view.startAnimation(scaleAnimation)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(viewHolder: ViewHolder, position: Int) {
|
||||
val item = tvListViewModel.getTVViewModel(position)
|
||||
|
||||
val tvViewModel = item as TVViewModel
|
||||
val cardView = viewHolder.view as ImageCardView
|
||||
cardView.tag = tvViewModel
|
||||
|
||||
val onFocusChangeListener = View.OnFocusChangeListener { view, hasFocus ->
|
||||
if (hasFocus) {
|
||||
listener?.onItemHasFocus(item)
|
||||
focused = cardView
|
||||
|
||||
startScaleAnimation(cardView, 0.9f, 1.0f, 200)
|
||||
//
|
||||
// if (mainFragment.shouldHasFocus(view.tag as TVViewModel)) {
|
||||
// }
|
||||
|
||||
// if (visiable) {
|
||||
// startScaleAnimation(cardView, 0.9f, 1.0f, 200)
|
||||
// } else {
|
||||
// visiable = true
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
cardView.onFocusChangeListener = onFocusChangeListener
|
||||
|
||||
cardView.setOnClickListener { _ ->
|
||||
listener?.onItemClicked(item)
|
||||
}
|
||||
|
||||
cardView.setOnKeyListener { _, keyCode, event: KeyEvent? ->
|
||||
if (event?.action == KeyEvent.ACTION_DOWN) {
|
||||
return@setOnKeyListener listener?.onKey(keyCode) ?: false
|
||||
}
|
||||
false
|
||||
}
|
||||
|
||||
cardView.titleText = tvViewModel.getTV().title
|
||||
|
||||
Glide.with(viewHolder.view.context)
|
||||
.load(tvViewModel.getTV().logo)
|
||||
.centerInside()
|
||||
.into(cardView.mainImageView)
|
||||
|
||||
cardView.mainImageView.setBackgroundColor(Color.WHITE)
|
||||
cardView.setMainImageScaleType(ImageView.ScaleType.CENTER_INSIDE)
|
||||
|
||||
val epg = tvViewModel.epg.value?.filter { it.beginTime < Utils.getDateTimestamp() }
|
||||
if (!epg.isNullOrEmpty()) {
|
||||
cardView.contentText = epg.last().title
|
||||
} else {
|
||||
cardView.contentText = ""
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemCount() = tvListViewModel.size()
|
||||
|
||||
class ViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) {
|
||||
val view = itemView
|
||||
}
|
||||
|
||||
fun toPosition(position: Int) {
|
||||
recyclerView.post {
|
||||
recyclerView.scrollToPosition(position)
|
||||
recyclerView.getChildAt(position)?.isSelected
|
||||
recyclerView.getChildAt(position)?.requestFocus()
|
||||
}
|
||||
}
|
||||
|
||||
interface ItemListener {
|
||||
fun onItemHasFocus(tvViewModel: TVViewModel)
|
||||
fun onItemClicked(tvViewModel: TVViewModel)
|
||||
fun onKey(keyCode: Int): Boolean
|
||||
}
|
||||
|
||||
fun setItemListener(listener: ItemListener) {
|
||||
this.listener = listener
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CardAdapter"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.lizongying.mytv
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.view.ContextThemeWrapper
|
||||
import android.view.ViewGroup
|
||||
import android.widget.ImageView
|
||||
import androidx.leanback.widget.ImageCardView
|
||||
import androidx.leanback.widget.Presenter
|
||||
import com.bumptech.glide.Glide
|
||||
import com.lizongying.mytv.models.TVViewModel
|
||||
|
||||
class CardPresenter(
|
||||
private val context: Context,
|
||||
) : Presenter() {
|
||||
|
||||
override fun onCreateViewHolder(parent: ViewGroup): ViewHolder {
|
||||
val cardView = object :
|
||||
ImageCardView(ContextThemeWrapper(parent.context, R.style.CustomImageCardTheme)) {}
|
||||
|
||||
cardView.isFocusable = true
|
||||
cardView.isFocusableInTouchMode = true
|
||||
return ViewHolder(cardView)
|
||||
}
|
||||
|
||||
override fun onBindViewHolder(viewHolder: ViewHolder, item: Any) {
|
||||
val tvViewModel = item as TVViewModel
|
||||
val cardView = viewHolder.view as ImageCardView
|
||||
|
||||
cardView.titleText = tvViewModel.getTV().title
|
||||
cardView.setMainImageDimensions(CARD_WIDTH, CARD_HEIGHT)
|
||||
cardView.tag = tvViewModel.videoUrl.value
|
||||
|
||||
Glide.with(viewHolder.view.context)
|
||||
.load(tvViewModel.getTV().logo)
|
||||
.centerInside()
|
||||
.into(cardView.mainImageView)
|
||||
|
||||
cardView.setBackgroundColor(Color.WHITE)
|
||||
cardView.setMainImageScaleType(ImageView.ScaleType.CENTER_INSIDE)
|
||||
|
||||
// cardView.setOnFocusChangeListener { v, hasFocus ->
|
||||
// run {
|
||||
// if (hasFocus) {
|
||||
// if (v != null) {
|
||||
// (v as ImageCardView).setInfoAreaBackgroundColor(context.resources.getColor(R.color.focus))
|
||||
// }
|
||||
// } else {
|
||||
// if (v != null) {
|
||||
// (v as ImageCardView).setInfoAreaBackgroundColor(context.resources.getColor(R.color.ic_launcher_background))
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
val epg = tvViewModel.epg.value?.filter { it.beginTime < Utils.getDateTimestamp() }
|
||||
if (!epg.isNullOrEmpty()) {
|
||||
cardView.contentText = epg.last().title
|
||||
} else {
|
||||
cardView.contentText = ""
|
||||
}
|
||||
}
|
||||
|
||||
override fun onUnbindViewHolder(viewHolder: ViewHolder) {
|
||||
val cardView = viewHolder.view as ImageCardView
|
||||
cardView.mainImage = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "CardPresenter"
|
||||
private const val CARD_WIDTH = 300
|
||||
private const val CARD_HEIGHT = 101
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ class ChannelFragment : Fragment() {
|
||||
): View {
|
||||
_binding = ChannelBinding.inflate(inflater, container, false)
|
||||
_binding!!.root.visibility = View.GONE
|
||||
(activity as MainActivity).fragmentReady("ChannelFragment")
|
||||
(activity as MainActivity).fragmentReady()
|
||||
return binding.root
|
||||
}
|
||||
|
||||
@@ -36,9 +36,6 @@ class ChannelFragment : Fragment() {
|
||||
}
|
||||
|
||||
fun show(channel: String) {
|
||||
if (binding.channelContent.text.length > 1) {
|
||||
return
|
||||
}
|
||||
this.channel = "${binding.channelContent.text}$channel".toInt()
|
||||
handler.removeCallbacks(hideRunnable)
|
||||
handler.removeCallbacks(playRunnable)
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.lizongying.mytv
|
||||
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.leanback.app.ErrorSupportFragment
|
||||
|
||||
class ErrorFragment : ErrorSupportFragment() {
|
||||
|
||||
internal fun setErrorContent(message: String) {
|
||||
imageDrawable =
|
||||
ContextCompat.getDrawable(context!!, androidx.leanback.R.drawable.lb_ic_sad_cloud)
|
||||
this.message = message
|
||||
setDefaultBackground(TRANSLUCENT)
|
||||
backgroundDrawable = ContextCompat.getDrawable(
|
||||
context!!,
|
||||
R.color.black
|
||||
)
|
||||
|
||||
buttonText = resources.getString(R.string.dismiss_error)
|
||||
buttonClickListener = View.OnClickListener {
|
||||
fragmentManager!!.beginTransaction().remove(this@ErrorFragment).commit()
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TRANSLUCENT = false
|
||||
}
|
||||
}
|
||||
@@ -50,7 +50,7 @@ val Context.appVersionCode: Long
|
||||
* Return the version name of the app which is defined in build.gradle.
|
||||
* eg:1.0.0
|
||||
*/
|
||||
val Context.appVersionName: String get() = packageInfo.versionName ?: ""
|
||||
val Context.appVersionName: String get() = packageInfo.versionName
|
||||
|
||||
val Context.appSignature: String
|
||||
get() {
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.lizongying.mytv
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Canvas
|
||||
import android.graphics.Paint
|
||||
import android.graphics.Rect
|
||||
import android.view.View
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.leanback.widget.ImageCardView
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
|
||||
class GrayOverlayItemDecoration(private val context: Context) : RecyclerView.ItemDecoration() {
|
||||
|
||||
private val grayOverlayPaint = Paint().apply {
|
||||
color = ContextCompat.getColor(context, R.color.gray_overlay)
|
||||
style = Paint.Style.FILL
|
||||
}
|
||||
|
||||
override fun onDrawOver(c: Canvas, parent: RecyclerView, state: RecyclerView.State) {
|
||||
super.onDrawOver(c, parent, state)
|
||||
|
||||
val childCount = parent.childCount
|
||||
for (i in 0 until childCount) {
|
||||
val child = parent.getChildAt(i)
|
||||
if (!child.hasFocus()) {
|
||||
(child as ImageCardView).setInfoAreaBackgroundColor(ContextCompat.getColor(context, R.color.blur))
|
||||
// child.alpha = 0.5f
|
||||
// 计算遮罩层的大小
|
||||
// val overlayRect = Rect(
|
||||
// child.left,
|
||||
// child.top,
|
||||
// child.right,
|
||||
// child.bottom
|
||||
// )
|
||||
// // 绘制灰色遮罩层
|
||||
// c.drawRect(overlayRect, grayOverlayPaint)
|
||||
} else {
|
||||
(child as ImageCardView).setInfoAreaBackgroundColor(ContextCompat.getColor(context, R.color.focus))
|
||||
// child.alpha = 1f
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
// 在此处设置偏移量为0,以防止遮罩层影响项的布局
|
||||
outRect.setEmpty()
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ class InfoFragment : Fragment() {
|
||||
): View {
|
||||
_binding = InfoBinding.inflate(inflater, container, false)
|
||||
_binding!!.root.visibility = View.GONE
|
||||
(activity as MainActivity).fragmentReady("InfoFragment")
|
||||
(activity as MainActivity).fragmentReady()
|
||||
return binding.root
|
||||
}
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@ import android.util.Log
|
||||
import android.view.GestureDetector
|
||||
import android.view.KeyEvent
|
||||
import android.view.MotionEvent
|
||||
import android.view.View
|
||||
import android.view.View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
import android.view.WindowManager
|
||||
import android.widget.Toast
|
||||
@@ -30,8 +31,8 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
private val mainFragment = MainFragment()
|
||||
private val infoFragment = InfoFragment()
|
||||
private val channelFragment = ChannelFragment()
|
||||
private var timeFragment = TimeFragment()
|
||||
private val settingFragment = SettingFragment()
|
||||
private val errorFragment = ErrorFragment()
|
||||
|
||||
private var doubleBackToExitPressedOnce = false
|
||||
|
||||
@@ -66,7 +67,6 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
if (savedInstanceState == null) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.add(R.id.main_browse_fragment, playerFragment)
|
||||
.add(R.id.main_browse_fragment, timeFragment)
|
||||
.add(R.id.main_browse_fragment, infoFragment)
|
||||
.add(R.id.main_browse_fragment, channelFragment)
|
||||
.add(R.id.main_browse_fragment, mainFragment)
|
||||
@@ -75,6 +75,12 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
}
|
||||
gestureDetector = GestureDetector(this, GestureListener())
|
||||
|
||||
errorFragment.buttonClickListener = View.OnClickListener {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.remove(errorFragment)
|
||||
.commit()
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||
val connectivityManager =
|
||||
getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
@@ -146,7 +152,6 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
val transaction = supportFragmentManager.beginTransaction()
|
||||
|
||||
if (mainFragment.isHidden) {
|
||||
mainFragment.setPosition()
|
||||
transaction.show(mainFragment)
|
||||
mainActive()
|
||||
} else {
|
||||
@@ -164,7 +169,11 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
fun settingDelayHide() {
|
||||
handler.removeCallbacks(hideSetting)
|
||||
handler.postDelayed(hideSetting, delayHideSetting)
|
||||
showTime()
|
||||
}
|
||||
|
||||
fun settingHideNow() {
|
||||
handler.removeCallbacks(hideSetting)
|
||||
handler.postDelayed(hideSetting, 0)
|
||||
}
|
||||
|
||||
fun settingNeverHide() {
|
||||
@@ -189,21 +198,19 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
}
|
||||
}
|
||||
|
||||
fun fragmentReady(tag: String) {
|
||||
fun fragmentReady() {
|
||||
ready++
|
||||
Log.i(TAG, "ready $tag $ready ")
|
||||
if (ready == 6) {
|
||||
Log.i(TAG, "ready $ready")
|
||||
if (ready == 5) {
|
||||
mainFragment.fragmentReady()
|
||||
showTime()
|
||||
}
|
||||
}
|
||||
|
||||
private fun showTime() {
|
||||
Log.i(TAG, "showTime ${SP.time}")
|
||||
if (SP.time) {
|
||||
timeFragment.show()
|
||||
} else {
|
||||
timeFragment.hide()
|
||||
fun isPlaying() {
|
||||
if (errorFragment.isVisible) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.remove(errorFragment)
|
||||
.commit()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -217,7 +224,6 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
private inner class GestureListener : GestureDetector.SimpleOnGestureListener() {
|
||||
|
||||
override fun onSingleTapConfirmed(e: MotionEvent): Boolean {
|
||||
Log.i(TAG, "onSingleTapConfirmed")
|
||||
switchMainFragment()
|
||||
return true
|
||||
}
|
||||
@@ -278,14 +284,9 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
private val hideSetting = Runnable {
|
||||
if (settingFragment.isVisible) {
|
||||
settingFragment.dismiss()
|
||||
showTime()
|
||||
}
|
||||
}
|
||||
|
||||
private fun hideSettingFragment() {
|
||||
handler.postDelayed(hideSetting, 0)
|
||||
}
|
||||
|
||||
private fun channelUp() {
|
||||
if (mainFragment.isHidden) {
|
||||
if (SP.channelReversal) {
|
||||
@@ -325,11 +326,6 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
return
|
||||
}
|
||||
|
||||
if (!settingFragment.isHidden) {
|
||||
hideSettingFragment()
|
||||
return
|
||||
}
|
||||
|
||||
if (doubleBackToExitPressedOnce) {
|
||||
super.onBackPressed()
|
||||
return
|
||||
@@ -343,9 +339,8 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
}, 2000)
|
||||
}
|
||||
|
||||
|
||||
fun onKey(keyCode: Int): Boolean {
|
||||
Log.i(TAG, "keyCode $keyCode")
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
|
||||
Log.i(TAG, "keyCode $keyCode, event $event")
|
||||
when (keyCode) {
|
||||
KeyEvent.KEYCODE_0 -> {
|
||||
showChannel("0")
|
||||
@@ -457,26 +452,19 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_LEFT -> {
|
||||
if (mainFragment.isHidden && !settingFragment.isVisible) {
|
||||
if (!mainFragment.isVisible && !settingFragment.isVisible) {
|
||||
switchMainFragment()
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_RIGHT -> {
|
||||
if (mainFragment.isHidden && !settingFragment.isVisible) {
|
||||
if (!mainFragment.isVisible && !settingFragment.isVisible) {
|
||||
showSetting()
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onKeyDown(keyCode: Int, event: KeyEvent?): Boolean {
|
||||
if (onKey(keyCode)) {
|
||||
return true
|
||||
}
|
||||
|
||||
return super.onKeyDown(keyCode, event)
|
||||
}
|
||||
@@ -508,7 +496,13 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
|
||||
}
|
||||
|
||||
override fun onRequestFinished(message: String?) {
|
||||
fragmentReady("request")
|
||||
if (message != null && !errorFragment.isVisible) {
|
||||
supportFragmentManager.beginTransaction()
|
||||
.add(R.id.main_browse_fragment, errorFragment)
|
||||
.commitNow()
|
||||
errorFragment.setErrorContent(message)
|
||||
}
|
||||
fragmentReady()
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
@@ -2,57 +2,71 @@ package com.lizongying.mytv
|
||||
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.KeyEvent
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.Toast
|
||||
import androidx.fragment.app.Fragment
|
||||
import androidx.leanback.app.BrowseSupportFragment
|
||||
import androidx.leanback.widget.ArrayObjectAdapter
|
||||
import androidx.leanback.widget.HeaderItem
|
||||
import androidx.leanback.widget.ListRow
|
||||
import androidx.leanback.widget.ListRowPresenter
|
||||
import androidx.leanback.widget.ListRowPresenter.SelectItemViewHolderTask
|
||||
import androidx.leanback.widget.OnItemViewClickedListener
|
||||
import androidx.leanback.widget.OnItemViewSelectedListener
|
||||
import androidx.leanback.widget.Presenter
|
||||
import androidx.leanback.widget.Row
|
||||
import androidx.leanback.widget.RowPresenter
|
||||
import androidx.lifecycle.lifecycleScope
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.lizongying.mytv.Utils.dpToPx
|
||||
import com.lizongying.mytv.api.YSP
|
||||
import com.lizongying.mytv.databinding.MenuBinding
|
||||
import com.lizongying.mytv.databinding.RowBinding
|
||||
import com.lizongying.mytv.models.ProgramType
|
||||
import com.lizongying.mytv.models.TVListViewModel
|
||||
import com.lizongying.mytv.models.TVViewModel
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.launch
|
||||
|
||||
|
||||
class MainFragment : Fragment(), CardAdapter.ItemListener {
|
||||
class MainFragment : BrowseSupportFragment() {
|
||||
|
||||
private var itemPosition = 0
|
||||
|
||||
private var rowList: MutableList<View> = mutableListOf()
|
||||
|
||||
private var _binding: MenuBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
private var rowsAdapter: ArrayObjectAdapter? = null
|
||||
|
||||
var tvListViewModel = TVListViewModel()
|
||||
|
||||
private var lastVideoUrl = ""
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
_binding = MenuBinding.inflate(inflater, container, false)
|
||||
|
||||
binding.menu.setOnClickListener {
|
||||
hideSelf()
|
||||
}
|
||||
|
||||
return binding.root
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
Log.i(TAG, "onCreate")
|
||||
super.onCreate(savedInstanceState)
|
||||
headersState = HEADERS_DISABLED
|
||||
}
|
||||
|
||||
private fun hideSelf() {
|
||||
requireActivity().supportFragmentManager.beginTransaction()
|
||||
.hide(this)
|
||||
.commit()
|
||||
// override fun onCreateView(
|
||||
// inflater: LayoutInflater,
|
||||
// container: ViewGroup?,
|
||||
// savedInstanceState: Bundle?
|
||||
// ): View? {
|
||||
// val rootView = super.onCreateView(inflater, container, savedInstanceState)
|
||||
// rootView?.setOnClickListener {
|
||||
// Log.i(TAG, "main on click")
|
||||
// fragmentManager!!.beginTransaction().hide(this).commit()
|
||||
// }
|
||||
// mainFragment.view?.setOnClickListener {
|
||||
// Log.i(TAG, "mainFragment on click")
|
||||
// fragmentManager!!.beginTransaction().hide(this).commit()
|
||||
// }
|
||||
// getRowsSupportFragment().view?.setOnClickListener {
|
||||
// Log.i(TAG, "getRowsSupportFragment on click")
|
||||
// fragmentManager!!.beginTransaction().hide(this).commit()
|
||||
// }
|
||||
//
|
||||
//
|
||||
// return rootView
|
||||
// }
|
||||
|
||||
override fun onStart() {
|
||||
Log.i(TAG, "onStart")
|
||||
super.onStart()
|
||||
}
|
||||
|
||||
override fun onActivityCreated(savedInstanceState: Bundle?) {
|
||||
@@ -60,199 +74,168 @@ class MainFragment : Fragment(), CardAdapter.ItemListener {
|
||||
|
||||
activity?.let { YSP.init(it) }
|
||||
|
||||
itemPosition = SP.itemPosition
|
||||
loadRows()
|
||||
|
||||
view?.post {
|
||||
val content = binding.content
|
||||
setupEventListeners()
|
||||
|
||||
var idx: Long = 0
|
||||
for ((k, v) in TVList.list) {
|
||||
val itemBinding: RowBinding =
|
||||
RowBinding.inflate(layoutInflater, content, false)
|
||||
|
||||
val tvListViewModelCurrent = TVListViewModel()
|
||||
for ((idx2, v1) in v.withIndex()) {
|
||||
val tvViewModel = TVViewModel(v1)
|
||||
tvViewModel.setRowPosition(idx.toInt())
|
||||
tvViewModel.setItemPosition(idx2)
|
||||
tvListViewModelCurrent.addTVViewModel(tvViewModel)
|
||||
tvListViewModel.addTVViewModel(tvViewModel)
|
||||
tvListViewModel.tvListViewModel.value?.forEach { tvViewModel ->
|
||||
tvViewModel.errInfo.observe(viewLifecycleOwner) { _ ->
|
||||
if (tvViewModel.errInfo.value != null
|
||||
&& tvViewModel.getTV().id == itemPosition
|
||||
) {
|
||||
Toast.makeText(context, tvViewModel.errInfo.value, Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
tvListViewModel.maxNum.add(v.size)
|
||||
|
||||
val adapter =
|
||||
CardAdapter(
|
||||
itemBinding.rowItems,
|
||||
this,
|
||||
tvListViewModelCurrent,
|
||||
)
|
||||
rowList.add(itemBinding.rowItems)
|
||||
|
||||
adapter.setItemListener(this)
|
||||
|
||||
itemBinding.rowHeader.text = k
|
||||
itemBinding.rowItems.tag = idx.toInt()
|
||||
itemBinding.rowItems.adapter = adapter
|
||||
|
||||
itemBinding.rowItems.addOnScrollListener(object : RecyclerView.OnScrollListener() {
|
||||
override fun onScrolled(recyclerView: RecyclerView, dx: Int, dy: Int) {
|
||||
super.onScrolled(recyclerView, dx, dy)
|
||||
(activity as MainActivity).mainActive()
|
||||
}
|
||||
})
|
||||
|
||||
val itemDecoration = context?.let { GrayOverlayItemDecoration(it) }
|
||||
if (itemDecoration != null) {
|
||||
itemBinding.rowItems.addItemDecoration(itemDecoration)
|
||||
}
|
||||
|
||||
if (SP.grid) {
|
||||
itemBinding.rowItems.layoutManager =
|
||||
GridLayoutManager(context, 6)
|
||||
itemBinding.rowItems.layoutParams.height =
|
||||
dpToPx(92 * ((tvListViewModelCurrent.size() + 6 - 1) / 6))
|
||||
} else {
|
||||
itemBinding.rowItems.layoutManager =
|
||||
LinearLayoutManager(context, LinearLayoutManager.HORIZONTAL, false)
|
||||
}
|
||||
|
||||
val layoutParams = itemBinding.row.layoutParams as ViewGroup.MarginLayoutParams
|
||||
layoutParams.topMargin = dpToPx(11F)
|
||||
itemBinding.row.layoutParams = layoutParams
|
||||
itemBinding.row.setOnClickListener{
|
||||
hideSelf()
|
||||
}
|
||||
content.addView(itemBinding.row)
|
||||
|
||||
idx++
|
||||
}
|
||||
tvViewModel.ready.observe(viewLifecycleOwner) { _ ->
|
||||
|
||||
if (itemPosition >= tvListViewModel.size()) {
|
||||
itemPosition = 0
|
||||
// not first time && channel not change
|
||||
if (tvViewModel.ready.value != null
|
||||
&& tvViewModel.getTV().id == itemPosition
|
||||
&& check(tvViewModel)
|
||||
) {
|
||||
Log.i(TAG, "ready ${tvViewModel.getTV().title}")
|
||||
(activity as? MainActivity)?.play(tvViewModel)
|
||||
}
|
||||
}
|
||||
|
||||
tvListViewModel.setItemPosition(itemPosition)
|
||||
tvListViewModel.tvListViewModel.value?.forEach { tvViewModel ->
|
||||
tvViewModel.errInfo.observe(viewLifecycleOwner) { _ ->
|
||||
if (tvViewModel.errInfo.value != null
|
||||
&& tvViewModel.getTV().id == itemPosition
|
||||
) {
|
||||
Toast.makeText(context, tvViewModel.errInfo.value, Toast.LENGTH_SHORT)
|
||||
.show()
|
||||
}
|
||||
}
|
||||
tvViewModel.ready.observe(viewLifecycleOwner) { _ ->
|
||||
|
||||
// not first time && channel not change
|
||||
if (tvViewModel.ready.value != null
|
||||
&& tvViewModel.getTV().id == itemPosition
|
||||
&& check(tvViewModel)
|
||||
) {
|
||||
Log.i(TAG, "ready ${tvViewModel.getTV().title}")
|
||||
(activity as? MainActivity)?.play(tvViewModel)
|
||||
}
|
||||
}
|
||||
tvViewModel.change.observe(viewLifecycleOwner) { _ ->
|
||||
if (tvViewModel.change.value != null) {
|
||||
val title = tvViewModel.getTV().title
|
||||
Log.i(TAG, "switch $title")
|
||||
if (tvViewModel.getTV().pid != "") {
|
||||
Log.i(TAG, "request $title")
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
tvViewModel.let { Request.fetchData(it) }
|
||||
}
|
||||
tvViewModel.change.observe(viewLifecycleOwner) { _ ->
|
||||
if (tvViewModel.change.value != null) {
|
||||
val title = tvViewModel.getTV().title
|
||||
Log.i(TAG, "switch $title")
|
||||
if (tvViewModel.getTV().pid != "") {
|
||||
Log.i(TAG, "request $title")
|
||||
lifecycleScope.launch(Dispatchers.IO) {
|
||||
tvViewModel.let { Request.fetchData(it) }
|
||||
}
|
||||
(activity as? MainActivity)?.showInfoFragment(tvViewModel)
|
||||
setSelectedPosition(
|
||||
tvViewModel.getRowPosition(), true,
|
||||
SelectItemViewHolderTask(tvViewModel.getItemPosition())
|
||||
)
|
||||
} else {
|
||||
if (check(tvViewModel)) {
|
||||
(activity as? MainActivity)?.play(tvViewModel)
|
||||
(activity as? MainActivity)?.showInfoFragment(tvViewModel)
|
||||
setPosition(
|
||||
tvViewModel.getRowPosition(), tvViewModel.getItemPosition()
|
||||
setSelectedPosition(
|
||||
tvViewModel.getRowPosition(), true,
|
||||
SelectItemViewHolderTask(tvViewModel.getItemPosition())
|
||||
)
|
||||
} else {
|
||||
if (check(tvViewModel)) {
|
||||
// TODO lastVideoUrl
|
||||
(activity as? MainActivity)?.play(tvViewModel)
|
||||
(activity as? MainActivity)?.showInfoFragment(tvViewModel)
|
||||
setPosition(
|
||||
tvViewModel.getRowPosition(), tvViewModel.getItemPosition()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
(activity as MainActivity).fragmentReady("MainFragment")
|
||||
}
|
||||
|
||||
(activity as MainActivity).fragmentReady()
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
fun toLastPosition() {
|
||||
setSelectedPosition(
|
||||
selectedPosition, false,
|
||||
SelectItemViewHolderTask(tvListViewModel.maxNum[selectedPosition] - 1)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onKey(keyCode: Int): Boolean {
|
||||
if (this.isHidden) {
|
||||
when (keyCode) {
|
||||
KeyEvent.KEYCODE_DPAD_UP -> {
|
||||
(activity as MainActivity).onKey(keyCode)
|
||||
return true
|
||||
}
|
||||
fun toFirstPosition() {
|
||||
setSelectedPosition(
|
||||
selectedPosition, false,
|
||||
SelectItemViewHolderTask(0)
|
||||
)
|
||||
}
|
||||
|
||||
KeyEvent.KEYCODE_DPAD_DOWN -> {
|
||||
(activity as MainActivity).onKey(keyCode)
|
||||
return true
|
||||
override fun startHeadersTransition(withHeaders: Boolean) {
|
||||
}
|
||||
|
||||
private fun loadRows() {
|
||||
rowsAdapter = ArrayObjectAdapter(ListRowPresenter())
|
||||
|
||||
val cardPresenter = CardPresenter(context!!)
|
||||
|
||||
var idx: Long = 0
|
||||
for ((k, v) in TVList.list) {
|
||||
val listRowAdapter = ArrayObjectAdapter(cardPresenter)
|
||||
for ((idx2, v1) in v.withIndex()) {
|
||||
val tvViewModel = TVViewModel(v1)
|
||||
tvViewModel.setRowPosition(idx.toInt())
|
||||
tvViewModel.setItemPosition(idx2)
|
||||
tvListViewModel.addTVViewModel(tvViewModel)
|
||||
listRowAdapter.add(tvViewModel)
|
||||
}
|
||||
tvListViewModel.maxNum.add(v.size)
|
||||
val header = HeaderItem(idx, k)
|
||||
rowsAdapter!!.add(ListRow(header, listRowAdapter))
|
||||
idx++
|
||||
}
|
||||
|
||||
adapter = rowsAdapter
|
||||
|
||||
itemPosition = SP.itemPosition
|
||||
if (itemPosition >= tvListViewModel.size()) {
|
||||
itemPosition = 0
|
||||
}
|
||||
tvListViewModel.setItemPosition(itemPosition)
|
||||
}
|
||||
|
||||
fun prevSource() {
|
||||
view?.post {
|
||||
val tvViewModel = tvListViewModel.getTVViewModel(itemPosition)
|
||||
if (tvViewModel != null) {
|
||||
if (tvViewModel.videoUrl.value!!.size > 1) {
|
||||
val videoIndex = tvViewModel.videoIndex.value?.minus(1)
|
||||
if (videoIndex == -1) {
|
||||
tvViewModel.setVideoIndex(tvViewModel.videoUrl.value!!.size - 1)
|
||||
}
|
||||
tvViewModel.changed()
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
override fun onItemHasFocus(tvViewModel: TVViewModel) {
|
||||
tvListViewModel.setItemPositionCurrent(tvViewModel.getTV().id)
|
||||
|
||||
val row = tvViewModel.getRowPosition()
|
||||
|
||||
for (i in rowList) {
|
||||
if (i.tag as Int != row) {
|
||||
((i as RecyclerView).adapter as CardAdapter).clear()
|
||||
fun nextSource() {
|
||||
view?.post {
|
||||
val tvViewModel = tvListViewModel.getTVViewModel(itemPosition)
|
||||
if (tvViewModel != null) {
|
||||
if (tvViewModel.videoUrl.value!!.size > 1) {
|
||||
val videoIndex = tvViewModel.videoIndex.value?.plus(1)
|
||||
if (videoIndex == tvViewModel.videoUrl.value!!.size) {
|
||||
tvViewModel.setVideoIndex(0)
|
||||
}
|
||||
tvViewModel.changed()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
(activity as MainActivity).mainActive()
|
||||
}
|
||||
|
||||
override fun onItemClicked(tvViewModel: TVViewModel) {
|
||||
Log.i(TAG, "onItemClicked")
|
||||
if (this.isHidden) {
|
||||
(activity as? MainActivity)?.switchMainFragment()
|
||||
return
|
||||
}
|
||||
|
||||
if (itemPosition != tvViewModel.getTV().id) {
|
||||
itemPosition = tvViewModel.getTV().id
|
||||
tvListViewModel.setItemPosition(itemPosition)
|
||||
tvListViewModel.getTVViewModel(itemPosition)?.changed()
|
||||
}
|
||||
(activity as? MainActivity)?.switchMainFragment()
|
||||
private fun setupEventListeners() {
|
||||
onItemViewClickedListener = ItemViewClickedListener()
|
||||
onItemViewSelectedListener = ItemViewSelectedListener()
|
||||
}
|
||||
|
||||
fun setPosition() {
|
||||
val tvViewModel = tvListViewModel.getTVViewModel(itemPosition) ?: return
|
||||
val rowPosition = tvViewModel.getRowPosition()
|
||||
val itemPosition = tvViewModel.getItemPosition()
|
||||
setPosition(rowPosition, itemPosition)
|
||||
}
|
||||
|
||||
fun setPosition(rowPosition: Int, itemPosition: Int) {
|
||||
rowList[rowPosition].post {
|
||||
when (val layoutManager = (rowList[rowPosition] as RecyclerView).layoutManager) {
|
||||
is GridLayoutManager -> {
|
||||
layoutManager.findViewByPosition(
|
||||
itemPosition
|
||||
)?.requestFocus()
|
||||
private inner class ItemViewClickedListener : OnItemViewClickedListener {
|
||||
override fun onItemClicked(
|
||||
itemViewHolder: Presenter.ViewHolder,
|
||||
item: Any,
|
||||
rowViewHolder: RowPresenter.ViewHolder,
|
||||
row: Row
|
||||
) {
|
||||
if (item is TVViewModel) {
|
||||
if (itemPosition != item.getTV().id) {
|
||||
itemPosition = item.getTV().id
|
||||
tvListViewModel.setItemPosition(itemPosition)
|
||||
tvListViewModel.getTVViewModel(itemPosition)?.changed()
|
||||
}
|
||||
(activity as? MainActivity)?.switchMainFragment()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
is LinearLayoutManager -> {
|
||||
layoutManager.findViewByPosition(
|
||||
itemPosition
|
||||
)?.requestFocus()
|
||||
}
|
||||
private inner class ItemViewSelectedListener : OnItemViewSelectedListener {
|
||||
override fun onItemSelected(
|
||||
itemViewHolder: Presenter.ViewHolder?, item: Any?,
|
||||
rowViewHolder: RowPresenter.ViewHolder, row: Row
|
||||
) {
|
||||
if (item is TVViewModel) {
|
||||
tvListViewModel.setItemPositionCurrent(item.getTV().id)
|
||||
(activity as MainActivity).mainActive()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,7 +257,6 @@ class MainFragment : Fragment(), CardAdapter.ItemListener {
|
||||
}
|
||||
|
||||
fun fragmentReady() {
|
||||
// request.fetchPage()
|
||||
tvListViewModel.getTVViewModel(itemPosition)?.changed()
|
||||
|
||||
tvListViewModel.tvListViewModel.value?.forEach { tvViewModel ->
|
||||
@@ -332,32 +314,6 @@ class MainFragment : Fragment(), CardAdapter.ItemListener {
|
||||
}
|
||||
}
|
||||
|
||||
fun shouldHasFocus(tvModel: TVViewModel): Boolean {
|
||||
return tvModel == tvListViewModel.getTVViewModel(itemPosition)
|
||||
}
|
||||
|
||||
override fun onHiddenChanged(hidden: Boolean) {
|
||||
super.onHiddenChanged(hidden)
|
||||
if (!hidden) {
|
||||
val tvModel = tvListViewModel.getTVViewModel(itemPosition)
|
||||
val rowPosition = tvModel?.getRowPosition()
|
||||
val itemPosition = tvModel?.getItemPosition()
|
||||
Log.i(TAG, "toPosition $rowPosition $itemPosition")
|
||||
for (i in rowList) {
|
||||
if (i.tag as Int == rowPosition) {
|
||||
((i as RecyclerView).adapter as CardAdapter).toPosition(itemPosition!!)
|
||||
break
|
||||
}
|
||||
}
|
||||
} else {
|
||||
view?.post {
|
||||
// for (i in rowList) {
|
||||
// ((i as RecyclerView).adapter as CardAdapter).visiable = false
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
Log.i(TAG, "onResume")
|
||||
super.onResume()
|
||||
@@ -375,12 +331,6 @@ class MainFragment : Fragment(), CardAdapter.ItemListener {
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
Log.i(TAG, "onDestroyView")
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "MainFragment"
|
||||
private const val POSITION = "position"
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.lizongying.mytv
|
||||
|
||||
import android.app.Application
|
||||
|
||||
class MyApplication : Application() {
|
||||
}
|
||||
@@ -82,10 +82,17 @@ class PlayerFragment : Fragment(), SurfaceHolder.Callback {
|
||||
Log.e(TAG, "PlaybackException $error")
|
||||
tvViewModel?.changed()
|
||||
}
|
||||
|
||||
override fun onIsPlayingChanged(isPlaying: Boolean) {
|
||||
super.onIsPlayingChanged(isPlaying)
|
||||
if (isPlaying) {
|
||||
(activity as MainActivity).isPlaying()
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
(activity as MainActivity).fragmentReady("PlayerFragment")
|
||||
(activity as MainActivity).fragmentReady()
|
||||
return _binding!!.root
|
||||
}
|
||||
|
||||
|
||||
@@ -4,8 +4,6 @@ import android.os.Handler
|
||||
import android.os.Looper
|
||||
import android.util.Base64
|
||||
import android.util.Log
|
||||
import com.google.gson.Gson
|
||||
import java.net.URLDecoder
|
||||
import com.lizongying.mytv.Utils.getDateFormat
|
||||
import com.lizongying.mytv.api.ApiClient
|
||||
import com.lizongying.mytv.api.Auth
|
||||
@@ -15,8 +13,6 @@ import com.lizongying.mytv.api.FAuthService
|
||||
import com.lizongying.mytv.api.FEPG
|
||||
import com.lizongying.mytv.api.Info
|
||||
import com.lizongying.mytv.api.InfoV2
|
||||
import com.lizongying.mytv.api.KvcollectRequest
|
||||
import com.lizongying.mytv.api.KvcollectRequest2
|
||||
import com.lizongying.mytv.api.LiveInfo
|
||||
import com.lizongying.mytv.api.LiveInfoRequest
|
||||
import com.lizongying.mytv.api.YSP
|
||||
@@ -36,7 +32,6 @@ import retrofit2.Response
|
||||
import javax.crypto.Cipher
|
||||
import javax.crypto.spec.IvParameterSpec
|
||||
import javax.crypto.spec.SecretKeySpec
|
||||
import kotlin.random.Random
|
||||
|
||||
|
||||
object Request {
|
||||
@@ -44,8 +39,6 @@ object Request {
|
||||
private var yspTokenService: YSPTokenService = ApiClient().yspTokenService
|
||||
private var yspApiService: YSPApiService = ApiClient().yspApiService
|
||||
private var yspBtraceService: YSPBtraceService = ApiClient().yspBtraceService
|
||||
private var yspBtraceService2: YSPBtraceService = ApiClient().yspBtraceService2
|
||||
private var yspBtraceService3: YSPBtraceService = ApiClient().yspBtraceService3
|
||||
private var yspProtoService: YSPProtoService = ApiClient().yspProtoService
|
||||
private var yspJceService: YSPJceService = ApiClient().yspJceService
|
||||
private var fAuthService: FAuthService = ApiClient().fAuthService
|
||||
@@ -538,7 +531,7 @@ object Request {
|
||||
|
||||
class BtraceRunnable(private val tvModel: TVViewModel) : Runnable {
|
||||
override fun run() {
|
||||
fetchBtrace3(tvModel)
|
||||
fetchBtrace(tvModel)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,133 +558,7 @@ object Request {
|
||||
callBtracePage?.enqueue(object : Callback<Void> {
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>) {
|
||||
if (response.isSuccessful) {
|
||||
Log.d(TAG, "$title kvcollect success")
|
||||
} else {
|
||||
Log.e(TAG, "$title kvcollect status error")
|
||||
}
|
||||
handler.postDelayed(btraceRunnable, 60 * 1000)
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<Void>, t: Throwable) {
|
||||
Log.e(TAG, "$title kvcollect request error")
|
||||
handler.postDelayed(btraceRunnable, 60 * 1000)
|
||||
}
|
||||
})
|
||||
tvModel.seq++
|
||||
}
|
||||
|
||||
fun fetchBtrace2(tvModel: TVViewModel) {
|
||||
callBtracePage?.cancel()
|
||||
val title = tvModel.getTV().title
|
||||
|
||||
val guid = YSP.getGuid()
|
||||
val pid = tvModel.getTV().pid
|
||||
val sid = tvModel.getTV().sid
|
||||
val randomNumber = Random.nextDouble()
|
||||
val url = tvModel.getTV().videoUrl.first()
|
||||
|
||||
var r = KvcollectRequest(
|
||||
guid = guid,
|
||||
prog = sid,
|
||||
viewid = sid,
|
||||
livepid = pid,
|
||||
sUrl = "https://www.yangshipin.cn/#/tv/home?pid=$pid",
|
||||
playno = YSP.getRand(),
|
||||
rand_str = YSP.getRand(),
|
||||
ftime = getDateFormat("yyyy-MM-dd HH:mm:ss"),
|
||||
seq = tvModel.seq,
|
||||
durl = url,
|
||||
url = url,
|
||||
_dc = randomNumber,
|
||||
)
|
||||
|
||||
var e =
|
||||
"BossId=${r.BossId}&Pwd=${r.Pwd}&_dc=${r._dc}&cdn=${r.cdn}&cmd=${r.cmd}&defn=${r.defn}&downspeed=${r.downspeed}&durl=${r.durl}&errcode=${r.errcode}&fact1=${r.fact1}&firstreport=${r.firstreport}&fplayerver=${r.fplayerver}&ftime=${r.ftime}&geturltime=6&guid=${r.guid}&hc_openid=${r.hc_openid}&hh_ua=${r.hh_ua}&live_type=${r.live_type}&livepid=${r.livepid}&login_type=${r.login_type}&open_id=&openid=${r.openid}&platform=${r.platform}&playno=${r.playno}&prd=${r.prd}&prog=${r.prog}&rand_str=${r.rand_str}&sRef=${r.sRef}&sUrl=${r.sUrl}&sdtfrom=${r.sdtfrom}&seq=${r.seq}&url=${r.url}&viewid=${r.viewid}"
|
||||
println(e)
|
||||
r.signature = YSP.getAuthSignature(e)
|
||||
println(r.signature)
|
||||
|
||||
// val ttt = """{"BossId":2727,"Pwd":1424084450,"prog":"2022576801","playno":"BEoZw3cpZh","guid":"luccvoyr_58va8i3cqw6","hh_ua":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36","cdn":"waibao","sdtfrom":"ysp_pc_01","prd":60000,"platform":"5910204","errcode":"","durl":"https://outlivecloud-cdn.ysp.cctv.cn/906028A94D533483FE8BAC5CF4DB6CC70753E25A93EF3EC50988538DEDBF10161D1EA8F67C916EE41BA9D891D7893C69500B3F1A37CA814D2EE19341197360196CD9CCF327949104097C904643D493EB5A9B588EC28A2FAC1C8E30F8EE330DB2364B0DEC0124F6990A83773FF283489A/2022576803.m3u8?from=player&svrtime=1713365896&pid=600001859&cdn=5401&revoi=6E400EC7436C79D49BA06E61333D31FB8915F3484D9426FE4CCC4DE01CB8FD1DF473A8F416EF1107B669B0A9447F913272789A827EDD3DC0FE88534D9B59A35669678946589AA4D246F8F248F7C33AB08CE72FA0A73FE7F1F9FD2091D30176895CB8BD44A5B85FAD9579C700CB2AFD8D0939574B2A3EFF4C1B237DFF3E0CD3E194662F9FDEE48D1ACD7BDFAB01868B220743021C40E0EA5514ECCF396B509DA1&app_id=519748109&guid=luccvoyr_58va8i3cqw6&ysign=bb79232986c5429600d76cfedb1d5978&ytime=1713365896&ytype=1","firstreport":1,"sUrl":"https://www.yangshipin.cn/#/tv/home?pid=600001859","sRef":"","fplayerver":"100","livepid":"600001859","viewid":"2022576801","seq":0,"cmd":263,"login_type":"","geturltime":6,"downspeed":1.75,"hc_openid":"","open_id":"","defn":"fhd","fact1":"ysp_pc_live_b","openid":"","_dc":0.7140416315131102,"live_type":"","ftime":"2024-04-17 22:58:31","url":"https://outlivecloud-cdn.ysp.cctv.cn/906028A94D533483FE8BAC5CF4DB6CC70753E25A93EF3EC50988538DEDBF10161D1EA8F67C916EE41BA9D891D7893C69500B3F1A37CA814D2EE19341197360196CD9CCF327949104097C904643D493EB5A9B588EC28A2FAC1C8E30F8EE330DB2364B0DEC0124F6990A83773FF283489A/2022576803.m3u8?from=player&svrtime=1713365896&pid=600001859&cdn=5401&revoi=6E400EC7436C79D49BA06E61333D31FB8915F3484D9426FE4CCC4DE01CB8FD1DF473A8F416EF1107B669B0A9447F913272789A827EDD3DC0FE88534D9B59A35669678946589AA4D246F8F248F7C33AB08CE72FA0A73FE7F1F9FD2091D30176895CB8BD44A5B85FAD9579C700CB2AFD8D0939574B2A3EFF4C1B237DFF3E0CD3E194662F9FDEE48D1ACD7BDFAB01868B220743021C40E0EA5514ECCF396B509DA1&app_id=519748109&guid=luccvoyr_58va8i3cqw6&ysign=bb79232986c5429600d76cfedb1d5978&ytime=1713365896&ytype=1","rand_str":"oKkkZs8lON"}"""
|
||||
// val gson = Gson()
|
||||
// r = gson.fromJson(ttt, KvcollectRequest::class.java)
|
||||
//
|
||||
// e =
|
||||
// "BossId=${r.BossId}&Pwd=${r.Pwd}&_dc=${r._dc}&cdn=${r.cdn}&cmd=${r.cmd}&defn=${r.defn}&downspeed=${r.downspeed}&durl=${r.durl}&errcode=${r.errcode}&fact1=${r.fact1}&firstreport=${r.firstreport}&fplayerver=${r.fplayerver}&ftime=${r.ftime}&geturltime=6&guid=${r.guid}&hc_openid=${r.hc_openid}&hh_ua=${r.hh_ua}&live_type=${r.live_type}&livepid=${r.livepid}&login_type=${r.login_type}&open_id=&openid=${r.openid}&platform=${r.platform}&playno=${r.playno}&prd=${r.prd}&prog=${r.prog}&rand_str=${r.rand_str}&sRef=${r.sRef}&sUrl=${r.sUrl}&sdtfrom=${r.sdtfrom}&seq=${r.seq}&url=${r.url}&viewid=${r.viewid}"
|
||||
// println(e)
|
||||
// e = "BossId=2727&Pwd=1424084450&_dc=0.7140416315131102&cdn=waibao&cmd=263&defn=fhd&downspeed=1.75&durl=https://outlivecloud-cdn.ysp.cctv.cn/906028A94D533483FE8BAC5CF4DB6CC70753E25A93EF3EC50988538DEDBF10161D1EA8F67C916EE41BA9D891D7893C69500B3F1A37CA814D2EE19341197360196CD9CCF327949104097C904643D493EB5A9B588EC28A2FAC1C8E30F8EE330DB2364B0DEC0124F6990A83773FF283489A/2022576803.m3u8?from=player&svrtime=1713365896&pid=600001859&cdn=5401&revoi=6E400EC7436C79D49BA06E61333D31FB8915F3484D9426FE4CCC4DE01CB8FD1DF473A8F416EF1107B669B0A9447F913272789A827EDD3DC0FE88534D9B59A35669678946589AA4D246F8F248F7C33AB08CE72FA0A73FE7F1F9FD2091D30176895CB8BD44A5B85FAD9579C700CB2AFD8D0939574B2A3EFF4C1B237DFF3E0CD3E194662F9FDEE48D1ACD7BDFAB01868B220743021C40E0EA5514ECCF396B509DA1&app_id=519748109&guid=luccvoyr_58va8i3cqw6&ysign=bb79232986c5429600d76cfedb1d5978&ytime=1713365896&ytype=1&errcode=&fact1=ysp_pc_live_b&firstreport=1&fplayerver=100&ftime=2024-04-17 22:58:31&geturltime=6&guid=luccvoyr_58va8i3cqw6&hc_openid=&hh_ua=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36&live_type=&livepid=600001859&login_type=&open_id=&openid=&platform=5910204&playno=BEoZw3cpZh&prd=60000&prog=2022576801&rand_str=oKkkZs8lON&sRef=&sUrl=https://www.yangshipin.cn/#/tv/home?pid=600001859&sdtfrom=ysp_pc_01&seq=0&url=https://outlivecloud-cdn.ysp.cctv.cn/906028A94D533483FE8BAC5CF4DB6CC70753E25A93EF3EC50988538DEDBF10161D1EA8F67C916EE41BA9D891D7893C69500B3F1A37CA814D2EE19341197360196CD9CCF327949104097C904643D493EB5A9B588EC28A2FAC1C8E30F8EE330DB2364B0DEC0124F6990A83773FF283489A/2022576803.m3u8?from=player&svrtime=1713365896&pid=600001859&cdn=5401&revoi=6E400EC7436C79D49BA06E61333D31FB8915F3484D9426FE4CCC4DE01CB8FD1DF473A8F416EF1107B669B0A9447F913272789A827EDD3DC0FE88534D9B59A35669678946589AA4D246F8F248F7C33AB08CE72FA0A73FE7F1F9FD2091D30176895CB8BD44A5B85FAD9579C700CB2AFD8D0939574B2A3EFF4C1B237DFF3E0CD3E194662F9FDEE48D1ACD7BDFAB01868B220743021C40E0EA5514ECCF396B509DA1&app_id=519748109&guid=luccvoyr_58va8i3cqw6&ysign=bb79232986c5429600d76cfedb1d5978&ytime=1713365896&ytype=1&viewid=2022576801"
|
||||
// println(e)
|
||||
// r.signature = YSP.getAuthSignature(e)
|
||||
// println(r.signature)
|
||||
|
||||
callBtracePage = yspBtraceService2.kvcollect2(
|
||||
r
|
||||
)
|
||||
callBtracePage?.enqueue(object : Callback<Void> {
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>) {
|
||||
if (response.isSuccessful) {
|
||||
Log.d(TAG, "$title kvcollect success")
|
||||
} else {
|
||||
Log.e(TAG, "$title kvcollect status error")
|
||||
}
|
||||
handler.postDelayed(btraceRunnable, 60 * 1000)
|
||||
}
|
||||
|
||||
override fun onFailure(call: Call<Void>, t: Throwable) {
|
||||
Log.e(TAG, "$title kvcollect request error")
|
||||
handler.postDelayed(btraceRunnable, 60 * 1000)
|
||||
}
|
||||
})
|
||||
tvModel.seq++
|
||||
}
|
||||
|
||||
fun fetchBtrace3(tvModel: TVViewModel) {
|
||||
callBtracePage?.cancel()
|
||||
val title = tvModel.getTV().title
|
||||
|
||||
val guid = YSP.getGuid()
|
||||
val pid = tvModel.getTV().pid
|
||||
val sid = tvModel.getTV().sid
|
||||
val randomNumber = Random.nextDouble()
|
||||
val url = tvModel.getTV().videoUrl.first()
|
||||
|
||||
val r = KvcollectRequest2(
|
||||
guid = guid,
|
||||
prog = sid,
|
||||
viewid = sid,
|
||||
livepid = pid,
|
||||
sUrl = "https://www.yangshipin.cn/#/tv/home?pid=$pid",
|
||||
playno = YSP.getRand(),
|
||||
rand_str = YSP.getRand(),
|
||||
ftime = getDateFormat("yyyy-MM-dd HH:mm:ss"),
|
||||
seq = tvModel.seq,
|
||||
durl = url,
|
||||
url = url,
|
||||
_dc = randomNumber,
|
||||
)
|
||||
|
||||
val e =
|
||||
"BossId=${r.BossId}&Pwd=${r.Pwd}&_dc=${r._dc}&cdn=${r.cdn}&cmd=${r.cmd}&defn=${r.defn}&downspeed=${r.downspeed}&durl=${r.durl}&errcode=${r.errcode}&fact1=${r.fact1}&firstreport=${r.firstreport}&fplayerver=${r.fplayerver}&ftime=${r.ftime}&geturltime=${r.geturltime}&guid=${r.guid}&hc_openid=${r.hc_openid}&hh_ua=${r.hh_ua}&live_type=${r.live_type}&livepid=${r.livepid}&login_type=${r.login_type}&open_id=${r.open_id}&openid=${r.openid}&platform=${r.platform}&playno=${r.playno}&prd=${r.prd}&prog=${r.prog}&rand_str=${r.rand_str}&sRef=${r.sRef}&sUrl=${r.sUrl}&sdtfrom=${r.sdtfrom}&seq=${r.seq}&url=${r.url}&viewid=${r.viewid}"
|
||||
r.signature = YSP.getAuthSignature(e)
|
||||
|
||||
callBtracePage = yspBtraceService3.kvcollect3(
|
||||
guid = r.guid,
|
||||
prog = r.prog,
|
||||
viewid = r.viewid,
|
||||
livepid = r.livepid,
|
||||
sUrl = r.sUrl,
|
||||
playno = r.playno,
|
||||
rand_str = r.rand_str,
|
||||
ftime = r.ftime,
|
||||
seq = "${r.seq}",
|
||||
durl = r.durl,
|
||||
url = r.url,
|
||||
_dc = "${r._dc}",
|
||||
signature = r.signature
|
||||
)
|
||||
callBtracePage?.enqueue(object : Callback<Void> {
|
||||
override fun onResponse(call: Call<Void>, response: Response<Void>) {
|
||||
if (response.isSuccessful) {
|
||||
Log.d(TAG, "$title kvcollect success")
|
||||
// Log.d(TAG, "$title kvcollect success")
|
||||
} else {
|
||||
Log.e(TAG, "$title kvcollect status error")
|
||||
}
|
||||
|
||||
@@ -13,13 +13,9 @@ object SP {
|
||||
// If use channel num to select channel or not
|
||||
private const val KEY_CHANNEL_NUM = "channel_num"
|
||||
|
||||
private const val KEY_TIME = "time"
|
||||
|
||||
// If start app on device boot or not
|
||||
private const val KEY_BOOT_STARTUP = "boot_startup"
|
||||
|
||||
private const val KEY_GRID = "grid"
|
||||
|
||||
// Position in list of the selected channel item
|
||||
private const val KEY_POSITION = "position"
|
||||
|
||||
@@ -43,18 +39,10 @@ object SP {
|
||||
get() = sp.getBoolean(KEY_CHANNEL_NUM, true)
|
||||
set(value) = sp.edit().putBoolean(KEY_CHANNEL_NUM, value).apply()
|
||||
|
||||
var time: Boolean
|
||||
get() = sp.getBoolean(KEY_TIME, true)
|
||||
set(value) = sp.edit().putBoolean(KEY_TIME, value).apply()
|
||||
|
||||
var bootStartup: Boolean
|
||||
get() = sp.getBoolean(KEY_BOOT_STARTUP, false)
|
||||
set(value) = sp.edit().putBoolean(KEY_BOOT_STARTUP, value).apply()
|
||||
|
||||
var grid: Boolean
|
||||
get() = sp.getBoolean(KEY_GRID, false)
|
||||
set(value) = sp.edit().putBoolean(KEY_GRID, value).apply()
|
||||
|
||||
var itemPosition: Int
|
||||
get() = sp.getInt(KEY_POSITION, 0)
|
||||
set(value) = sp.edit().putInt(KEY_POSITION, value).apply()
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.view.WindowManager
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.lizongying.mytv.databinding.SettingBinding
|
||||
|
||||
@@ -16,14 +15,6 @@ class SettingFragment : DialogFragment() {
|
||||
|
||||
private lateinit var updateManager: UpdateManager
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
dialog?.window?.apply {
|
||||
addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN)
|
||||
decorView.systemUiVisibility = View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NO_TITLE, 0)
|
||||
@@ -55,14 +46,6 @@ class SettingFragment : DialogFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
binding.switchTime.run {
|
||||
isChecked = SP.time
|
||||
setOnCheckedChangeListener { _, isChecked ->
|
||||
SP.time = isChecked
|
||||
(activity as MainActivity).settingDelayHide()
|
||||
}
|
||||
}
|
||||
|
||||
binding.switchBootStartup.run {
|
||||
isChecked = SP.bootStartup
|
||||
setOnCheckedChangeListener { _, isChecked ->
|
||||
@@ -71,14 +54,6 @@ class SettingFragment : DialogFragment() {
|
||||
}
|
||||
}
|
||||
|
||||
binding.switchGrid.run {
|
||||
isChecked = SP.grid
|
||||
setOnCheckedChangeListener { _, isChecked ->
|
||||
SP.grid = isChecked
|
||||
(activity as MainActivity).settingDelayHide()
|
||||
}
|
||||
}
|
||||
|
||||
updateManager = UpdateManager(context, this, context.appVersionCode)
|
||||
binding.checkVersion.setOnClickListener(
|
||||
OnClickListenerCheckVersion(
|
||||
|
||||
@@ -14,7 +14,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV1 综合",
|
||||
"CCTV1",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226231/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/d57905b93540bd15f0c48230dbbbff7ee0d645ff539e38866e2d15c8b9f7dfcd.png?imageMogr2/format/webp",
|
||||
"600001859",
|
||||
@@ -27,7 +27,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV2 财经",
|
||||
"CCTV2",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226195/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/20115388de0207131af17eac86c33049b95d69eaff064e55653a1b941810a006.png?imageMogr2/format/webp",
|
||||
"600001800",
|
||||
@@ -40,7 +40,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV3 综艺",
|
||||
"CCTV3",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226397/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/7b7a65c712450da3deb6ca66fbacf4f9aee00d3f20bd80eafb5ada01ec63eb3a.png?imageMogr2/format/webp",
|
||||
"600001801",
|
||||
@@ -53,7 +53,10 @@ object TVList {
|
||||
0,
|
||||
"CCTV4 中文国际",
|
||||
"CCTV4",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://39.134.24.161/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226191/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226191/index.m3u8"
|
||||
),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/f357e58fdbcc076a3d65e1f958c942b2e14f14342c60736ceed98b092d35356a.png?imageMogr2/format/webp",
|
||||
"600001814",
|
||||
@@ -66,7 +69,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV5 体育",
|
||||
"CCTV5",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226395/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/0a6a7138952675983a3d854df7688557b286d59aa06166edae51506f9204d655.png?imageMogr2/format/webp",
|
||||
"600001818",
|
||||
@@ -79,7 +82,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV6 电影",
|
||||
"CCTV6",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226393/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/741515efda91f03f455df8a7da4ee11fa9329139c276435cf0a9e2af398d5bf2.png?imageMogr2/format/webp",
|
||||
"600108442",
|
||||
@@ -92,7 +95,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV7 国防军事",
|
||||
"CCTV7",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226192/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/b29af94e295ebdf646cefb68122c429b9cd921f498ca20d2d8070252536f9ff9.png?imageMogr2/format/webp",
|
||||
"600004092",
|
||||
@@ -105,7 +108,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV8 电视剧",
|
||||
"CCTV8",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226391/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/ad51de94426a0ba039e6dd6a8534ea98ecc813a6176bde87b4f18cc34d6d7590.png?imageMogr2/format/webp",
|
||||
"600001803",
|
||||
@@ -118,7 +121,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV9 纪录",
|
||||
"CCTV9",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226197/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/2ed1b4deeca179d5db806bb941790f82eb92a1b7299c1c38fe027f95a5caee5e.png?imageMogr2/format/webp",
|
||||
"600004078",
|
||||
@@ -131,7 +134,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV10 科教",
|
||||
"CCTV10",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226189/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/aa6157ec65188cd41826e5a2f088c3d6d153205f5f6428258d12c59999e221aa.png?imageMogr2/format/webp",
|
||||
"600001805",
|
||||
@@ -144,7 +147,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV11 戏曲",
|
||||
"CCTV11",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226240/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/ed12ed7c7a1034dae4350011fe039284c5d5a836506b28c9e32e3c75299625c0.png?imageMogr2/format/webp",
|
||||
"600001806",
|
||||
@@ -157,7 +160,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV12 社会与法",
|
||||
"CCTV12",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226190/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/484083cffaa40df7e659565e8cb4d1cc740158a185512114167aa21fa0c59240.png?imageMogr2/format/webp",
|
||||
"600001807",
|
||||
@@ -170,7 +173,9 @@ object TVList {
|
||||
0,
|
||||
"CCTV13 新闻",
|
||||
"CCTV13",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226233/index.m3u8"
|
||||
),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/266da7b43c03e2312186b4a999e0f060e8f15b10d2cc2c9aa32171819254cf1a.png?imageMogr2/format/webp",
|
||||
"600001811",
|
||||
@@ -183,7 +188,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV14 少儿",
|
||||
"CCTV14",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226193/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/af6b603896938dc346fbb16abfc63c12cba54b0ec9d18770a15d347d115f12d5.png?imageMogr2/format/webp",
|
||||
"600001809",
|
||||
@@ -196,7 +201,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV15 音乐",
|
||||
"CCTV15",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225785/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/2ceee92188ef684efe0d8b90839c4f3ad450d179dc64d59beff417059453af47.png?imageMogr2/format/webp",
|
||||
"600001815",
|
||||
@@ -209,7 +214,10 @@ object TVList {
|
||||
0,
|
||||
"CCTV16 奥林匹克",
|
||||
"CCTV16-HD",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226921/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226921/index.m3u8"
|
||||
),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/53793fa7bacd3a93ff6dc5d2758418985e1f952a316c335d663b572d8bdcd74d.png?imageMogr2/format/webp",
|
||||
"600098637",
|
||||
@@ -222,7 +230,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV17 农业农村",
|
||||
"CCTV17",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226198/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/ddef563072f8bad2bea5b9e52674cb7b4ed50efb20c26e61994dfbdf05c1e3c0.png?imageMogr2/format/webp",
|
||||
"600001810",
|
||||
@@ -235,7 +243,7 @@ object TVList {
|
||||
0,
|
||||
"CCTV5+ 体育赛事",
|
||||
"CCTV5+",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226221/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/649ad76a90bfef55b05db9fe52e006487280f619089099d5dc971e387fc6eff0.png?imageMogr2/format/webp",
|
||||
"600001817",
|
||||
@@ -274,7 +282,7 @@ object TVList {
|
||||
0,
|
||||
"风云剧场",
|
||||
"CCTV风云剧场频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226950/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/4d549e53e6d0f632d5a633d1945280797b153e588f919221a07faa869812cc89.png?imageMogr2/format/webp",
|
||||
"600099658",
|
||||
@@ -287,7 +295,7 @@ object TVList {
|
||||
0,
|
||||
"第一剧场",
|
||||
"CCTV第一剧场频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226959/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/a556bd7d93ce65e18f243a8892b5604f4faa994a4897315914216a710a706208.png?imageMogr2/format/webp",
|
||||
"600099655",
|
||||
@@ -300,7 +308,7 @@ object TVList {
|
||||
0,
|
||||
"怀旧剧场",
|
||||
"CCTV怀旧剧场频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226972/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/5661bd04fecdb6e899f801147a22ab5d3a475bf2b62e30aec2c0023190ebc9b1.png?imageMogr2/format/webp",
|
||||
"600099620",
|
||||
@@ -326,7 +334,7 @@ object TVList {
|
||||
0,
|
||||
"风云音乐",
|
||||
"CCTV风云音乐频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226953/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/bbf1d024c5228b8dd128b0e3cb1717d173fab4ee84c3a4c8a57b1a215362ca3b.png?imageMogr2/format/webp",
|
||||
"600099660",
|
||||
@@ -339,7 +347,7 @@ object TVList {
|
||||
0,
|
||||
"兵器科技",
|
||||
"CCTV兵器科技频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226975/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/4c6b6a6d3839889f34d33db3c2f80233b26b74d3489b393487635f8704e70796.png?imageMogr2/format/webp",
|
||||
"600099649",
|
||||
@@ -352,7 +360,7 @@ object TVList {
|
||||
0,
|
||||
"风云足球",
|
||||
"CCTV风云足球频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226984/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/cd1e2bb52b06a991de168733e5ff0f1d85adc8042d40c8f393f723543e5dd08a.png?imageMogr2/format/webp",
|
||||
"600099636",
|
||||
@@ -365,7 +373,7 @@ object TVList {
|
||||
0,
|
||||
"高尔夫网球",
|
||||
"CCTV高尔夫·网球频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226978/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/cdd1b31ede7a5ad049ed53d9a072422f829e72dd062ed2c19e077fdd01699071.png?imageMogr2/format/webp",
|
||||
"600099659",
|
||||
@@ -378,7 +386,7 @@ object TVList {
|
||||
0,
|
||||
"女性时尚",
|
||||
"CCTV女性时尚频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226969/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/fa28955ce8b2539d728bf4c6a13a46ff57ad76eae46627f7bcfb1ed8a613d3fc.png?imageMogr2/format/webp",
|
||||
"600099650",
|
||||
@@ -391,7 +399,7 @@ object TVList {
|
||||
0,
|
||||
"央视文化精品",
|
||||
"CCTV央视文化精品频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226981/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/14ac5ce40482cacd3d4b37435222bfe86af2b452a2f04ecbfc1d13d76edd7c57.png?imageMogr2/format/webp",
|
||||
"600099653",
|
||||
@@ -404,7 +412,7 @@ object TVList {
|
||||
0,
|
||||
"央视台球",
|
||||
"CCTV央视台球频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226956/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/10e14a92478011aa6c3c8562e62127f3b1908e29fcd78e4b2b24b9e6d3ec2fbc.png?imageMogr2/format/webp",
|
||||
"600099652",
|
||||
@@ -417,7 +425,7 @@ object TVList {
|
||||
0,
|
||||
"电视指南",
|
||||
"CCTV电视指南频道",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888893/224/3221226987/index.m3u8"),
|
||||
"央视",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/244d72c0eb1615ed7d51c2f5db5a67f306aa3f58c05bc2d34de3aa7e956dc8c9.png?imageMogr2/format/webp",
|
||||
"600099656",
|
||||
@@ -445,7 +453,7 @@ object TVList {
|
||||
0,
|
||||
"东方卫视",
|
||||
"东方卫视",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226217/index.m3u8"),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/9bd372ca292a82ce3aa08772b07efc4af1f85c21d1f268ea33440c49e9a0a488.png?imageMogr2/format/webp",
|
||||
"600002483",
|
||||
@@ -458,7 +466,10 @@ object TVList {
|
||||
0,
|
||||
"湖南卫视",
|
||||
"湖南卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226307/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226211/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/4120e89d3079d08aa17d382f69a2308ec70839b278367763c34a34666c75cb88.png?imageMogr2/format/webp",
|
||||
"600002475",
|
||||
@@ -471,7 +482,10 @@ object TVList {
|
||||
0,
|
||||
"湖北卫视",
|
||||
"湖北卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226477/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226194/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/7a6be5a2bb1dc53a945c016ff1f525dc4a84c51db371c15c89aa55404b0ba784.png?imageMogr2/format/webp",
|
||||
"600002508",
|
||||
@@ -484,7 +498,10 @@ object TVList {
|
||||
0,
|
||||
"辽宁卫视",
|
||||
"辽宁卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226546/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226201/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/ac4ed6058a87c101ae7147ebc38905d0cae047fb73fd277ee5049b84f52bda36.png?imageMogr2/format/webp",
|
||||
"600002505",
|
||||
@@ -497,7 +514,10 @@ object TVList {
|
||||
0,
|
||||
"江苏卫视",
|
||||
"江苏卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://39.134.24.166/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226200/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226200/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/380ad685c0c1d5b2c902246b8d2df6d3f9b45e2837abcfe493075bbded597a31.png?imageMogr2/format/webp",
|
||||
"600002521",
|
||||
@@ -510,7 +530,10 @@ object TVList {
|
||||
0,
|
||||
"江西卫视",
|
||||
"江西卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226344/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225764/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/3c760d0d00463855890e8a1864ea4a6b6dd66b90c29b4ac714a4b17c16519871.png?imageMogr2/format/webp",
|
||||
"600002503",
|
||||
@@ -523,7 +546,7 @@ object TVList {
|
||||
0,
|
||||
"山东卫视",
|
||||
"山东卫视",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226209/index.m3u8"),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/22d403f07a7cf5410b3ad3ddb65a11aa229a32475fac213f5344c9f0ec330ca1.png?imageMogr2/format/webp",
|
||||
"600002513",
|
||||
@@ -536,7 +559,7 @@ object TVList {
|
||||
0,
|
||||
"广东卫视",
|
||||
"广东卫视",
|
||||
listOf(),
|
||||
listOf("http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226216/index.m3u8"),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/28886880a4dc0f06fb7e0a528a1def0591d61a65870e29176ede0cc92033bbfd.png?imageMogr2/format/webp",
|
||||
"600002485",
|
||||
@@ -549,7 +572,10 @@ object TVList {
|
||||
0,
|
||||
"广西卫视",
|
||||
"广西卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://live.gxrb.com.cn/tv/gxtvlive03/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225770/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/54b7e97cb816bb223fe05f3fc44da2c7820eb66e8550c19d23100f2c414ecc38.png?imageMogr2/format/webp",
|
||||
"600002509",
|
||||
@@ -562,7 +588,10 @@ object TVList {
|
||||
0,
|
||||
"重庆卫视",
|
||||
"重庆卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226409/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226202/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
R.drawable.chongqing,
|
||||
"600002531",
|
||||
@@ -575,7 +604,10 @@ object TVList {
|
||||
0,
|
||||
"河南卫视",
|
||||
"河南卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226480/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225767/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/74925962148a6d31c85808b6cd4e444c2a54bab393d2c5fc85e960b50e22fa86.png?imageMogr2/format/webp",
|
||||
"600002525",
|
||||
@@ -588,7 +620,10 @@ object TVList {
|
||||
0,
|
||||
"河北卫视",
|
||||
"河北卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226406/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225750/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/d545becdc81c60197b08c7f47380705e4665ed3fe55efc8b855e486f6e655378.png?imageMogr2/format/webp",
|
||||
"600002493",
|
||||
@@ -601,7 +636,10 @@ object TVList {
|
||||
0,
|
||||
"贵州卫视",
|
||||
"贵州卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226474/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225793/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/4eb45f4781d33d872af027dc01c941559aab55667dd99cc5c22bef7037807b13.png?imageMogr2/format/webp",
|
||||
"600002490",
|
||||
@@ -614,7 +652,10 @@ object TVList {
|
||||
0,
|
||||
"北京卫视",
|
||||
"北京卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221225728/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226222/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/f4f23633c578beea49a3841d88d3490100f029ee349059fa532869db889872c5.png?imageMogr2/format/webp",
|
||||
"600002309",
|
||||
@@ -627,7 +668,10 @@ object TVList {
|
||||
0,
|
||||
"黑龙江卫视",
|
||||
"黑龙江卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226327/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226215/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/d8273ae9be698ce2db21f5b886ecac95a73429593f93713c60ed8c12c38bf0d3.png?imageMogr2/format/webp",
|
||||
"600002498",
|
||||
@@ -640,7 +684,10 @@ object TVList {
|
||||
0,
|
||||
"浙江卫视",
|
||||
"浙江卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://hw-m-l.cztv.com/channels/lantian/channel01/1080p.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226199/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/a66c836bd98ba3e41a2e9a570d4b9c50dedc6839e9de333e2e78212ad505f37e.png?imageMogr2/format/webp",
|
||||
"600002520",
|
||||
@@ -653,7 +700,10 @@ object TVList {
|
||||
0,
|
||||
"安徽卫视",
|
||||
"安徽卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226391/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226203/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/f35fa04b51b1ee4984b03578b65403570868ebca03c6c01e11b097f999a58d9b.png?imageMogr2/format/webp",
|
||||
"600002532",
|
||||
@@ -666,7 +716,10 @@ object TVList {
|
||||
0,
|
||||
"深圳卫视",
|
||||
"深圳卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://39.134.24.166/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226205/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226205/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/d59fec04c902e3581c617136d02d4b9b8c4cbe64272781ddd3525e80c823edb7.png?imageMogr2/format/webp",
|
||||
"600002481",
|
||||
@@ -679,7 +732,10 @@ object TVList {
|
||||
0,
|
||||
"四川卫视",
|
||||
"四川卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225768/index.m3u8",
|
||||
"http://39.134.24.166/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225768/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/3276a414ae0eaa0f116f2045cd913367967d0c7c1e978e8621ac3879436c6ed7.png?imageMogr2/format/webp",
|
||||
"600002516",
|
||||
@@ -692,7 +748,10 @@ object TVList {
|
||||
0,
|
||||
"东南卫视",
|
||||
"福建东南卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226341/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225766/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/3208fe6564a293c21b711333fb3edb05bb5b406cff840573c9a8d839680a1579.png?imageMogr2/format/webp",
|
||||
"600002484",
|
||||
@@ -705,7 +764,10 @@ object TVList {
|
||||
0,
|
||||
"海南卫视",
|
||||
"海南卫视",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://ottrrs.hl.chinamobile.com/PLTV/88888888/224/3221226465/index.m3u8",
|
||||
"http://dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225769/index.m3u8"
|
||||
),
|
||||
"地方",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/6e060391fde0469801fc3d84dbf204b4f8d650d251f17d7595a6964c0bb99e81.png?imageMogr2/format/webp",
|
||||
"600002506",
|
||||
@@ -813,7 +875,7 @@ object TVList {
|
||||
0,
|
||||
"CGTN",
|
||||
"CGTN",
|
||||
listOf(),
|
||||
listOf("http://live.cgtn.com/1000/prog_index.m3u8"),
|
||||
"国际",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/a72dff758ca1c17cd0ecc8cedc11b893d208f409d5e6302faa0e9d298848abc3.png?imageMogr2/format/webp",
|
||||
"600014550",
|
||||
@@ -826,7 +888,7 @@ object TVList {
|
||||
0,
|
||||
"CGTN 法语频道",
|
||||
"CGTN法语频道",
|
||||
listOf(),
|
||||
listOf("https://livefr.cgtn.com/1000f/prog_index.m3u8"),
|
||||
"国际",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/a8d0046a47433d952bf6ed17062deb8bd2184ba9aec0f7781df6bf9487a3ffcf.png?imageMogr2/format/webp",
|
||||
"600084704",
|
||||
@@ -839,7 +901,7 @@ object TVList {
|
||||
0,
|
||||
"CGTN 俄语频道",
|
||||
"CGTN俄语频道",
|
||||
listOf(),
|
||||
listOf("http://liveru.cgtn.com/1000r/prog_index.m3u8"),
|
||||
"国际",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/bf0a820893cbaf20dd0333e27042e1ef9c8806e5b602b6a8c95af399db0bc77a.png?imageMogr2/format/webp",
|
||||
"600084758",
|
||||
@@ -852,7 +914,7 @@ object TVList {
|
||||
0,
|
||||
"CGTN 阿拉伯语频道",
|
||||
"CGTN阿拉伯语频道",
|
||||
listOf(),
|
||||
listOf("http://livear.cgtn.com/1000a/prog_index.m3u8"),
|
||||
"国际",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202306/2e44e2aa3e7a1cedf07fd0ae59fe69e86a60a2632660a006e3e9e7397b2d107e.png?imageMogr2/format/webp",
|
||||
"600084782",
|
||||
@@ -865,7 +927,10 @@ object TVList {
|
||||
0,
|
||||
"CGTN 西班牙语频道",
|
||||
"CGTN西班牙语频道",
|
||||
listOf(),
|
||||
listOf(
|
||||
"http://livees.cgtn.com/500e/prog_index.m3u8",
|
||||
"http://livees.cgtn.com/1000e/prog_index.m3u8"
|
||||
),
|
||||
"国际",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202309/7c337e3dbe64402ec7e4678a619a4a6d95144e42f35161181ff78e143b7cf67a.png?imageMogr2/format/webp",
|
||||
"600084744",
|
||||
@@ -878,7 +943,7 @@ object TVList {
|
||||
0,
|
||||
"CGTN 纪录频道",
|
||||
"CGTN外语纪录频道",
|
||||
listOf(),
|
||||
listOf("https://livedoc.cgtn.com/500d/prog_index.m3u8"),
|
||||
"国际",
|
||||
"https://resources.yangshipin.cn/assets/oms/image/202309/74d3ac436a7e374879578de1d87a941fbf566d39d5632b027c5097891ed32bd5.png?imageMogr2/format/webp",
|
||||
"600084781",
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
package com.lizongying.mytv
|
||||
|
||||
import android.os.Bundle
|
||||
import android.os.Handler
|
||||
import android.util.Log
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.fragment.app.Fragment
|
||||
import com.lizongying.mytv.Utils.getDateFormat
|
||||
import com.lizongying.mytv.databinding.TimeBinding
|
||||
|
||||
class TimeFragment : Fragment() {
|
||||
private var _binding: TimeBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
private val handler = Handler()
|
||||
private val delay: Long = 1000
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View {
|
||||
Log.i(TAG, "onCreateView")
|
||||
_binding = TimeBinding.inflate(inflater, container, false)
|
||||
(activity as MainActivity).fragmentReady("TimeFragment")
|
||||
return binding.root
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
if (view?.visibility == View.VISIBLE) {
|
||||
handler.removeCallbacks(showRunnable)
|
||||
handler.postDelayed(showRunnable, 0)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
super.onPause()
|
||||
handler.removeCallbacks(showRunnable)
|
||||
}
|
||||
|
||||
private val showRunnable: Runnable = Runnable {
|
||||
run {
|
||||
binding.channelContent.text = getDateFormat("HH:mm")
|
||||
handler.postDelayed(showRunnable, delay)
|
||||
}
|
||||
}
|
||||
|
||||
fun show() {
|
||||
view?.visibility = View.VISIBLE
|
||||
handler.removeCallbacks(showRunnable)
|
||||
handler.postDelayed(showRunnable, 0)
|
||||
}
|
||||
|
||||
fun hide() {
|
||||
view?.visibility = View.GONE
|
||||
handler.removeCallbacks(showRunnable)
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val TAG = "TimeFragment"
|
||||
}
|
||||
}
|
||||
@@ -22,8 +22,6 @@ class ApiClient {
|
||||
private val myUrl = "https://lyrics.run/"
|
||||
private val protoUrl = "https://capi.yangshipin.cn/"
|
||||
private val traceUrl = "https://btrace.yangshipin.cn/"
|
||||
private val trace2Url = "https://aatc-api.yangshipin.cn/"
|
||||
private val trace3Url = "https://dtrace.ysp.cctv.cn/"
|
||||
private val jceUrl = "https://jacc.ysp.cctv.cn/"
|
||||
private val fUrl = "https://m.fengshows.com/"
|
||||
|
||||
@@ -69,22 +67,6 @@ class ApiClient {
|
||||
.build().create(YSPBtraceService::class.java)
|
||||
}
|
||||
|
||||
val yspBtraceService2: YSPBtraceService by lazy {
|
||||
Retrofit.Builder()
|
||||
.baseUrl(trace2Url)
|
||||
.client(okHttpClient)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.build().create(YSPBtraceService::class.java)
|
||||
}
|
||||
|
||||
val yspBtraceService3: YSPBtraceService by lazy {
|
||||
Retrofit.Builder()
|
||||
.baseUrl(trace3Url)
|
||||
.client(okHttpClient)
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
.build().create(YSPBtraceService::class.java)
|
||||
}
|
||||
|
||||
val yspJceService: YSPJceService by lazy {
|
||||
Retrofit.Builder()
|
||||
.baseUrl(jceUrl)
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
package com.lizongying.mytv.api
|
||||
|
||||
data class KvcollectRequest(
|
||||
val BossId: Int = 2727,
|
||||
val Pwd: Int = 1424084450,
|
||||
val cdn: String = "waibao",
|
||||
val cmd: Int = 263,
|
||||
val defn: String = "fhd",
|
||||
val downspeed: Double = 10.0,
|
||||
val durl: String = "", //
|
||||
val errcode: String = "",
|
||||
val fact1: String = "ysp_pc_live_b",
|
||||
val firstreport: Int = 0,
|
||||
val fplayerver: String = "100",
|
||||
val ftime: String = "", //
|
||||
val geturltime: Int = 0,
|
||||
val guid: String = "", //
|
||||
val hc_openid: String = "",
|
||||
val hh_ua: String = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
|
||||
val live_type: String = "",
|
||||
val livepid: String = "", //
|
||||
val login_type: String = "",
|
||||
val open_id: String = "",
|
||||
val openid: String = "",
|
||||
val platform: String = "5910204",
|
||||
val playno: String = "", //
|
||||
val prd: Int = 60000,
|
||||
val prog: String = "", //
|
||||
val rand_str: String = "", //
|
||||
val sRef: String = "",
|
||||
val sUrl: String = "", //
|
||||
val sdtfrom: String = "ysp_pc_01",
|
||||
val seq: Int = 9, //
|
||||
var signature: String = "",
|
||||
val url: String = "", //
|
||||
val viewid: String = "", //
|
||||
val _dc: Double = 0.0,
|
||||
)
|
||||
|
||||
|
||||
data class KvcollectRequest2(
|
||||
val BossId: Int = 2727,
|
||||
val Pwd: Int = 1424084450,
|
||||
val cdn: String = "waibao",
|
||||
val cmd: Int = 263,
|
||||
val defn: String = "fhd",
|
||||
val downspeed: String = "10",
|
||||
val durl: String = "", //
|
||||
val errcode: String = "",
|
||||
val fact1: String = "ysp_pc_live_b",
|
||||
val firstreport: Int = 0,
|
||||
val fplayerver: String = "100",
|
||||
val ftime: String = "", //
|
||||
val geturltime: Int = 0,
|
||||
val guid: String = "", //
|
||||
val hc_openid: String = "",
|
||||
val hh_ua: String = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
|
||||
val live_type: String = "",
|
||||
val livepid: String = "", //
|
||||
val login_type: String = "",
|
||||
val open_id: String = "",
|
||||
val openid: String = "",
|
||||
val platform: String = "5910204",
|
||||
val playno: String = "", //
|
||||
val prd: Int = 60000,
|
||||
val prog: String = "", //
|
||||
val rand_str: String = "", //
|
||||
val sRef: String = "",
|
||||
val sUrl: String = "", //
|
||||
val sdtfrom: String = "ysp_pc_01",
|
||||
val seq: Int = 9, //
|
||||
var signature: String = "",
|
||||
val url: String = "", //
|
||||
val viewid: String = "", //
|
||||
val _dc: Double = 0.0,
|
||||
)
|
||||
@@ -7,6 +7,6 @@ import retrofit2.http.Path
|
||||
interface ReleaseService {
|
||||
@GET("my-tv/v2/release/{name}")
|
||||
fun getRelease(
|
||||
@Path("name") date: String = "2",
|
||||
@Path("name") date: String = "1",
|
||||
): Call<ReleaseV2>
|
||||
}
|
||||
@@ -141,9 +141,4 @@ object YSP {
|
||||
val hashedData = encryptor.hash2(e) ?: return ""
|
||||
return hashedData.let { it -> it.joinToString("") { "%02x".format(it) } }
|
||||
}
|
||||
|
||||
fun getAuthSignature(e: String): String {
|
||||
val hashedData = encryptor.hash2(e.toByteArray()) ?: return ""
|
||||
return hashedData.let { it -> it.joinToString("") { "%02x".format(it) } }
|
||||
}
|
||||
}
|
||||
@@ -21,6 +21,18 @@ interface YSPApiService {
|
||||
@Body request: LiveInfoRequest,
|
||||
): Call<LiveInfo>
|
||||
|
||||
@POST("v1/player/get_live_info")
|
||||
@Headers(
|
||||
"content-type: application/json;charset=UTF-8",
|
||||
"referer: https://www.yangshipin.cn/",
|
||||
"yspappid: 519748109",
|
||||
"user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
|
||||
)
|
||||
fun getLiveInfoV2(
|
||||
@Header("cookie") cookie: String,
|
||||
@Body request: LiveInfoRequest,
|
||||
): Call<LiveInfo>
|
||||
|
||||
@POST("v1/player/auth")
|
||||
@Headers(
|
||||
"content-type: application/x-www-form-urlencoded;charset=UTF-8",
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package com.lizongying.mytv.api
|
||||
|
||||
import retrofit2.Call
|
||||
import retrofit2.http.Body
|
||||
import retrofit2.http.Field
|
||||
import retrofit2.http.FormUrlEncoded
|
||||
import retrofit2.http.Headers
|
||||
import retrofit2.http.POST
|
||||
import retrofit2.http.Path
|
||||
import retrofit2.http.Query
|
||||
|
||||
|
||||
@@ -68,58 +68,4 @@ interface YSPBtraceService {
|
||||
@Field("c_guid") c_guid: String = "",
|
||||
@Field("c_vuid") c_vuid: String = "-",
|
||||
): Call<Void>
|
||||
|
||||
@POST("kvcollect")
|
||||
@Headers(
|
||||
"content-type: application/json",
|
||||
"referer: https://www.yangshipin.cn/",
|
||||
"Cookie: guid=1; versionName=99.99.99; versionCode=999999; vplatform=109; platformVersion=Chrome; deviceModel=123",
|
||||
"User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
|
||||
)
|
||||
fun kvcollect2(
|
||||
@Body request: KvcollectRequest,
|
||||
): Call<Void>
|
||||
|
||||
@FormUrlEncoded
|
||||
@POST("kvcollect")
|
||||
@Headers(
|
||||
"content-type: application/x-www-form-urlencoded",
|
||||
"referer: https://www.yangshipin.cn/",
|
||||
)
|
||||
fun kvcollect3(
|
||||
@Field("BossId") BossId: String = "9141",
|
||||
@Field("Pwd") Pwd: String = "1137850982",
|
||||
@Field("prog") prog: String = "", //
|
||||
@Field("playno") playno: String = "", //
|
||||
@Field("guid") guid: String = "", //
|
||||
@Field("hh_ua") hh_ua: String = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
|
||||
@Field("cdn") cdn: String = "waibao",
|
||||
@Field("sdtfrom") sdtfrom: String = "ysp_pc_01",
|
||||
@Field("prd") prd: String = "60000",
|
||||
@Field("platform") platform: String = "5910204",
|
||||
@Field("errcode") errcode: String = "-",
|
||||
@Field("durl") durl: String = "", //
|
||||
@Field("firstreport") firstreport: String = "-",
|
||||
@Field("sUrl") sUrl: String = "", //
|
||||
@Field("sRef") sRef: String = "-",
|
||||
@Field("fplayerver") fplayerver: String = "100",
|
||||
@Field("livepid") livepid: String = "",
|
||||
@Field("viewid") viewid: String = "",
|
||||
@Field("seq") seq: String = "",
|
||||
@Field("cmd") cmd: String = "263",
|
||||
@Field("login_type") login_type: String = "-",
|
||||
@Field("geturltime") geturltime: String = "-",
|
||||
@Field("downspeed") downspeed: String = "10",
|
||||
@Field("hc_openid") hc_openid: String = "-",
|
||||
@Field("open_id") open_id: String = "-",
|
||||
@Field("defn") defn: String = "fhd",
|
||||
@Field("fact1") fact1: String = "ysp_pc_live_b",
|
||||
@Field("openid") openid: String = "-",
|
||||
@Field("_dc") _dc: String = "",
|
||||
@Field("live_type") live_type: String = "-",
|
||||
@Field("ftime") ftime: String = "",
|
||||
@Field("url") url: String = "",
|
||||
@Field("rand_str") rand_str: String = "", //
|
||||
@Field("signature") signature: String = "",
|
||||
): Call<Void>
|
||||
}
|
||||
@@ -1,11 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/channel_fragment"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="60dp"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:layout_gravity="end|top"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_marginEnd="170dp">
|
||||
android:layout_marginEnd="50dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/channel_content"
|
||||
@@ -15,5 +15,5 @@
|
||||
android:layout_marginTop="0dp"
|
||||
android:textColor="#FFEEEEEE"
|
||||
android:textStyle="bold"
|
||||
android:textSize="40sp" />
|
||||
android:textSize="50sp" />
|
||||
</FrameLayout>
|
||||
@@ -1,21 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/menu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@android:color/transparent"
|
||||
android:clickable="true"
|
||||
android:focusable="false"
|
||||
>
|
||||
<ScrollView
|
||||
android:id="@+id/scroll_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
<LinearLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
</FrameLayout>
|
||||
@@ -1,29 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/row"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:background="@android:color/transparent"
|
||||
android:clickable="true"
|
||||
android:focusable="false"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/row_header"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start"
|
||||
android:layout_marginTop="0dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:gravity="start"
|
||||
android:textColor="#FFEEEEEE"
|
||||
android:textSize="22sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/row_items"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
</androidx.recyclerview.widget.RecyclerView>
|
||||
</LinearLayout>
|
||||
@@ -64,24 +64,12 @@
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<Switch
|
||||
android:id="@+id/switch_time"
|
||||
android:text="@string/title_time"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<Switch
|
||||
android:id="@+id/switch_boot_startup"
|
||||
android:text="@string/title_boot_startup"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
<Switch
|
||||
android:id="@+id/switch_grid"
|
||||
android:text="@string/title_grid"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content" />
|
||||
</LinearLayout>
|
||||
<ImageView
|
||||
android:layout_width="300dp"
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/time"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="end|top"
|
||||
android:layout_marginTop="25dp"
|
||||
android:layout_marginEnd="50dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/channel_content"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="0dp"
|
||||
android:textColor="#FFEEEEEE"
|
||||
android:textStyle="bold"
|
||||
android:textSize="34sp" />
|
||||
</FrameLayout>
|
||||
@@ -1,8 +1,7 @@
|
||||
<resources>
|
||||
<color name="focus">#0096a6</color>
|
||||
<color name="fastlane_background">#30000000</color>
|
||||
<color name="black">#000</color>
|
||||
<color name="white">#FFF</color>
|
||||
<color name="gray_overlay">#7F000000</color>
|
||||
<color name="focus">#0096a6</color>
|
||||
<color name="blur">#FF263238</color>
|
||||
<color name="ic_launcher_background">#223239</color>
|
||||
</resources>
|
||||
@@ -1,4 +1,3 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<color name="ic_launcher_background">#223239</color>
|
||||
</resources>
|
||||
@@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="server_url">http://localhost:8080</string>
|
||||
</resources>
|
||||
@@ -1,9 +1,8 @@
|
||||
<resources>
|
||||
<string name="app_name">我的电视</string>
|
||||
<string name="title_channel_reversal">换台反转</string>
|
||||
<string name="title_channel_num">换台时显示频道号</string>
|
||||
<string name="title_channel_num">数字选台</string>
|
||||
<string name="check_version">检查更新</string>
|
||||
<string name="title_boot_startup">开机自启</string>
|
||||
<string name="title_grid">频道列表采用网格样式</string>
|
||||
<string name="title_time">显示时间</string>
|
||||
<string name="dismiss_error">好的</string>
|
||||
</resources>
|
||||
@@ -1,25 +1,10 @@
|
||||
<resources>
|
||||
|
||||
<style name="CustomImageCardViewStyle" parent="Widget.Leanback.ImageCardViewStyle">
|
||||
<item name="cardType">infoUnder</item>
|
||||
<item name="infoVisibility">always</item>
|
||||
<!-- In order to keep backward compatibility we have to create an icon on right. -->
|
||||
<item name="lbImageCardViewType">Title|Content|IconOnRight</item>
|
||||
<!-- Deprecated. Use 'Widget.Leanback.ImageCardView.InfoAreaStyle' instead. -->
|
||||
<item name="infoAreaBackground">@null</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomImageCardViewImageStyle" parent="Widget.Leanback.ImageCardView.ImageStyle">
|
||||
<item name="android:layout_width">160dp</item>
|
||||
<item name="android:layout_height">40dp</item>
|
||||
<item name="android:adjustViewBounds">true</item>
|
||||
<item name="android:contentDescription">@null</item>
|
||||
<item name="android:scaleType">centerCrop</item>
|
||||
<item name="layout_viewType">main</item>
|
||||
<item name="lbImageCardViewType">Title|Content</item>
|
||||
</style>
|
||||
|
||||
<style name="CustomImageCardTheme" parent="Theme.Leanback">
|
||||
<item name="imageCardViewStyle">@style/CustomImageCardViewStyle</item>
|
||||
<item name="imageCardViewImageStyle">@style/CustomImageCardViewImageStyle</item>
|
||||
</style>
|
||||
</resources>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 2.4 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 2.0 MiB |
Binary file not shown.
|
Before Width: | Height: | Size: 0 B After Width: | Height: | Size: 1.8 MiB |
Reference in New Issue
Block a user