mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-17 16:55:10 +00:00
added update center changelog
This commit is contained in:
parent
02712c3371
commit
8370a8b3aa
1 changed files with 10 additions and 1 deletions
|
@ -54,12 +54,17 @@ class UpdateCheckFragment : DialogFragment() {
|
|||
val recheckbtn = view.findViewById<Button>(R.id.update_center_recheck)
|
||||
val checkingTxt = view.findViewById<TextView>(R.id.update_center_checking)
|
||||
val loadBar = view.findViewById<ProgressBar>(R.id.update_center_progressbar)
|
||||
val changelogTitle = view.findViewById<TextView>(R.id.update_center_changelog_title)
|
||||
val changelogTxt = view.findViewById<TextView>(R.id.update_center_changelog)
|
||||
|
||||
closebtn.setOnClickListener { dismiss() }
|
||||
|
||||
if (GetJson().isConnected(requireContext())) {
|
||||
val checkUrl = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/manager.json")
|
||||
val remoteVersion = checkUrl.get("versionCode").asInt
|
||||
val changelog = checkUrl.get("changelog").asString
|
||||
|
||||
changelogTxt.text = changelog
|
||||
|
||||
if (remoteVersion > BuildConfig.VERSION_CODE) {
|
||||
|
||||
|
@ -89,7 +94,11 @@ class UpdateCheckFragment : DialogFragment() {
|
|||
checkingTxt.text = "No updates found"
|
||||
}
|
||||
|
||||
} else checkingTxt.text = "No connection"
|
||||
} else {
|
||||
checkingTxt.text = "No connection"
|
||||
changelogTxt.visibility = View.GONE
|
||||
changelogTitle.visibility = View.GONE
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue