mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-23 19:55:11 +00:00
new additions and optimisations
This commit is contained in:
parent
1815d7b157
commit
971b08df35
22 changed files with 258 additions and 106 deletions
|
@ -13,6 +13,9 @@ import com.downloader.OnStartOrResumeListener
|
|||
import com.downloader.PRDownloader
|
||||
import com.vanced.manager.ui.fragments.HomeFragment
|
||||
import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
|
||||
import com.vanced.manager.utils.NotificationHelper
|
||||
import java.lang.Exception
|
||||
import java.lang.IllegalStateException
|
||||
import java.util.concurrent.ExecutionException
|
||||
|
||||
class MicrogDownloadService: Service() {
|
||||
|
@ -20,8 +23,11 @@ class MicrogDownloadService: Service() {
|
|||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
try {
|
||||
downloadMicrog()
|
||||
} catch (e: ExecutionException) {
|
||||
Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
|
||||
} catch (e: Exception) {
|
||||
when (e) {
|
||||
is ExecutionException, is IllegalStateException -> Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
|
||||
else -> throw e
|
||||
}
|
||||
}
|
||||
stopSelf()
|
||||
return START_STICKY
|
||||
|
@ -33,6 +39,7 @@ class MicrogDownloadService: Service() {
|
|||
|
||||
val apkUrl = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/microg.json")
|
||||
val dwnldUrl = apkUrl.get("url").asString
|
||||
val channel = 420
|
||||
PRDownloader.download(dwnldUrl, filesDir.path, "microg.apk")
|
||||
.build()
|
||||
.setOnStartOrResumeListener { OnStartOrResumeListener { TODO("Not yet implemented") } }
|
||||
|
@ -43,6 +50,12 @@ class MicrogDownloadService: Service() {
|
|||
intent.putExtra("microgProgress", mProgress.toInt())
|
||||
intent.putExtra("fileName", "Downloading ${getFileNameFromUrl(dwnldUrl)}...")
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
|
||||
NotificationHelper.displayDownloadNotif(
|
||||
channel,
|
||||
maxVal = 0,
|
||||
filename = getFileNameFromUrl(dwnldUrl),
|
||||
context = this@MicrogDownloadService
|
||||
)
|
||||
}
|
||||
.start(object : OnDownloadListener {
|
||||
override fun onDownloadComplete() {
|
||||
|
@ -50,12 +63,24 @@ class MicrogDownloadService: Service() {
|
|||
intent.action = HomeFragment.MICROG_DOWNLOADED
|
||||
LocalBroadcastManager.getInstance(this@MicrogDownloadService).sendBroadcast(intent)
|
||||
prefs?.edit()?.putBoolean("isMicrogDownloading", false)?.apply()
|
||||
NotificationHelper.displayDownloadNotif(
|
||||
channel,
|
||||
maxVal = 0,
|
||||
filename = getFileNameFromUrl(dwnldUrl),
|
||||
context = this@MicrogDownloadService
|
||||
)
|
||||
}
|
||||
override fun onError(error: Error) {
|
||||
val intent = Intent(HomeFragment.DOWNLOAD_ERROR)
|
||||
intent.action = HomeFragment.DOWNLOAD_ERROR
|
||||
intent.putExtra("DownloadError", error.toString())
|
||||
LocalBroadcastManager.getInstance(this@MicrogDownloadService).sendBroadcast(intent)
|
||||
NotificationHelper.displayDownloadNotif(
|
||||
channel,
|
||||
maxVal = 0,
|
||||
filename = getFileNameFromUrl(dwnldUrl),
|
||||
context = this@MicrogDownloadService
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -15,15 +15,25 @@ import com.vanced.manager.core.installer.RootSplitInstallerService
|
|||
import com.vanced.manager.core.installer.SplitInstaller
|
||||
import com.vanced.manager.ui.fragments.HomeFragment
|
||||
import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
|
||||
import com.vanced.manager.utils.InternetTools.getLatestVancedUrl
|
||||
import com.vanced.manager.utils.NotificationHelper.displayDownloadNotif
|
||||
import java.lang.Exception
|
||||
import java.lang.IllegalStateException
|
||||
import java.util.concurrent.ExecutionException
|
||||
|
||||
class VancedDownloadService: Service() {
|
||||
|
||||
private val baseUrl = PreferenceManager.getDefaultSharedPreferences(this).getString("install_url", getLatestVancedUrl(this))
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
try {
|
||||
downloadSplits()
|
||||
} catch (e: ExecutionException) {
|
||||
Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
|
||||
} catch (e: Exception) {
|
||||
when (e) {
|
||||
is ExecutionException, is IllegalStateException -> Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
|
||||
else -> throw e
|
||||
}
|
||||
|
||||
}
|
||||
stopSelf()
|
||||
return START_STICKY
|
||||
|
@ -53,6 +63,8 @@ class VancedDownloadService: Service() {
|
|||
else -> throw NotImplementedError("This type of APK is NOT valid. What the hell did you even do?")
|
||||
}
|
||||
|
||||
val channel = 69
|
||||
|
||||
PRDownloader.download(url, cacheDir.path, getFileNameFromUrl(url))
|
||||
.build()
|
||||
.setOnProgressListener { progress ->
|
||||
|
@ -65,6 +77,7 @@ class VancedDownloadService: Service() {
|
|||
"Downloading ${getFileNameFromUrl(url)}..."
|
||||
)
|
||||
LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
|
||||
displayDownloadNotif(channel, mProgress.toInt(), filename = getFileNameFromUrl(url), context = this)
|
||||
}
|
||||
.start(object : OnDownloadListener {
|
||||
override fun onDownloadComplete() {
|
||||
|
@ -74,11 +87,15 @@ class VancedDownloadService: Service() {
|
|||
"lang" -> {
|
||||
if (lang == "en") {
|
||||
prepareInstall(variant!!)
|
||||
displayDownloadNotif(channel, maxVal = 0, filename = getFileNameFromUrl(url), context = this@VancedDownloadService)
|
||||
} else {
|
||||
downloadSplits("enlang")
|
||||
}
|
||||
}
|
||||
"enlang" -> prepareInstall(variant!!)
|
||||
"enlang" -> {
|
||||
prepareInstall(variant!!)
|
||||
displayDownloadNotif(channel, maxVal = 0, filename = getFileNameFromUrl(url), context = this@VancedDownloadService)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,9 +126,6 @@ class VancedDownloadService: Service() {
|
|||
private fun launchRootInstaller() {
|
||||
startService(Intent(this, RootSplitInstallerService::class.java))
|
||||
}
|
||||
companion object {
|
||||
const val baseUrl = "https://vanced.app/api/v1/apks/v15.05.54"
|
||||
}
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
return null
|
||||
|
|
|
@ -42,8 +42,8 @@ object DialogContainer {
|
|||
|
||||
fun showRootDialog(activity: Activity) {
|
||||
AlertDialog.Builder(activity)
|
||||
.setTitle(activity.getString(R.string.miui_two_title))
|
||||
.setMessage(activity.getString(R.string.miui_two))
|
||||
.setTitle(activity.getString(R.string.hold_on))
|
||||
.setMessage(activity.getString(R.string.disable_signature))
|
||||
.setPositiveButton(activity.getString(R.string.button_dismiss)) { dialog, _ ->
|
||||
dialog.dismiss()
|
||||
PreferenceManager.getDefaultSharedPreferences(activity).edit().putBoolean("show_root_dialog", false).apply()
|
||||
|
|
|
@ -35,8 +35,8 @@ class ChosenPreferenceDialogFragment : DialogFragment() {
|
|||
|
||||
val prefs = activity?.getSharedPreferences("installPrefs", Context.MODE_PRIVATE)
|
||||
|
||||
themetxt.text = prefs?.getString("theme", "dark")
|
||||
langtxt.text = prefs?.getString("lang", "en")
|
||||
themetxt.text = activity?.getString(R.string.chosen_theme, prefs?.getString("theme", "dark"))
|
||||
langtxt.text = activity?.getString(R.string.chosen_lang, prefs?.getString("lang", "en"))
|
||||
|
||||
closebtn.setOnClickListener { dismiss() }
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import android.graphics.Color
|
|||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.view.animation.AccelerateDecelerateInterpolator
|
||||
import android.view.animation.Animation
|
||||
import android.view.animation.RotateAnimation
|
||||
import android.widget.*
|
||||
|
@ -74,12 +75,12 @@ class HomeFragment : Home() {
|
|||
viewPagerContainer?.visibility = View.GONE
|
||||
tabLayoutContainer?.visibility = View.GONE
|
||||
isExpanded = false
|
||||
arrow?.startAnimation(RotateAnimation(180f, 0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f))
|
||||
arrow?.animate()?.rotation(0F)?.interpolator = AccelerateDecelerateInterpolator()
|
||||
} else {
|
||||
viewPagerContainer?.visibility = View.VISIBLE
|
||||
tabLayoutContainer?.visibility = View.VISIBLE
|
||||
isExpanded = true
|
||||
arrow?.startAnimation(RotateAnimation(0f, 180f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f))
|
||||
arrow?.animate()?.rotation(180F)?.interpolator = AccelerateDecelerateInterpolator()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.vanced.manager.ui.fragments
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.Menu
|
||||
import android.view.MenuInflater
|
||||
|
@ -9,18 +8,16 @@ import androidx.preference.Preference
|
|||
import androidx.preference.PreferenceFragmentCompat
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.ui.MainActivity
|
||||
|
||||
class SettingsFragment : PreferenceFragmentCompat() {
|
||||
|
||||
@ExperimentalStdlibApi
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
setPreferencesFromResource(R.xml.preferences, rootKey)
|
||||
|
||||
activity?.title = getString(R.string.title_settings)
|
||||
setHasOptionsMenu(true)
|
||||
|
||||
/*
|
||||
|
||||
val updateCheck: Preference? = findPreference("update_check")
|
||||
updateCheck?.setOnPreferenceClickListener {
|
||||
val fm = childFragmentManager.beginTransaction()
|
||||
|
@ -28,8 +25,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
updateDialog.show(fm, "Update Center")
|
||||
true
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
val themeSwitch: ListPreference? = findPreference("theme_mode")
|
||||
themeSwitch?.summary =
|
||||
|
@ -46,7 +41,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
true
|
||||
}
|
||||
|
||||
/*
|
||||
val chosenPrefs: Preference? = findPreference("vanced_chosen_modes")
|
||||
chosenPrefs?.setOnPreferenceClickListener {
|
||||
val fm = childFragmentManager.beginTransaction()
|
||||
|
@ -55,7 +49,13 @@ class SettingsFragment : PreferenceFragmentCompat() {
|
|||
true
|
||||
}
|
||||
|
||||
*/
|
||||
val installUrl: Preference? = findPreference("install_url")
|
||||
installUrl?.setOnPreferenceClickListener {
|
||||
val fm = childFragmentManager.beginTransaction()
|
||||
val chosenPrefsDialog = URLChangeFragment()
|
||||
chosenPrefsDialog.show(fm, "Install URL")
|
||||
true
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,42 @@
|
|||
package com.vanced.manager.ui.fragments
|
||||
|
||||
import android.graphics.Color
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Bundle
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import android.widget.EditText
|
||||
import androidx.fragment.app.DialogFragment
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.dezlum.codelabs.getjson.GetJson
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.utils.InternetTools.getLatestVancedUrl
|
||||
|
||||
class URLChangeFragment : DialogFragment() {
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
savedInstanceState: Bundle?
|
||||
): View? {
|
||||
if (dialog != null && dialog?.window != null) {
|
||||
dialog?.window?.setBackgroundDrawable(ColorDrawable(Color.TRANSPARENT))
|
||||
}
|
||||
return inflater.inflate(R.layout.fragment_update_check, container, false)
|
||||
}
|
||||
|
||||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
val urlField = view.findViewById<EditText>(R.id.url_input)
|
||||
val prefs = PreferenceManager.getDefaultSharedPreferences(activity)
|
||||
urlField.hint = prefs.getString("install_url", activity?.let { getLatestVancedUrl(it) })
|
||||
view.findViewById<MaterialButton>(R.id.url_save).setOnClickListener {
|
||||
prefs.edit().putString("install_url", urlField.text.toString()).apply()
|
||||
}
|
||||
view.findViewById<MaterialButton>(R.id.url_reset).setOnClickListener {
|
||||
prefs.edit().putString("install_url", activity?.let { getLatestVancedUrl(it) }).apply()
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -46,10 +46,10 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
|
|||
val vancedVersion: MutableLiveData<String> = MutableLiveData()
|
||||
val microgVersion: MutableLiveData<String> = MutableLiveData()
|
||||
|
||||
val vancedInstalledVersionCode = getPkgVerCode(vancedInstalled, vancedPkgName)
|
||||
private val vancedInstalledVersionCode = getPkgVerCode(vancedInstalled, vancedPkgName)
|
||||
private val microgInstalledVersionCode = getPkgVerCode(microgInstalled, "com.mgoogle.android.gms")
|
||||
|
||||
val vancedVersionCode = displayJsonInt("vanced.json", "versionCode", application)
|
||||
private val vancedVersionCode = displayJsonInt("vanced.json", "versionCode", application)
|
||||
private val microgVersionCode = displayJsonInt("microg.json", "versionCode", application)
|
||||
|
||||
val microgInstallButtonTxt = compareInt(microgInstalledVersionCode, microgVersionCode, application)
|
||||
|
@ -112,7 +112,7 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
|
|||
return if (connected)
|
||||
when {
|
||||
int1 > int2 -> application.getString(R.string.update)
|
||||
int2 == int1 -> application.getString(R.string.button_installed)
|
||||
int2 == int1 -> application.getString(R.string.button_reinstall)
|
||||
else -> application.getString(R.string.install)
|
||||
} else application.getString(R.string.install)
|
||||
}
|
||||
|
@ -135,21 +135,21 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
|
|||
vancedInstallButtonIcon.value =
|
||||
if (variant == "nonroot") {
|
||||
if (microgInstalled)
|
||||
compareIntDrawable(vancedInstalledVersionCode, vancedVersionCode, application)
|
||||
compareIntDrawable(vancedVersionCode, vancedInstalledVersionCode, application)
|
||||
else
|
||||
null
|
||||
} else
|
||||
compareIntDrawable(vancedInstalledVersionCode, vancedVersionCode, application)
|
||||
compareIntDrawable(vancedVersionCode, vancedInstalledVersionCode, application)
|
||||
|
||||
vancedInstallButtonTxt.value =
|
||||
if (variant == "nonroot") {
|
||||
if (microgInstalled) {
|
||||
compareInt(vancedInstalledVersionCode, vancedVersionCode, application)
|
||||
compareInt(vancedVersionCode, vancedInstalledVersionCode, application)
|
||||
} else {
|
||||
application.getString(R.string.no_microg)
|
||||
}
|
||||
} else
|
||||
compareInt(vancedInstalledVersionCode, vancedVersionCode, application)
|
||||
compareInt(vancedVersionCode, vancedInstalledVersionCode, application)
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -1,24 +1,12 @@
|
|||
package com.vanced.manager.utils
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.view.View
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import androidx.core.content.ContextCompat
|
||||
import com.dezlum.codelabs.getjson.GetJson
|
||||
import com.vanced.manager.BuildConfig
|
||||
import com.vanced.manager.R
|
||||
import java.lang.IllegalStateException
|
||||
|
||||
object InternetTools {
|
||||
|
||||
fun openUrl(Url: String, color: Int, context: Context) {
|
||||
val builder = CustomTabsIntent.Builder()
|
||||
builder.setToolbarColor(ContextCompat.getColor(context, color))
|
||||
val customTabsIntent = builder.build()
|
||||
customTabsIntent.launchUrl(context, Uri.parse(Url))
|
||||
}
|
||||
|
||||
fun getFileNameFromUrl(url: String) = url.substring(url.lastIndexOf('/')+1, url.length)
|
||||
|
||||
fun displayJsonString(json: String, obj: String, context: Context): String {
|
||||
|
@ -50,5 +38,13 @@ object InternetTools {
|
|||
return remoteVersion > BuildConfig.VERSION_CODE
|
||||
}
|
||||
|
||||
fun getLatestVancedUrl(context: Context): String {
|
||||
return if (GetJson().isConnected(context)) {
|
||||
val latestVer = GetJson().AsJSONObject("https://x1nto.github.io/vanced.json").getAsJsonObject("version").asString
|
||||
"https://vanced.app/api/v1/apks/$latestVer"
|
||||
} else
|
||||
"https://vanced.app/api/v1/apks/v15.05.54"
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.vanced.manager.utils
|
||||
|
||||
import android.app.Notification
|
||||
import android.app.NotificationManager
|
||||
import android.content.Context
|
||||
import android.os.Build
|
||||
import com.vanced.manager.R
|
||||
|
||||
object NotificationHelper {
|
||||
|
||||
fun displayDownloadNotif(channel: Int, maxVal: Int = 100, progress:Int = 0, filename: String, context: Context) {
|
||||
val notifBuilder =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
|
||||
Notification.Builder(context, channel.toString()).setChannelId(channel.toString())
|
||||
else
|
||||
Notification.Builder(context).setPriority(Notification.PRIORITY_DEFAULT)
|
||||
|
||||
notifBuilder.apply {
|
||||
setContentTitle(context.getString(R.string.app_name))
|
||||
setContentText(context.getString(R.string.downloading_file, filename))
|
||||
}
|
||||
val notif = notifBuilder.build()
|
||||
val notificationManager = context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
|
||||
notificationManager.apply {
|
||||
notifBuilder.setProgress(maxVal, progress, false)
|
||||
notify(channel, notif)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -20,49 +20,23 @@
|
|||
<TextView
|
||||
style="@style/CardTitle"
|
||||
android:layout_gravity="center"
|
||||
android:text="Chosen Preferences"
|
||||
android:text="@string/chosen_preferences"
|
||||
android:textAlignment="center"
|
||||
android:fontFamily="@font/exo_semibold" />
|
||||
|
||||
<LinearLayout
|
||||
<TextView
|
||||
android:id="@+id/chosen_theme"
|
||||
style="@style/AppVer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="wrap_content"
|
||||
android:text="" />
|
||||
|
||||
<TextView
|
||||
style="@style/AppVer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Theme:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chosen_theme"
|
||||
style="@style/AppVer.Bold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
tools:text="dark"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
<TextView
|
||||
android:id="@+id/chosen_lang"
|
||||
style="@style/AppVer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
style="@style/AppVer"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Language:" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/chosen_lang"
|
||||
style="@style/AppVer.Bold"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="8dp"
|
||||
tools:text="en"/>
|
||||
|
||||
</LinearLayout>
|
||||
android:layout_height="wrap_content"
|
||||
android:text="" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -81,7 +55,7 @@
|
|||
android:id="@+id/chosen_prefs_reset"
|
||||
style="@style/ButtonStyle"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="Reset" />
|
||||
android:text="@string/reset" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
63
app/src/main/res/layout/fragment_custom_url.xml
Normal file
63
app/src/main/res/layout/fragment_custom_url.xml
Normal file
|
@ -0,0 +1,63 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/MaterialCard"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
app:contentPaddingTop="0dp"
|
||||
app:contentPaddingBottom="0dp"
|
||||
app:contentPaddingRight="6dp"
|
||||
app:contentPaddingLeft="6dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CardTitle"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/update_url"
|
||||
android:textAlignment="center"
|
||||
android:fontFamily="@font/exo_semibold" />
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.Dense"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:hintEnabled="true"
|
||||
app:boxStrokeWidth="2dp"
|
||||
app:boxStrokeColor="?colorPrimary">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/url_input"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/url_reset"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:text="@string/reset"
|
||||
android:textAllCaps="false"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/url_save"
|
||||
style="@style/ButtonStyle"
|
||||
android:layout_marginStart="4dp"
|
||||
android:text="@string/save" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
|
@ -17,6 +17,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:fillViewport="true"
|
||||
android:animateLayoutChanges="true"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
|
@ -42,6 +43,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
bind:strokeWidth="3dp"
|
||||
bind:strokeColor="?colorPrimary"
|
||||
android:textAllCaps="false"
|
||||
android:text="@string/nonroot"/>
|
||||
|
||||
|
@ -64,6 +67,8 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
|
||||
bind:strokeWidth="3dp"
|
||||
bind:strokeColor="?colorPrimary"
|
||||
android:textAllCaps="false"
|
||||
android:text="@string/root"/>
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:id="@+id/manager_changelog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textSize="16sp"
|
||||
android:text="@string/loading" />
|
||||
|
||||
</FrameLayout>
|
|
@ -10,7 +10,7 @@
|
|||
android:id="@+id/microg_changelog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="18sp"
|
||||
android:textSize="16sp"
|
||||
android:text="Changes:\n - Added casting support\n
|
||||
- Fixed notifications\n\nMicroG now requires Vanced 14.21.54 and up"
|
||||
tools:ignore="HardcodedText" />
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
android:id="@+id/vanced_changelog"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:textSize="18sp"
|
||||
android:textSize="16sp"
|
||||
android:text="Removed:\n
|
||||
- Auto subtitles (has been replaced with live captions)\n
|
||||
- minimised video player style (Google removed it) \n
|
||||
|
|
|
@ -132,6 +132,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
style="@style/CardTitle"
|
||||
android:text="Downloading"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/MaterialCard"
|
||||
app:contentPaddingTop="2dp">
|
||||
app:contentPaddingTop="2dp"
|
||||
android:animateLayoutChanges="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
@ -120,6 +120,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
style="@style/CardTitle"
|
||||
android:text="Downloading"
|
||||
android:textSize="16sp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
android:label="@string/title_settings">
|
||||
|
||||
<action
|
||||
android:id="@+id/toSecretSettingsFragment"
|
||||
app:destination="@id/secret_settings_fragment"
|
||||
android:id="@+id/toDevSettingsFragment"
|
||||
app:destination="@id/dev_settings_fragment"
|
||||
app:enterAnim="@animator/fragment_enter"
|
||||
app:exitAnim="@animator/fragment_exit"
|
||||
app:popEnterAnim="@animator/fragment_enter_pop"
|
||||
|
@ -98,21 +98,6 @@
|
|||
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/secret_settings_fragment"
|
||||
android:name="com.vanced.manager.ui.fragments.SecretSettingsFragment"
|
||||
android:label="Secret Settings">
|
||||
|
||||
<action
|
||||
android:id="@+id/toDevSettingsFragment"
|
||||
app:destination="@id/dev_settings_fragment"
|
||||
app:enterAnim="@animator/fragment_enter"
|
||||
app:exitAnim="@animator/fragment_exit"
|
||||
app:popEnterAnim="@animator/fragment_enter_pop"
|
||||
app:popExitAnim="@animator/fragment_exit_pop" />
|
||||
|
||||
</fragment>
|
||||
|
||||
<fragment
|
||||
android:id="@+id/dev_settings_fragment"
|
||||
android:name="com.vanced.manager.ui.fragments.DevSettingsFragment"
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
<!-- Global Strings -->
|
||||
<string name="close">Close</string>
|
||||
<string name="reset">Reset</string>
|
||||
<string name="save">Save</string>
|
||||
|
||||
<!-- Main Activity -->
|
||||
<string name="title_about">About</string>
|
||||
|
@ -15,7 +17,7 @@
|
|||
<!-- Home Page -->
|
||||
<string name="changelogs">Changelogs</string>
|
||||
<string name="check">Check</string>
|
||||
<string name="disable_signature">Root mode detected! In order for manager to install Vanced correctly, please make sure you disabled signature verification.</string>
|
||||
<string name="downloading_file">Downloading %1$s</string>
|
||||
<string name="failed_uninstall">Failed to uninstall package: </string>
|
||||
<string name="install">Install</string>
|
||||
<string name="installation_aborted">Operation failed because user aborted installation</string>
|
||||
|
@ -25,14 +27,16 @@
|
|||
<string name="installation_incompatible">Operation failed because app is incompatible with your device</string>
|
||||
<string name="installation_invalid">Operation failed because apk files are invalid</string>
|
||||
<string name="installation_signature">Unexpected error occurred while installing Vanced. Did you disable signature verification?</string>
|
||||
<string name="installation_miui">Unexpected error occurred while installing Vanced. Did you disable MiUI Optimisations?</string>
|
||||
<string name="installation_storage">Operation failed because there was an error with storage. Hold up how is that even possible?</string>
|
||||
<string name="button_installed">Installed</string>
|
||||
<string name="button_reinstall">Reinstall</string>
|
||||
<string name="version_installed">Installed:</string>
|
||||
<string name="latest">Latest:</string>
|
||||
<string name="loading">Loading…</string>
|
||||
<string name="microg_installed">MicroG successfully installed</string>
|
||||
<string name="network_error">Network connection unavailable</string>
|
||||
<string name="no_microg">No Microg!</string>
|
||||
<string name="unable_download">Unable to download %1$s</string>
|
||||
<string name="unavailable">Unavailable</string>
|
||||
<string name="update">Update</string>
|
||||
<string name="useful_links">Useful Links</string>
|
||||
|
@ -51,11 +55,15 @@
|
|||
<string name="category_interface">Interface</string>
|
||||
<string name="category_manager">Manager</string>
|
||||
<string name="chosen_install_values">Chosen Installation values</string>
|
||||
<string name="chosen_lang">Language: %1$s</string>
|
||||
<string name="chosen_theme">Theme: %1$s</string>
|
||||
<string name="chosen_preferences">Chosen Preferences</string>
|
||||
<string name="theme">Theme</string>
|
||||
<string name="theme_follow">Follow System</string>
|
||||
<string name="theme_dark">Dark Theme</string>
|
||||
<string name="theme_light">Light Theme</string>
|
||||
<string name="theme_summary">Choose your preferred theme</string>
|
||||
<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="re_check">Re-check</string>
|
||||
|
@ -64,6 +72,7 @@
|
|||
<string name="update_notfound">No new updates</string>
|
||||
|
||||
<!-- Dialogs -->
|
||||
<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_two_title">I\'m gonna stop you right there!</string>
|
||||
|
@ -80,6 +89,7 @@
|
|||
<string name="choose_preferred_language">Choose your preferred language for Vanced</string>
|
||||
<string name="choose_preferred_language_note">Note: if you install anything other than English, English will still be installed as an additional language</string>
|
||||
<string name="choose_preferred_theme">Choose your preferred theme for Vanced</string>
|
||||
<string name="disable_signature">Root mode detected! In order for manager to install Vanced correctly, please make sure you disabled signature verification.</string>
|
||||
<string name="finish">Finish</string>
|
||||
<string name="install_light_black">Light + Black</string>
|
||||
<string name="install_light_dark">Light + Dark</string>
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
<Preference
|
||||
android:key="update_check"
|
||||
android:title="@string/check_updates"
|
||||
android:icon="@drawable/ic_cloud_upload_black_24dp"
|
||||
android:fragment="com.vanced.manager.ui.fragments.UpdateCheckFragment"/>
|
||||
android:icon="@drawable/ic_cloud_upload_black_24dp" />
|
||||
|
||||
<SwitchPreference
|
||||
android:title="Auto-Check updates"
|
||||
|
@ -58,8 +57,11 @@
|
|||
|
||||
<Preference
|
||||
android:title="@string/chosen_install_values"
|
||||
android:key="vanced_chosen_modes"
|
||||
android:fragment="com.vanced.manager.ui.fragments.ChosenPreferenceDialogFragment"/>
|
||||
android:key="vanced_chosen_modes" />
|
||||
|
||||
<Preference
|
||||
android:title="@string/update_url"
|
||||
android:key="install_url" />
|
||||
|
||||
</PreferenceCategory>
|
||||
|
||||
|
|
Loading…
Reference in a new issue