0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2025-01-05 15:01:01 +00:00

updated old stuff

This commit is contained in:
X1nto 2021-02-28 14:17:46 +04:00
parent 2e3416ef43
commit ae37a1e406
2 changed files with 6 additions and 5 deletions

View file

@ -32,6 +32,7 @@ import com.vanced.manager.utils.AppUtils.currentLocale
import com.vanced.manager.utils.AppUtils.faqpkg import com.vanced.manager.utils.AppUtils.faqpkg
import com.vanced.manager.utils.AppUtils.log import com.vanced.manager.utils.AppUtils.log
import com.vanced.manager.utils.AppUtils.playStorePkg import com.vanced.manager.utils.AppUtils.playStorePkg
import com.vanced.manager.utils.AppUtils.vancedRootPkg
import com.vanced.manager.utils.PackageHelper.isPackageInstalled import com.vanced.manager.utils.PackageHelper.isPackageInstalled
class MainActivity : AppCompatActivity() { class MainActivity : AppCompatActivity() {
@ -74,7 +75,7 @@ class MainActivity : AppCompatActivity() {
initDialogs(intent.getBooleanExtra("firstLaunch", false)) initDialogs(intent.getBooleanExtra("firstLaunch", false))
manager.observe(this) { manager.observe(this) {
if (manager.value?.int("versionCode") ?: 0 > VERSION_CODE) { 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 { } else {
if (isMiuiOptimizationsEnabled) { if (isMiuiOptimizationsEnabled) {
DialogContainer.applyAccentMiuiDialog(this) DialogContainer.miuiDialog(this)
} }
} }
@ -217,7 +218,7 @@ class MainActivity : AppCompatActivity() {
} }
if (variant == "root") { if (variant == "root") {
if (PackageHelper.getPackageVersionName("com.google.android.youtube", packageManager) == "14.21.54") { if (PackageHelper.getPackageVersionName(vancedRootPkg, packageManager) == "14.21.54") {
DialogContainer.basicDialog( DialogContainer.basicDialog(
getString(R.string.hold_on), getString(R.string.hold_on),
getString(R.string.magisk_vanced), getString(R.string.magisk_vanced),

View file

@ -20,7 +20,7 @@ object DialogContainer {
} }
setOnCancelListener { setOnCancelListener {
if (context.isMiuiOptimizationsEnabled) { if (context.isMiuiOptimizationsEnabled) {
applyAccentMiuiDialog(context) miuiDialog(context)
} }
} }
create() create()
@ -30,7 +30,7 @@ object DialogContainer {
prefs.edit { putBoolean("firstLaunch", false) } prefs.edit { putBoolean("firstLaunch", false) }
} }
fun applyAccentMiuiDialog(context: Context) { fun miuiDialog(context: Context) {
MaterialAlertDialogBuilder(context).apply { MaterialAlertDialogBuilder(context).apply {
setTitle(context.getString(R.string.miui_one_title)) setTitle(context.getString(R.string.miui_one_title))
setMessage(context.getString(R.string.miui_one)) setMessage(context.getString(R.string.miui_one))