Skip to content

Commit

Permalink
add epg
Browse files Browse the repository at this point in the history
  • Loading branch information
lizongying committed Apr 2, 2024
1 parent bb88e75 commit 3936629
Show file tree
Hide file tree
Showing 47 changed files with 4,135 additions and 1,242 deletions.
5 changes: 5 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## 更新日志

### v1.7.6(通用)

* 临时去掉部分频道,提高频道的可用性
* 部分频道增加节目单

### v1.7.2(通用)

* 支持节目列表网格样式和行样式切换,软件重启后生效
Expand Down
2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,6 @@ 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'
}
Binary file modified app/src/main/cpp/arm64-v8a/libnative.so
Binary file not shown.
Binary file modified app/src/main/cpp/armeabi-v7a/libnative.so
Binary file not shown.
3 changes: 1 addition & 2 deletions app/src/main/java/com/lizongying/mytv/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class MainActivity : FragmentActivity(), Request.RequestListener {

setContentView(R.layout.activity_main)

Request.onCreate()
Request.setRequestListener(this)

window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
Expand Down Expand Up @@ -191,7 +190,7 @@ class MainActivity : FragmentActivity(), Request.RequestListener {
fun fragmentReady() {
ready++
Log.i(TAG, "ready $ready")
if (ready == 6) {
if (ready == 5) {
mainFragment.fragmentReady()
}
}
Expand Down
23 changes: 17 additions & 6 deletions app/src/main/java/com/lizongying/mytv/MainFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import com.lizongying.mytv.Utils.dpToPx
import com.lizongying.mytv.api.YSP
import com.lizongying.mytv.databinding.RowBinding
import com.lizongying.mytv.databinding.ShowBinding
import com.lizongying.mytv.models.ProgramType
import com.lizongying.mytv.models.TVListViewModel
import com.lizongying.mytv.models.TVViewModel
import kotlinx.coroutines.Dispatchers
Expand Down Expand Up @@ -65,8 +66,6 @@ class MainFragment : Fragment(), CardAdapter.ItemListener {
tvViewModel.setItemPosition(idx2)
tvListViewModelCurrent.addTVViewModel(tvViewModel)
tvListViewModel.addTVViewModel(tvViewModel)

updateEPG(tvViewModel)
}
tvListViewModel.maxNum.add(v.size)

Expand Down Expand Up @@ -263,6 +262,10 @@ class MainFragment : Fragment(), CardAdapter.ItemListener {
fun fragmentReady() {
// request.fetchPage()
tvListViewModel.getTVViewModel(itemPosition)?.changed()

tvListViewModel.tvListViewModel.value?.forEach { tvViewModel ->
updateEPG(tvViewModel)
}
}

fun play(itemPosition: Int) {
Expand Down Expand Up @@ -300,10 +303,18 @@ class MainFragment : Fragment(), CardAdapter.ItemListener {
}

private fun updateEPG(tvViewModel: TVViewModel) {
if (tvViewModel.getTV().channel == "港澳台") {
Request.fetchFEPG(tvViewModel)
} else {
Request.fetchYEPG(tvViewModel)
when (tvViewModel.getTV().programType) {
ProgramType.Y_PROTO -> {
Request.fetchYProtoEPG(tvViewModel)
}

ProgramType.Y_JCE -> {
Request.fetchYJceEPG(tvViewModel)
}

ProgramType.F -> {
Request.fetchFEPG(tvViewModel)
}
}
}

Expand Down
Loading

0 comments on commit 3936629

Please sign in to comment.