mirror of
https://github.com/lizongying/my-tv.git
synced 2026-10-26 22:26:29 +08:00
fix cctv6
This commit is contained in:
@@ -1,22 +1,28 @@
|
||||
package com.lizongying.mytv
|
||||
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.annotation.RequiresApi
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import com.lizongying.mytv.databinding.DialogBinding
|
||||
|
||||
|
||||
class SettingFragment(private val versionName: String,
|
||||
private val channelReversal: Boolean,
|
||||
private val channelNum: Boolean,
|
||||
) :
|
||||
class SettingFragment(
|
||||
private val versionName: String,
|
||||
private val versionCode: Long,
|
||||
private val channelReversal: Boolean,
|
||||
private val channelNum: Boolean,
|
||||
) :
|
||||
DialogFragment() {
|
||||
|
||||
private var _binding: DialogBinding? = null
|
||||
private val binding get() = _binding!!
|
||||
|
||||
private lateinit var updateManager: UpdateManager
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
setStyle(STYLE_NO_TITLE, 0)
|
||||
@@ -43,14 +49,33 @@ class SettingFragment(private val versionName: String,
|
||||
(activity as MainActivity).saveChannelNum(isChecked)
|
||||
}
|
||||
|
||||
updateManager = UpdateManager(context, this, versionCode)
|
||||
_binding?.checkVersion?.setOnClickListener(OnClickListenerCheckVersion(updateManager))
|
||||
|
||||
return binding.root
|
||||
}
|
||||
|
||||
fun setVersionName(versionName: String) {
|
||||
binding.versionName.text = versionName
|
||||
}
|
||||
|
||||
internal class OnClickListenerCheckVersion(private val updateManager: UpdateManager) :
|
||||
View.OnClickListener {
|
||||
override fun onClick(view: View?) {
|
||||
updateManager.checkAndUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onDestroyView() {
|
||||
super.onDestroyView()
|
||||
_binding = null
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
super.onDestroy()
|
||||
// updateManager.destroy()
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val TAG = "SettingFragment"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user