0
0
Fork 0
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:
X1nto 2020-05-22 17:57:16 +04:00
parent 02712c3371
commit 8370a8b3aa

View file

@ -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
}
}