From ae37a1e406fb704c339aadaea7056ccb27e374fe Mon Sep 17 00:00:00 2001 From: X1nto Date: Sun, 28 Feb 2021 14:17:46 +0400 Subject: [PATCH] updated old stuff --- app/src/main/java/com/vanced/manager/ui/MainActivity.kt | 7 ++++--- .../java/com/vanced/manager/ui/dialogs/DialogContainer.kt | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/vanced/manager/ui/MainActivity.kt b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt index 7565ccb1..edefa938 100644 --- a/app/src/main/java/com/vanced/manager/ui/MainActivity.kt +++ b/app/src/main/java/com/vanced/manager/ui/MainActivity.kt @@ -32,6 +32,7 @@ import com.vanced.manager.utils.AppUtils.currentLocale import com.vanced.manager.utils.AppUtils.faqpkg import com.vanced.manager.utils.AppUtils.log import com.vanced.manager.utils.AppUtils.playStorePkg +import com.vanced.manager.utils.AppUtils.vancedRootPkg import com.vanced.manager.utils.PackageHelper.isPackageInstalled class MainActivity : AppCompatActivity() { @@ -74,7 +75,7 @@ class MainActivity : AppCompatActivity() { initDialogs(intent.getBooleanExtra("firstLaunch", false)) manager.observe(this) { if (manager.value?.int("versionCode") ?: 0 > VERSION_CODE) { - ManagerUpdateDialog.newInstance(false).show(this) + ManagerUpdateDialog.newInstance(true).show(this) } } } @@ -208,7 +209,7 @@ class MainActivity : AppCompatActivity() { } } else { if (isMiuiOptimizationsEnabled) { - DialogContainer.applyAccentMiuiDialog(this) + DialogContainer.miuiDialog(this) } } @@ -217,7 +218,7 @@ class MainActivity : AppCompatActivity() { } if (variant == "root") { - if (PackageHelper.getPackageVersionName("com.google.android.youtube", packageManager) == "14.21.54") { + if (PackageHelper.getPackageVersionName(vancedRootPkg, packageManager) == "14.21.54") { DialogContainer.basicDialog( getString(R.string.hold_on), getString(R.string.magisk_vanced), diff --git a/app/src/main/java/com/vanced/manager/ui/dialogs/DialogContainer.kt b/app/src/main/java/com/vanced/manager/ui/dialogs/DialogContainer.kt index c1208ca0..048b5311 100644 --- a/app/src/main/java/com/vanced/manager/ui/dialogs/DialogContainer.kt +++ b/app/src/main/java/com/vanced/manager/ui/dialogs/DialogContainer.kt @@ -20,7 +20,7 @@ object DialogContainer { } setOnCancelListener { if (context.isMiuiOptimizationsEnabled) { - applyAccentMiuiDialog(context) + miuiDialog(context) } } create() @@ -30,7 +30,7 @@ object DialogContainer { prefs.edit { putBoolean("firstLaunch", false) } } - fun applyAccentMiuiDialog(context: Context) { + fun miuiDialog(context: Context) { MaterialAlertDialogBuilder(context).apply { setTitle(context.getString(R.string.miui_one_title)) setMessage(context.getString(R.string.miui_one))