From 933fd09e7c152eed0e9ec5eeefeca510726a6571 Mon Sep 17 00:00:00 2001 From: X1nto Date: Wed, 27 May 2020 13:38:46 +0400 Subject: [PATCH] bug fixes --- app/build.gradle | 2 +- .../com/vanced/manager/core/fragments/Home.kt | 10 ++++- .../manager/ui/fragments/HomeFragment.kt | 45 +++++++++---------- settings.gradle | 2 +- 4 files changed, 32 insertions(+), 27 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 1ba29d80..2fcafb28 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,7 +11,7 @@ android { applicationId "com.vanced.manager" minSdkVersion 21 targetSdkVersion 29 - versionCode 4 + versionCode 5 versionName "1.1.0 beta" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" diff --git a/app/src/main/java/com/vanced/manager/core/fragments/Home.kt b/app/src/main/java/com/vanced/manager/core/fragments/Home.kt index 9ff408ce..1d155c96 100644 --- a/app/src/main/java/com/vanced/manager/core/fragments/Home.kt +++ b/app/src/main/java/com/vanced/manager/core/fragments/Home.kt @@ -59,7 +59,15 @@ open class Home : BaseFragment() { microginstallbtn.setOnClickListener { if (!isDownloading!!) { val dlText = view.findViewById(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 { Toast.makeText(activity, "Please wait until installation finishes", Toast.LENGTH_SHORT).show() } diff --git a/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt b/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt index e3d3b337..6309a2e7 100644 --- a/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt +++ b/app/src/main/java/com/vanced/manager/ui/fragments/HomeFragment.kt @@ -86,35 +86,32 @@ class HomeFragment : Home() { if (microgStatus!!) { val microgVer = pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName - when { - microgRemoteVer > microgVer -> { - microginstallbtn?.text = activity?.getString(R.string.update) - microginstallbtn?.icon = - activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp) - } - microgRemoteVer == microgVer -> { - microginstallbtn?.text = - activity?.getString(R.string.button_installed) - microginstallbtn?.icon = - activity?.getDrawable(R.drawable.outline_cloud_done_24) - } + if (microgRemoteVer > microgVer) { + microginstallbtn?.text = activity?.getString(R.string.update) + microginstallbtn?.icon = + activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp) + } + else if (microgRemoteVer == microgVer) { + microginstallbtn?.text = + activity?.getString(R.string.button_installed) + microginstallbtn?.icon = + activity?.getDrawable(R.drawable.outline_cloud_done_24) } } + if (vancedStatus!!) { val vancedVer = pm.getPackageInfo("com.vanced.android.youtube", 0).versionName - when { - vancedRemoteVer > vancedVer -> { - vancedinstallbtn?.text = activity?.getString(R.string.update) - vancedinstallbtn?.icon = - activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp) - } - vancedRemoteVer == vancedVer -> { - vancedinstallbtn?.text = - activity?.getString(R.string.button_installed) - vancedinstallbtn?.icon = - activity?.getDrawable(R.drawable.outline_cloud_done_24) - } + if (vancedRemoteVer > vancedVer) { + vancedinstallbtn?.text = activity?.getString(R.string.update) + vancedinstallbtn?.icon = + activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp) + } + else if (vancedRemoteVer == vancedVer) { + vancedinstallbtn?.text = + activity?.getString(R.string.button_installed) + vancedinstallbtn?.icon = + activity?.getDrawable(R.drawable.outline_cloud_done_24) } } diff --git a/settings.gradle b/settings.gradle index b098ff85..0828cd2b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,2 +1,2 @@ rootProject.name='Vanced Manager' -include ':app', ':api', ':api' +include ':app'