Skip to content

Commit

Permalink
support kitkat
Browse files Browse the repository at this point in the history
  • Loading branch information
vrichv committed Jul 12, 2024
1 parent 25d4e88 commit b28ad4f
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 38 deletions.
3 changes: 2 additions & 1 deletion app/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/build
/build
/release
4 changes: 2 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {

defaultConfig {
applicationId = "com.lizongying.mytv0"
minSdk = 21
minSdk = 19
targetSdk = 34
versionCode = getVersionCode()
versionName = getVersionName()
Expand Down Expand Up @@ -82,7 +82,7 @@ dependencies {
implementation(libs.media3.exoplayer.hls)
implementation(libs.media3.exoplayer.dash)
implementation(libs.media3.exoplayer.rtsp)
implementation(libs.media3.datasource.okhttp)
//implementation(libs.media3.datasource.okhttp)

implementation(libs.nanohttpd)
implementation(libs.gua64)
Expand Down
Binary file removed app/release/app-release.apk
Binary file not shown.
20 changes: 0 additions & 20 deletions app/release/output-metadata.json

This file was deleted.

12 changes: 10 additions & 2 deletions app/src/main/java/com/lizongying/mytv0/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,16 @@ class MainActivity : FragmentActivity() {
}
}

window.statusBarColor = Color.TRANSPARENT
window.navigationBarColor = Color.TRANSPARENT
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS)
window.addFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_NAVIGATION)

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.statusBarColor = Color.TRANSPARENT
window.navigationBarColor = Color.TRANSPARENT
}
}

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
window.navigationBarDividerColor = Color.TRANSPARENT
}
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/lizongying/mytv0/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ object Utils {
try {
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) throw IOException("Unexpected code $response")
val string = response.body?.string()
val string = response.body()?.string()
Gson().fromJson(string, TimeResponse::class.java).data.t.toLong()
}
} catch (e: IOException) {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/lizongying/mytv0/models/TVGroupModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ class TVGroupModel : ViewModel() {
_tvGroupModel.value = newList
}

fun clear() {
fun clear2() {
_tvGroupModel.value = mutableListOf(getTVListModel(0)!!, getTVListModel(1)!!)
setPosition(0)
getTVListModel(1)?.clear()
getTVListModel(1)?.clear2()
}

fun getTVListModel(): TVListModel? {
Expand Down
10 changes: 5 additions & 5 deletions app/src/main/java/com/lizongying/mytv0/models/TVList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ object TVList {
val response = HttpClient.okHttpClient.newCall(request).execute()

if (response.isSuccessful) {
val epg = EPGXmlParser().parse(response.body!!.byteStream())
val epg = EPGXmlParser().parse(response.body()!!.byteStream())

withContext(Dispatchers.Main) {
for (m in listModel) {
Expand All @@ -90,7 +90,7 @@ object TVList {
}
"EPG获取成功".showToast()
} else {
Log.e("", "request status ${response.code}")
Log.e("", "request status ${response.code()}")
"EPG状态错误".showToast()
}
} catch (e: Exception) {
Expand All @@ -111,7 +111,7 @@ object TVList {
if (!file.exists()) {
file.createNewFile()
}
val str = response.body!!.string()
val str = response.body()!!.string()
withContext(Dispatchers.Main) {
if (str2List(str)) {
file.writeText(str)
Expand All @@ -128,7 +128,7 @@ object TVList {
}
}
} else {
Log.e("", "request status ${response.code}")
Log.e("", "request status ${response.code()}")
"频道状态错误".showToast()
}
} catch (e: JsonSyntaxException) {
Expand Down Expand Up @@ -279,7 +279,7 @@ object TVList {
}
}

groupModel.clear()
groupModel.clear2()

val map: MutableMap<String, MutableList<TVModel>> = mutableMapOf()
for (v in list) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class TVListModel(private val name: String, private val index: Int) : ViewModel(
}
}

fun clear() {
fun clear2() {
_tvListModel.value = mutableListOf()
setPosition(0)
}
Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[versions]
desugar_jdk_libs = "2.0.4"
media3 = "1.3.1" # 1.3.0: 19 java8 1.2.1: 17 media3-datasource-okhttp:1.2.1:21
media3 = "1.3.0" # 1.3.0: 19 java8 1.2.1: 17 media3-datasource-okhttp:1.2.1:21
nanohttpd = "2.3.1"
gua64 = "1.4.5"
recyclerview = "1.3.2"
zxing = "3.5.3"
glide = "4.16.0" # java7

gson = "2.11.0" # 19:2.10.1
okhttp = "3.14.9"
retrofit = "2.11.0" # 21:2.9.0 17:2.6.4
gson = "2.10.1" # 19:2.10.1
okhttp = "3.12.13"
retrofit = "2.6.4" # 21:2.9.0 17:2.6.4

work = "2.9.0"
core_ktx = "1.13.1"
Expand Down

0 comments on commit b28ad4f

Please sign in to comment.