-
Notifications
You must be signed in to change notification settings - Fork 227
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b6db917
commit 006f2aa
Showing
39 changed files
with
941 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,12 @@ | |
|
||
## 更新日志 | ||
|
||
### v1.1.2 | ||
|
||
* 保存配置地址 | ||
* 启动后自动更新配置 | ||
* 样式优化 | ||
|
||
### v1.1.1 | ||
|
||
* 优化频道号选台 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package com.lizongying.mytv0 | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.core.view.marginTop | ||
import androidx.fragment.app.Fragment | ||
import com.lizongying.mytv0.databinding.ErrorBinding | ||
|
||
class ErrorFragment : Fragment() { | ||
private var _binding: ErrorBinding? = null | ||
private val binding get() = _binding!! | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
_binding = ErrorBinding.inflate(inflater, container, false) | ||
|
||
val application = requireActivity().applicationContext as MyTvApplication | ||
|
||
binding.logo.layoutParams.width = application.px2Px(binding.logo.layoutParams.width) | ||
binding.logo.layoutParams.height = application.px2Px(binding.logo.layoutParams.height) | ||
|
||
val layoutParams = binding.msg.layoutParams as ViewGroup.MarginLayoutParams | ||
layoutParams.topMargin = application.px2Px(binding.msg.marginTop) | ||
binding.msg.layoutParams = layoutParams | ||
|
||
binding.msg.textSize = application.px2PxFont(binding.msg.textSize) | ||
|
||
(activity as MainActivity).ready(TAG) | ||
return binding.root | ||
} | ||
|
||
fun show(msg: String) { | ||
binding.msg.text = msg | ||
} | ||
|
||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
|
||
companion object { | ||
private const val TAG = "ErrorFragment" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
app/src/main/java/com/lizongying/mytv0/LiveDataExtensions.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package com.lizongying.mytv0 | ||
|
||
import androidx.lifecycle.LifecycleOwner | ||
import androidx.lifecycle.LiveData | ||
import androidx.lifecycle.Observer | ||
|
||
fun <T> LiveData<T>.observeOnce(owner: LifecycleOwner, observer: (T) -> Unit) { | ||
observe(owner, object : Observer<T> { | ||
override fun onChanged(value: T) { | ||
removeObserver(this) | ||
observer(value) | ||
} | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.lizongying.mytv0 | ||
|
||
import android.os.Bundle | ||
import android.view.LayoutInflater | ||
import android.view.View | ||
import android.view.ViewGroup | ||
import androidx.fragment.app.Fragment | ||
import com.lizongying.mytv0.databinding.LoadingBinding | ||
|
||
class LoadingFragment : Fragment() { | ||
private var _binding: LoadingBinding? = null | ||
private val binding get() = _binding!! | ||
|
||
override fun onCreateView( | ||
inflater: LayoutInflater, container: ViewGroup?, | ||
savedInstanceState: Bundle? | ||
): View { | ||
_binding = LoadingBinding.inflate(inflater, container, false) | ||
|
||
val application = requireActivity().applicationContext as MyTvApplication | ||
|
||
binding.bar.layoutParams.width = application.px2Px(binding.bar.layoutParams.width) | ||
binding.bar.layoutParams.height = application.px2Px(binding.bar.layoutParams.height) | ||
|
||
(activity as MainActivity).ready(TAG) | ||
return binding.root | ||
} | ||
|
||
override fun onDestroyView() { | ||
super.onDestroyView() | ||
_binding = null | ||
} | ||
|
||
companion object { | ||
private const val TAG = "LoadingFragment" | ||
} | ||
} |
Oops, something went wrong.