Skip to content

Commit d62a1cf

Browse files
committed
add epg cache
1 parent 7738b88 commit d62a1cf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+771
-405
lines changed

HISTORY.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
## 更新日誌
22

3+
### v1.3.8.15-kitkat
4+
5+
* 修復頻道記憶失敗的問題
6+
* 打開頻道列表同時顯示組
7+
* 增加EPG緩存
8+
9+
### v1.3.8.15
10+
11+
* 修復頻道記憶失敗的問題
12+
* 打開頻道列表同時顯示組
13+
* 增加EPG緩存
14+
15+
### v1.3.8.14
16+
17+
* 優化重試
18+
19+
### v1.3.8.13
20+
21+
* 支持切換軟解/硬解
22+
23+
### v1.3.8.12
24+
25+
* 在觸屏設備上可以調節聲音和亮度
26+
327
### v1.3.8.14-kitkat
428

529
* 優化樣式

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ adb install my-tv-0.apk
8080

8181
## TODO
8282

83-
* 軟解
8483
* 支持回看
8584
* 詳細EPG
8685
* 淺色菜單
@@ -92,7 +91,7 @@ adb install my-tv-0.apk
9291

9392
## 讚賞
9493

95-
![image](./screenshots/appreciate.jpeg)
94+
![image](./screenshots/appreciate.png)
9695

9796
## 感謝
9897

app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
android:networkSecurityConfig="@xml/network"
1313
android:supportsRtl="true"
1414
android:theme="@style/Theme.MyTV0"
15-
android:usesCleartextTraffic="true">
15+
android:usesCleartextTraffic="true"
16+
android:enableOnBackInvokedCallback="false">
1617
<activity
1718
android:name=".MainActivity"
1819
android:exported="true"

app/src/main/java/com/lizongying/mytv0/ErrorFragment.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class ErrorFragment : Fragment() {
3535

3636
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
3737
super.onViewCreated(view, savedInstanceState)
38-
(activity as MainActivity).ready(TAG)
3938
}
4039

4140
fun setMsg(msg: String) {

app/src/main/java/com/lizongying/mytv0/GroupAdapter.kt

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GroupAdapter(
2828
private var defaultFocused = false
2929
private var defaultFocus: Int = -1
3030

31-
var visiable = false
31+
var visible = false
3232

3333
private var first = true
3434

@@ -80,16 +80,24 @@ class GroupAdapter(
8080
if (hasFocus) {
8181
viewHolder.focus(true)
8282
focused = view
83-
if (visiable) {
8483

85-
// "position" should not be used here, as the "list" may have been filtered out.
86-
val p = listTVModel.getGroupIndex()
87-
if (p != tvGroupModel.positionValue) {
88-
tvGroupModel.setPosition(p)
89-
}
90-
} else {
91-
visiable = true
84+
val p = listTVModel.getGroupIndex()
85+
if (p != tvGroupModel.positionValue) {
86+
tvGroupModel.setPosition(p)
9287
}
88+
89+
// if (visible) {
90+
//
91+
// // "position" should not be used here, as the "list" may have been filtered out.
92+
// val p = listTVModel.getGroupIndex()
93+
// Log.e(TAG, "group getGroupIndex $p")
94+
// Log.e(TAG, "group positionValue ${tvGroupModel.positionValue}")
95+
// if (p != tvGroupModel.positionValue) {
96+
// tvGroupModel.setPosition(p)
97+
// }
98+
// } else {
99+
// visible = true
100+
// }
93101
} else {
94102
viewHolder.focus(false)
95103
}

app/src/main/java/com/lizongying/mytv0/ListAdapter.kt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import android.os.Looper
99
import android.util.Log
1010
import android.view.KeyEvent
1111
import android.view.LayoutInflater
12+
import android.view.MotionEvent
1213
import android.view.View
1314
import android.view.ViewGroup
1415
import android.view.ViewGroup.FOCUS_BEFORE_DESCENDANTS
@@ -34,7 +35,7 @@ class ListAdapter(
3435
private var defaultFocused = false
3536
private var defaultFocus: Int = -1
3637

37-
var visiable = false
38+
var visible = false
3839

3940
val application = context.applicationContext as MyTVApplication
4041

@@ -105,12 +106,12 @@ class ListAdapter(
105106
if (hasFocus) {
106107
viewHolder.focus(true)
107108
focused = view
108-
if (visiable) {
109+
if (visible) {
109110
if (position != it.positionValue) {
110111
it.setPosition(position)
111112
}
112113
} else {
113-
visiable = true
114+
visible = true
114115
}
115116
} else {
116117
viewHolder.focus(false)
@@ -123,6 +124,25 @@ class ListAdapter(
123124
listener?.onItemClicked(position)
124125
}
125126

127+
view.setOnTouchListener(object : View.OnTouchListener {
128+
override fun onTouch(
129+
v: View?,
130+
event: MotionEvent?
131+
): Boolean {
132+
v ?: return false
133+
event ?: return false
134+
135+
when (event.action) {
136+
MotionEvent.ACTION_UP -> {
137+
v.performClick()
138+
return true
139+
}
140+
}
141+
142+
return false
143+
}
144+
})
145+
126146
view.setOnKeyListener { _, keyCode, event: KeyEvent? ->
127147
if (event?.action == KeyEvent.ACTION_DOWN) {
128148
if (keyCode == KeyEvent.KEYCODE_DPAD_UP && position == 0) {
@@ -235,7 +255,7 @@ class ListAdapter(
235255
R.drawable.baseline_favorite_24
236256
)
237257
)
238-
binding.heart.setColorFilter(ContextCompat.getColor(context, R.color.heart))
258+
binding.heart.setColorFilter(ContextCompat.getColor(context, R.color.red))
239259
} else {
240260
binding.heart.setImageDrawable(
241261
ContextCompat.getDrawable(

app/src/main/java/com/lizongying/mytv0/LoadingFragment.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ class LoadingFragment : Fragment() {
2727

2828
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
2929
super.onViewCreated(view, savedInstanceState)
30-
(activity as MainActivity).ready(TAG)
3130
}
3231

3332
override fun onDestroyView() {

0 commit comments

Comments
 (0)