Merge pull request #842 from Bnyro/master

new version = null when checking version
This commit is contained in:
Bnyro 2022-07-21 15:28:21 +02:00 committed by GitHub
commit 9193c86e54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View File

@ -16,8 +16,8 @@
} }
], ],
"attributes": [], "attributes": [],
"versionCode": 7, "versionCode": 14,
"versionName": "0.2.5", "versionName": "0.4.1",
"outputFile": "app-x86_64-release.apk" "outputFile": "app-x86_64-release.apk"
}, },
{ {
@ -29,8 +29,8 @@
} }
], ],
"attributes": [], "attributes": [],
"versionCode": 7, "versionCode": 14,
"versionName": "0.2.5", "versionName": "0.4.1",
"outputFile": "app-x86-release.apk" "outputFile": "app-x86-release.apk"
}, },
{ {
@ -42,8 +42,8 @@
} }
], ],
"attributes": [], "attributes": [],
"versionCode": 7, "versionCode": 14,
"versionName": "0.2.5", "versionName": "0.4.1",
"outputFile": "app-armeabi-v7a-release.apk" "outputFile": "app-armeabi-v7a-release.apk"
}, },
{ {
@ -55,8 +55,8 @@
} }
], ],
"attributes": [], "attributes": [],
"versionCode": 7, "versionCode": 14,
"versionName": "0.2.5", "versionName": "0.4.1",
"outputFile": "app-arm64-v8a-release.apk" "outputFile": "app-arm64-v8a-release.apk"
} }
], ],

View File

@ -1,6 +1,7 @@
package com.github.libretube.preferences package com.github.libretube.preferences
import android.os.Bundle import android.os.Bundle
import android.util.Log
import androidx.activity.result.ActivityResultLauncher import androidx.activity.result.ActivityResultLauncher
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.preference.Preference import androidx.preference.Preference
@ -86,9 +87,10 @@ class MainSettings : PreferenceFragmentCompat() {
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
// check for update // check for update
val updateInfo = UpdateChecker.getLatestReleaseInfo() val updateInfo = UpdateChecker.getLatestReleaseInfo()
if (updateInfo?.name != "" && BuildConfig.VERSION_NAME != updateInfo?.name) { Log.e(TAG, updateInfo?.name.toString())
if (updateInfo?.name != null && BuildConfig.VERSION_NAME != updateInfo?.name) {
// show the UpdateAvailableDialog if there's an update available // show the UpdateAvailableDialog if there's an update available
val updateAvailableDialog = UpdateDialog(updateInfo!!) val updateAvailableDialog = UpdateDialog(updateInfo)
updateAvailableDialog.show(childFragmentManager, "UpdateAvailableDialog") updateAvailableDialog.show(childFragmentManager, "UpdateAvailableDialog")
} else { } else {
// otherwise show the no update available snackBar // otherwise show the no update available snackBar