0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-22 03:05:11 +00:00

bug fixes

This commit is contained in:
X1nto 2020-05-27 13:38:46 +04:00
parent 6f11a9c92b
commit 933fd09e7c
4 changed files with 32 additions and 27 deletions

View file

@ -11,7 +11,7 @@ android {
applicationId "com.vanced.manager" applicationId "com.vanced.manager"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 29 targetSdkVersion 29
versionCode 4 versionCode 5
versionName "1.1.0 beta" versionName "1.1.0 beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View file

@ -59,7 +59,15 @@ open class Home : BaseFragment() {
microginstallbtn.setOnClickListener { microginstallbtn.setOnClickListener {
if (!isDownloading!!) { if (!isDownloading!!) {
val dlText = view.findViewById<TextView>(R.id.microg_downloading) val dlText = view.findViewById<TextView>(R.id.microg_downloading)
installApk("https://x1nto.github.io/VancedFiles/microg.json", microgProgress, dlText) try {
installApk(
"https://x1nto.github.io/VancedFiles/microg.json",
microgProgress,
dlText
)
} catch (e: Exception) {
Toast.makeText(activity, "Unable to start installation", Toast.LENGTH_SHORT).show()
}
} else { } else {
Toast.makeText(activity, "Please wait until installation finishes", Toast.LENGTH_SHORT).show() Toast.makeText(activity, "Please wait until installation finishes", Toast.LENGTH_SHORT).show()
} }

View file

@ -86,35 +86,32 @@ class HomeFragment : Home() {
if (microgStatus!!) { if (microgStatus!!) {
val microgVer = val microgVer =
pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName
when { if (microgRemoteVer > microgVer) {
microgRemoteVer > microgVer -> { microginstallbtn?.text = activity?.getString(R.string.update)
microginstallbtn?.text = activity?.getString(R.string.update) microginstallbtn?.icon =
microginstallbtn?.icon = activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp)
activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp) }
} else if (microgRemoteVer == microgVer) {
microgRemoteVer == microgVer -> { microginstallbtn?.text =
microginstallbtn?.text = activity?.getString(R.string.button_installed)
activity?.getString(R.string.button_installed) microginstallbtn?.icon =
microginstallbtn?.icon = activity?.getDrawable(R.drawable.outline_cloud_done_24)
activity?.getDrawable(R.drawable.outline_cloud_done_24)
}
} }
} }
if (vancedStatus!!) { if (vancedStatus!!) {
val vancedVer = val vancedVer =
pm.getPackageInfo("com.vanced.android.youtube", 0).versionName pm.getPackageInfo("com.vanced.android.youtube", 0).versionName
when { if (vancedRemoteVer > vancedVer) {
vancedRemoteVer > vancedVer -> { vancedinstallbtn?.text = activity?.getString(R.string.update)
vancedinstallbtn?.text = activity?.getString(R.string.update) vancedinstallbtn?.icon =
vancedinstallbtn?.icon = activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp)
activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp) }
} else if (vancedRemoteVer == vancedVer) {
vancedRemoteVer == vancedVer -> { vancedinstallbtn?.text =
vancedinstallbtn?.text = activity?.getString(R.string.button_installed)
activity?.getString(R.string.button_installed) vancedinstallbtn?.icon =
vancedinstallbtn?.icon = activity?.getDrawable(R.drawable.outline_cloud_done_24)
activity?.getDrawable(R.drawable.outline_cloud_done_24)
}
} }
} }

View file

@ -1,2 +1,2 @@
rootProject.name='Vanced Manager' rootProject.name='Vanced Manager'
include ':app', ':api', ':api' include ':app'