mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-19 01:35:10 +00:00
some fixes
This commit is contained in:
parent
d942f82dc5
commit
fde076023f
2 changed files with 3 additions and 8 deletions
|
@ -1,6 +1,5 @@
|
||||||
package com.vanced.manager.core.base
|
package com.vanced.manager.core.base
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
|
||||||
import android.content.pm.PackageManager
|
import android.content.pm.PackageManager
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.view.View
|
import android.view.View
|
||||||
|
@ -35,7 +34,6 @@ open class BaseFragment : Fragment() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("CheckResult")
|
|
||||||
fun downloadSplit(apk: String, apkVar: String, isInstalling: Boolean, loadBar: ProgressBar, navigate: Int) {
|
fun downloadSplit(apk: String, apkVar: String, isInstalling: Boolean, loadBar: ProgressBar, navigate: Int) {
|
||||||
val baseurl = "https://x1nto.github.io/VancedFiles/Splits/"
|
val baseurl = "https://x1nto.github.io/VancedFiles/Splits/"
|
||||||
val url: String =
|
val url: String =
|
||||||
|
@ -46,9 +44,6 @@ open class BaseFragment : Fragment() {
|
||||||
else -> return
|
else -> return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (url.file().exists())
|
|
||||||
url.file().delete()
|
|
||||||
|
|
||||||
activity?.filesDir?.path?.let {
|
activity?.filesDir?.path?.let {
|
||||||
Task(url = url, saveName = getFileNameFromUrl(url), savePath = it)
|
Task(url = url, saveName = getFileNameFromUrl(url), savePath = it)
|
||||||
.download()
|
.download()
|
||||||
|
@ -59,10 +54,10 @@ open class BaseFragment : Fragment() {
|
||||||
loadBar.progress = progress.percent().toInt()
|
loadBar.progress = progress.percent().toInt()
|
||||||
},
|
},
|
||||||
onComplete = {
|
onComplete = {
|
||||||
if (isInstalling) {
|
//if (isInstalling) {
|
||||||
//So we should implement installation here.
|
//So we should implement installation here.
|
||||||
//That will be done later
|
//That will be done later
|
||||||
}
|
//}
|
||||||
view?.findNavController()?.navigate(navigate)
|
view?.findNavController()?.navigate(navigate)
|
||||||
},
|
},
|
||||||
onError = { throwable ->
|
onError = { throwable ->
|
||||||
|
|
|
@ -21,7 +21,7 @@ open class ThemedActivity : AppCompatActivity() {
|
||||||
|
|
||||||
override fun onCreate(savedInstanceState: Bundle?) {
|
override fun onCreate(savedInstanceState: Bundle?) {
|
||||||
pref = PreferenceManager.getDefaultSharedPreferences(this)
|
pref = PreferenceManager.getDefaultSharedPreferences(this)
|
||||||
currentTheme = pref.getString("theme_mode", "LIGHT").toString()
|
currentTheme = pref.getString("theme_mode", "").toString()
|
||||||
|
|
||||||
setFinalTheme(currentTheme)
|
setFinalTheme(currentTheme)
|
||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
|
|
Loading…
Reference in a new issue