finalisations
This commit is contained in:
parent
499517dcec
commit
64c5faf6ac
|
@ -12,7 +12,10 @@ import com.vanced.manager.ui.dialogs.DialogContainer.statementFalse
|
|||
import com.vanced.manager.ui.fragments.UpdateCheckFragment
|
||||
import com.vanced.manager.utils.InternetTools
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.ui.dialogs.DialogContainer.secondMiuiDialog
|
||||
import com.vanced.manager.ui.dialogs.DialogContainer.showRootDialog
|
||||
import com.vanced.manager.utils.MiuiHelper.isMiui
|
||||
import com.vanced.manager.utils.MiuiHelper.isMiuiOptimisationsDisabled
|
||||
|
||||
// This activity will NOT be used in manifest
|
||||
// since MainActivity will extend it
|
||||
|
@ -37,6 +40,7 @@ open class Main: AppCompatActivity() {
|
|||
!falseStatement -> statementFalse(this)
|
||||
isUpgrading -> prefs.edit().putBoolean("isUpgrading", false).apply()
|
||||
variant == "root" && shouldShowRootDialog -> showRootDialog(this)
|
||||
!firstStart && !isMiuiOptimisationsDisabled() -> secondMiuiDialog(this)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -72,9 +72,6 @@ open class Home : BaseFragment(), View.OnClickListener {
|
|||
} catch (e: Exception) {
|
||||
Log.d("VMCache", "Unable to delete cacheDir")
|
||||
}
|
||||
if (!MiuiHelper.isMiuiOptimisationsDisabled() && !defPrefs.getBoolean("suppress_miui", false)) {
|
||||
activity?.let { view?.let { it1 -> secondMiuiDialog(it, it1) } }
|
||||
} else {
|
||||
if (prefs.getBoolean("valuesModified", false)) {
|
||||
activity?.startService(
|
||||
Intent(
|
||||
|
@ -85,7 +82,6 @@ open class Home : BaseFragment(), View.OnClickListener {
|
|||
} else {
|
||||
view?.findNavController()?.navigate(R.id.toInstallThemeFragment)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Toast.makeText(
|
||||
activity,
|
||||
|
|
|
@ -64,7 +64,7 @@ object DialogContainer {
|
|||
.show()
|
||||
}
|
||||
|
||||
fun secondMiuiDialog(context: Context, view: View) {
|
||||
fun secondMiuiDialog(context: Context) {
|
||||
AlertDialog.Builder(context)
|
||||
.setTitle(context.getString(R.string.miui_two_title))
|
||||
.setMessage(context.getString(R.string.miui_two))
|
||||
|
|
|
@ -15,8 +15,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
activity?.title = getString(R.string.title_settings)
|
||||
setHasOptionsMenu(true)
|
||||
|
||||
if (!isMiui()) preferenceScreen.removePreference(findPreference("suppress_miui"))
|
||||
|
||||
val updateCheck: Preference? = findPreference("update_check")
|
||||
updateCheck?.setOnPreferenceClickListener {
|
||||
val fm = childFragmentManager.beginTransaction()
|
||||
|
|
|
@ -7,7 +7,9 @@ import java.io.InputStreamReader
|
|||
|
||||
object MiuiHelper {
|
||||
|
||||
fun isMiui(): Boolean = !TextUtils.isEmpty(getSystemProps("ro.miui.ui.version.name"))
|
||||
fun isMiui(): Boolean {
|
||||
return !TextUtils.isEmpty(getSystemProps("ro.miui.ui.version.name"))
|
||||
}
|
||||
|
||||
fun isMiuiOptimisationsDisabled(): Boolean {
|
||||
return if (isMiui())
|
||||
|
|
|
@ -70,7 +70,6 @@
|
|||
<string name="update_url">Update Channel URL</string>
|
||||
<string name="push_notifications">Push Notifications</string>
|
||||
<string name="push_notifications_summary">Receive push notifications when update is released</string>
|
||||
<string name="suppress_miui">Suppress MiUI warnings</string>
|
||||
<string name="re_check">Re-check</string>
|
||||
<string name="update_center">Update Center</string>
|
||||
<string name="update_found">Update found!</string>
|
||||
|
@ -80,9 +79,9 @@
|
|||
<string name="guide">Guide</string>
|
||||
<string name="hold_on">Hold on!</string>
|
||||
<string name="miui_one_title">Detected MiUI user!</string>
|
||||
<string name="miui_one">Hey! Looks like you\'re a MiUI user. in order to properly use Vanced Manager, you will have to disable MiUI optimisations in developer settings\nIf you can\'t find such setting, it means that you are using a new version of ROM which does not need fixing anything.</string>
|
||||
<string name="miui_one">Hey! Looks like you\'re a MiUI user. in order to properly use Vanced Manager, you will have to disable MiUI optimisations in developer settings\n However, if you are on 20.2.20 ROM that\'s based on xiaomi.eu, you can safely ignore this warning.</string>
|
||||
<string name="miui_two_title">I\'m gonna stop you right there!</string>
|
||||
<string name="miui_two">Looks like you did NOT disable MiUI optimisations. Please disable it. K thx bai</string>
|
||||
<string name="miui_two">Looks like you did NOT disable MiUI optimisations. Please disable it. However, if you are on 20.2.20 ROM that\'s based on xiaomi.eu, you can safely ignore this warning.</string>
|
||||
<string name="error">Error</string>
|
||||
<string name="security_context">Please make sure you downloaded app from vanced.app, Vanced Discord server or GitHub</string>
|
||||
<string name="success">Success!</string>
|
||||
|
|
|
@ -64,10 +64,6 @@
|
|||
android:title="@string/update_url"
|
||||
android:key="install_url" />
|
||||
|
||||
<SwitchPreference
|
||||
android:title="@string/suppress_miui"
|
||||
android:key="suppress_miui"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
</PreferenceScreen>
|
Loading…
Reference in New Issue