mirror of
https://github.com/lizongying/my-tv.git
synced 2026-11-20 18:36:29 +08:00
fix update
This commit is contained in:
@@ -7,14 +7,15 @@ import androidx.fragment.app.DialogFragment
|
||||
|
||||
class ConfirmationFragment(
|
||||
private val listener: ConfirmationListener,
|
||||
private val message: String
|
||||
private val message: String,
|
||||
private val update: Boolean
|
||||
) : DialogFragment() {
|
||||
|
||||
override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
|
||||
return activity?.let {
|
||||
val builder = AlertDialog.Builder(it)
|
||||
builder.setTitle(message)
|
||||
if (message != "版本获取失败") {
|
||||
if (update) {
|
||||
builder.setMessage("确定更新吗?")
|
||||
.setPositiveButton(
|
||||
"确定"
|
||||
@@ -27,10 +28,11 @@ class ConfirmationFragment(
|
||||
listener.onCancel()
|
||||
}
|
||||
} else {
|
||||
builder.setNegativeButton(
|
||||
"好的"
|
||||
) { _, _ ->
|
||||
}
|
||||
builder.setMessage("")
|
||||
.setNegativeButton(
|
||||
"好的"
|
||||
) { _, _ ->
|
||||
}
|
||||
}
|
||||
builder.create()
|
||||
} ?: throw IllegalStateException("Activity cannot be null")
|
||||
|
||||
Reference in New Issue
Block a user