Skip to content

Commit b28ad4f

Browse files
committed
support kitkat
1 parent 25d4e88 commit b28ad4f

File tree

10 files changed

+27
-38
lines changed

10 files changed

+27
-38
lines changed

app/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
/build
1+
/build
2+
/release

app/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ android {
1111

1212
defaultConfig {
1313
applicationId = "com.lizongying.mytv0"
14-
minSdk = 21
14+
minSdk = 19
1515
targetSdk = 34
1616
versionCode = getVersionCode()
1717
versionName = getVersionName()
@@ -82,7 +82,7 @@ dependencies {
8282
implementation(libs.media3.exoplayer.hls)
8383
implementation(libs.media3.exoplayer.dash)
8484
implementation(libs.media3.exoplayer.rtsp)
85-
implementation(libs.media3.datasource.okhttp)
85+
//implementation(libs.media3.datasource.okhttp)
8686

8787
implementation(libs.nanohttpd)
8888
implementation(libs.gua64)

app/release/app-release.apk

-4.72 MB
Binary file not shown.

app/release/output-metadata.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,16 @@ class MainActivity : FragmentActivity() {
6565
}
6666
}
6767

68-
window.statusBarColor = Color.TRANSPARENT
69-
window.navigationBarColor = Color.TRANSPARENT
68+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
69+
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
70+
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)
71+
72+
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
73+
window.statusBarColor = Color.TRANSPARENT
74+
window.navigationBarColor = Color.TRANSPARENT
75+
}
76+
}
77+
7078
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
7179
window.navigationBarDividerColor = Color.TRANSPARENT
7280
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ object Utils {
5858
try {
5959
client.newCall(request).execute().use { response ->
6060
if (!response.isSuccessful) throw IOException("Unexpected code $response")
61-
val string = response.body?.string()
61+
val string = response.body()?.string()
6262
Gson().fromJson(string, TimeResponse::class.java).data.t.toLong()
6363
}
6464
} catch (e: IOException) {

app/src/main/java/com/lizongying/mytv0/models/TVGroupModel.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ class TVGroupModel : ViewModel() {
4141
_tvGroupModel.value = newList
4242
}
4343

44-
fun clear() {
44+
fun clear2() {
4545
_tvGroupModel.value = mutableListOf(getTVListModel(0)!!, getTVListModel(1)!!)
4646
setPosition(0)
47-
getTVListModel(1)?.clear()
47+
getTVListModel(1)?.clear2()
4848
}
4949

5050
fun getTVListModel(): TVListModel? {

app/src/main/java/com/lizongying/mytv0/models/TVList.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ object TVList {
8080
val response = HttpClient.okHttpClient.newCall(request).execute()
8181

8282
if (response.isSuccessful) {
83-
val epg = EPGXmlParser().parse(response.body!!.byteStream())
83+
val epg = EPGXmlParser().parse(response.body()!!.byteStream())
8484

8585
withContext(Dispatchers.Main) {
8686
for (m in listModel) {
@@ -90,7 +90,7 @@ object TVList {
9090
}
9191
"EPG获取成功".showToast()
9292
} else {
93-
Log.e("", "request status ${response.code}")
93+
Log.e("", "request status ${response.code()}")
9494
"EPG状态错误".showToast()
9595
}
9696
} catch (e: Exception) {
@@ -111,7 +111,7 @@ object TVList {
111111
if (!file.exists()) {
112112
file.createNewFile()
113113
}
114-
val str = response.body!!.string()
114+
val str = response.body()!!.string()
115115
withContext(Dispatchers.Main) {
116116
if (str2List(str)) {
117117
file.writeText(str)
@@ -128,7 +128,7 @@ object TVList {
128128
}
129129
}
130130
} else {
131-
Log.e("", "request status ${response.code}")
131+
Log.e("", "request status ${response.code()}")
132132
"频道状态错误".showToast()
133133
}
134134
} catch (e: JsonSyntaxException) {
@@ -279,7 +279,7 @@ object TVList {
279279
}
280280
}
281281

282-
groupModel.clear()
282+
groupModel.clear2()
283283

284284
val map: MutableMap<String, MutableList<TVModel>> = mutableMapOf()
285285
for (v in list) {

app/src/main/java/com/lizongying/mytv0/models/TVListModel.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class TVListModel(private val name: String, private val index: Int) : ViewModel(
8282
}
8383
}
8484

85-
fun clear() {
85+
fun clear2() {
8686
_tvListModel.value = mutableListOf()
8787
setPosition(0)
8888
}

gradle/libs.versions.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[versions]
22
desugar_jdk_libs = "2.0.4"
3-
media3 = "1.3.1" # 1.3.0: 19 java8 1.2.1: 17 media3-datasource-okhttp:1.2.1:21
3+
media3 = "1.3.0" # 1.3.0: 19 java8 1.2.1: 17 media3-datasource-okhttp:1.2.1:21
44
nanohttpd = "2.3.1"
55
gua64 = "1.4.5"
66
recyclerview = "1.3.2"
77
zxing = "3.5.3"
88
glide = "4.16.0" # java7
99

10-
gson = "2.11.0" # 19:2.10.1
11-
okhttp = "3.14.9"
12-
retrofit = "2.11.0" # 21:2.9.0 17:2.6.4
10+
gson = "2.10.1" # 19:2.10.1
11+
okhttp = "3.12.13"
12+
retrofit = "2.6.4" # 21:2.9.0 17:2.6.4
1313

1414
work = "2.9.0"
1515
core_ktx = "1.13.1"

0 commit comments

Comments
 (0)