optimisations
This commit is contained in:
parent
47181c8f70
commit
96842dc245
|
@ -169,6 +169,7 @@
|
|||
<orderEntry type="library" name="Gradle: androidx.navigation:navigation-ui:2.2.2@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.google.android.material:material:1.1.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.github.100rabhkr:GetJSON:1.0@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: com.alespero:expandable-cardview:0.8@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: androidx.preference:preference-ktx:1.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: androidx.preference:preference:1.1.1@aar" level="project" />
|
||||
<orderEntry type="library" name="Gradle: androidx.appcompat:appcompat:1.1.0@aar" level="project" />
|
||||
|
|
|
@ -70,5 +70,6 @@ dependencies {
|
|||
implementation 'com.github.100rabhkr:GetJSON:1.0'
|
||||
implementation 'com.github.pwittchen:reactivenetwork-rx2:3.0.8'
|
||||
implementation 'com.github.topjohnwu.libsu:core:2.5.1'
|
||||
implementation 'com.alespero:expandable-cardview:0.8'
|
||||
implementation 'com.mindorks.android:prdownloader:0.6.0'
|
||||
}
|
||||
|
|
|
@ -62,8 +62,15 @@
|
|||
<service android:name=".core.installer.RootAppUninstaller" />
|
||||
<service android:name=".core.installer.AppUninstallerService" />
|
||||
<service android:name=".core.installer.AppInstallerService" />
|
||||
<service android:name=".core.downloader.VancedDownloadService" />
|
||||
<service android:name=".core.downloader.MicrogDownloadService" />
|
||||
<service
|
||||
android:name=".core.downloader.VancedDownloadService"
|
||||
android:exported="true"
|
||||
android:process=":VancedDownloadProcess" />
|
||||
|
||||
<service
|
||||
android:name=".core.downloader.MicrogDownloadService"
|
||||
android:exported="true"
|
||||
android:process=":MicrogDownloadProcess"/>
|
||||
|
||||
</application>
|
||||
|
||||
|
|
|
@ -4,10 +4,12 @@ import android.app.Service
|
|||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.os.IBinder
|
||||
import android.widget.Toast
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import com.dezlum.codelabs.getjson.GetJson
|
||||
import com.downloader.Error
|
||||
import com.downloader.OnDownloadListener
|
||||
import com.downloader.OnStartOrResumeListener
|
||||
import com.downloader.PRDownloader
|
||||
import com.vanced.manager.ui.fragments.HomeFragment
|
||||
import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
|
||||
|
@ -15,9 +17,13 @@ import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
|
|||
class MicrogDownloadService: Service() {
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
downloadMicrog()
|
||||
try {
|
||||
downloadMicrog()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
stopSelf()
|
||||
return START_NOT_STICKY
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
private fun downloadMicrog() {
|
||||
|
@ -28,6 +34,7 @@ class MicrogDownloadService: Service() {
|
|||
val dwnldUrl = apkUrl.get("url").asString
|
||||
PRDownloader.download(dwnldUrl, filesDir.path, "microg.apk")
|
||||
.build()
|
||||
.setOnStartOrResumeListener { OnStartOrResumeListener { TODO("Not yet implemented") } }
|
||||
.setOnProgressListener { progress ->
|
||||
val intent = Intent(HomeFragment.MICROG_DOWNLOADING)
|
||||
val mProgress = progress.currentBytes * 100 / progress.totalBytes
|
||||
|
|
|
@ -5,6 +5,7 @@ import android.content.Context
|
|||
import android.content.Intent
|
||||
import android.os.Build
|
||||
import android.os.IBinder
|
||||
import android.widget.Toast
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import androidx.preference.PreferenceManager
|
||||
import com.downloader.Error
|
||||
|
@ -18,9 +19,13 @@ import com.vanced.manager.utils.InternetTools.getFileNameFromUrl
|
|||
class VancedDownloadService: Service() {
|
||||
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
downloadSplits()
|
||||
try {
|
||||
downloadSplits()
|
||||
} catch (e: Exception) {
|
||||
Toast.makeText(this, "Unable to download Vanced", Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
stopSelf()
|
||||
return START_NOT_STICKY
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
private fun downloadSplits(
|
||||
|
|
|
@ -61,7 +61,6 @@ open class Home : BaseFragment(), View.OnClickListener, AdapterView.OnItemSelect
|
|||
|
||||
spinner.onItemSelectedListener = this
|
||||
|
||||
|
||||
}
|
||||
|
||||
override fun onResume() {
|
||||
|
|
|
@ -1,29 +1,23 @@
|
|||
package com.vanced.manager.ui.fragments
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.content.BroadcastReceiver
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.IntentFilter
|
||||
import android.content.res.ColorStateList
|
||||
import android.graphics.Color
|
||||
import android.os.Build
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
import android.view.*
|
||||
import android.widget.ProgressBar
|
||||
import android.widget.TextView
|
||||
import android.widget.Toast
|
||||
import androidx.core.animation.addListener
|
||||
import androidx.databinding.DataBindingUtil
|
||||
import androidx.fragment.app.viewModels
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import androidx.preference.PreferenceManager.getDefaultSharedPreferences
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.dezlum.codelabs.getjson.GetJson
|
||||
import com.github.pwittchen.reactivenetwork.library.rx2.ReactiveNetwork
|
||||
import com.google.android.material.button.MaterialButton
|
||||
import com.google.android.material.card.MaterialCardView
|
||||
import com.google.android.material.tabs.TabLayout
|
||||
import com.google.android.material.tabs.TabLayoutMediator
|
||||
import com.vanced.manager.R
|
||||
|
@ -33,12 +27,7 @@ import com.vanced.manager.core.fragments.Home
|
|||
import com.vanced.manager.core.installer.RootAppUninstaller
|
||||
import com.vanced.manager.databinding.FragmentHomeBinding
|
||||
import com.vanced.manager.ui.viewmodels.HomeViewModel
|
||||
import com.vanced.manager.utils.InternetTools.displayJsonInt
|
||||
import com.vanced.manager.utils.PackageHelper.installApp
|
||||
import com.vanced.manager.utils.PackageHelper.isPackageInstalled
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.disposables.Disposable
|
||||
import io.reactivex.schedulers.Schedulers
|
||||
|
||||
class HomeFragment : Home() {
|
||||
|
||||
|
@ -46,7 +35,6 @@ class HomeFragment : Home() {
|
|||
private lateinit var sectionPageRootAdapter: SectionPageRootAdapter
|
||||
private lateinit var viewPager: ViewPager2
|
||||
private lateinit var binding: FragmentHomeBinding
|
||||
private var disposable: Disposable? = null
|
||||
|
||||
override fun onCreateView(
|
||||
inflater: LayoutInflater, container: ViewGroup?,
|
||||
|
@ -61,7 +49,6 @@ class HomeFragment : Home() {
|
|||
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
|
||||
super.onViewCreated(view, savedInstanceState)
|
||||
|
||||
initNetworkFun()
|
||||
val viewModel: HomeViewModel by viewModels()
|
||||
binding.viewModel = viewModel
|
||||
|
||||
|
@ -70,8 +57,19 @@ class HomeFragment : Home() {
|
|||
|
||||
if (variantPref == "root") {
|
||||
attachRootChangelog()
|
||||
} else
|
||||
if (viewModel.signatureStatusTxt.value != getString(R.string.signature_disabled)) {
|
||||
when (viewModel.signatureStatusTxt.value) {
|
||||
getString(R.string.unavailable) -> disableVancedButton(getString(R.string.signature_not_checked))
|
||||
getString(R.string.signature_enabled) -> disableVancedButton(getString(R.string.signature_disable))
|
||||
else -> throw NotImplementedError("Error handling status")
|
||||
}
|
||||
}
|
||||
} else {
|
||||
attachNonrootChangelog()
|
||||
if (!viewModel.microgInstalled) {
|
||||
disableVancedButton(getString(R.string.no_microg))
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -80,148 +78,6 @@ class HomeFragment : Home() {
|
|||
activity?.let { LocalBroadcastManager.getInstance(it).unregisterReceiver(broadcastReceiver) }
|
||||
}
|
||||
|
||||
private fun initNetworkFun() {
|
||||
val pm = activity?.packageManager
|
||||
val variant = getDefaultSharedPreferences(activity).getString("vanced_variant", "nonroot")
|
||||
val microgStatus = pm?.let { isPackageInstalled("com.mgoogle.android.gms", it) }
|
||||
val vancedStatus =
|
||||
if (variant == "root") {
|
||||
pm?.let { isPackageInstalled("com.google.android.youtube", it) }
|
||||
} else {
|
||||
pm?.let { isPackageInstalled("com.vanced.android.youtube", it) }
|
||||
}
|
||||
val vancedinstallbtn = view?.findViewById<MaterialButton>(R.id.vanced_installbtn)
|
||||
val networkErrorLayout = view?.findViewById<MaterialCardView>(R.id.home_network_wrapper)
|
||||
val viewModel: HomeViewModel by viewModels()
|
||||
|
||||
disposable = ReactiveNetwork.observeInternetConnectivity()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe { isConnectedToInternet ->
|
||||
run {
|
||||
if (isConnectedToInternet) {
|
||||
vancedinstallbtn?.visibility = View.VISIBLE
|
||||
|
||||
val vancedRemoteCode = activity?.let { displayJsonInt("vanced.json", "versionCode", it) }
|
||||
val microgRemoteCode = activity?.let { displayJsonInt("microg.json", "versionCode", it) }
|
||||
|
||||
if (variant == "nonroot") {
|
||||
val microginstallbtn =
|
||||
view?.findViewById<MaterialButton>(R.id.microg_installbtn)
|
||||
microginstallbtn?.visibility = View.VISIBLE
|
||||
|
||||
if (microgStatus!!) {
|
||||
@Suppress("DEPRECATION")
|
||||
val microgVerCode =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
||||
pm.getPackageInfo("com.mgoogle.android.gms", 0).longVersionCode.and(0xFFFFFFFF).toInt()
|
||||
else
|
||||
pm.getPackageInfo("com.mgoogle.android.gms", 0).versionCode
|
||||
when {
|
||||
microgRemoteCode!! > microgVerCode -> {
|
||||
microginstallbtn?.text =
|
||||
activity?.getString(R.string.update)
|
||||
microginstallbtn?.icon =
|
||||
activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp)
|
||||
}
|
||||
|
||||
microgRemoteCode == microgVerCode -> {
|
||||
microginstallbtn?.text =
|
||||
activity?.getString(R.string.button_installed)
|
||||
microginstallbtn?.icon =
|
||||
activity?.getDrawable(R.drawable.outline_cloud_done_24)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
disableVancedButton(getString(R.string.no_microg))
|
||||
}
|
||||
}
|
||||
|
||||
if (vancedStatus!!) {
|
||||
val vanPkgName =
|
||||
if (variant == "root")
|
||||
"com.google.android.youtube"
|
||||
else
|
||||
"com.vanced.android.youtube"
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
val vancedVerCode =
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) {
|
||||
pm?.getPackageInfo(
|
||||
vanPkgName,
|
||||
0
|
||||
)?.longVersionCode?.and(0xFFFFFFFF)?.toInt()
|
||||
}
|
||||
else {
|
||||
pm?.getPackageInfo(
|
||||
vanPkgName,
|
||||
0
|
||||
)?.versionCode
|
||||
}
|
||||
|
||||
when {
|
||||
vancedRemoteCode!! > vancedVerCode!! -> {
|
||||
vancedinstallbtn?.text =
|
||||
activity?.getString(R.string.update)
|
||||
vancedinstallbtn?.icon =
|
||||
activity?.getDrawable(R.drawable.ic_cloud_upload_black_24dp)
|
||||
}
|
||||
|
||||
vancedRemoteCode == vancedVerCode -> {
|
||||
vancedinstallbtn?.text =
|
||||
activity?.getString(R.string.button_installed)
|
||||
vancedinstallbtn?.icon =
|
||||
activity?.getDrawable(R.drawable.outline_cloud_done_24)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (variant == "root" && viewModel.signatureStatusTxt.value != getString(R.string.signature_disabled)) {
|
||||
when (viewModel.signatureStatusTxt.value) {
|
||||
getString(R.string.unavailable) -> disableVancedButton(getString(R.string.signature_not_checked))
|
||||
getString(R.string.signature_enabled) -> disableVancedButton(getString(R.string.signature_disable))
|
||||
else -> throw NotImplementedError("Error handling status")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0f, 0.3f)
|
||||
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, -1f)
|
||||
|
||||
oa2.start()
|
||||
oa3.apply {
|
||||
oa3.addListener(onEnd = {
|
||||
networkErrorLayout?.visibility = View.GONE
|
||||
})
|
||||
start()
|
||||
}
|
||||
} else {
|
||||
if (variant == "nonroot") {
|
||||
view?.findViewById<MaterialButton>(R.id.microg_installbtn)?.visibility = View.INVISIBLE
|
||||
}
|
||||
|
||||
vancedinstallbtn?.visibility = View.INVISIBLE
|
||||
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", -1f, 0.3f)
|
||||
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, 0f)
|
||||
|
||||
oa2.apply {
|
||||
oa2.addListener(onStart = {
|
||||
networkErrorLayout?.visibility = View.VISIBLE
|
||||
})
|
||||
start()
|
||||
}
|
||||
oa3.start()
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
val viewModel: HomeViewModel by viewModels()
|
||||
|
|
|
@ -4,7 +4,9 @@ import android.app.Application
|
|||
import android.content.ActivityNotFoundException
|
||||
import android.content.ComponentName
|
||||
import android.content.Intent
|
||||
import android.graphics.drawable.Drawable
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import android.widget.Toast
|
||||
import androidx.browser.customtabs.CustomTabsIntent
|
||||
import androidx.core.content.ContextCompat
|
||||
|
@ -12,19 +14,26 @@ import androidx.core.content.ContextCompat.startActivity
|
|||
import androidx.lifecycle.AndroidViewModel
|
||||
import androidx.lifecycle.MutableLiveData
|
||||
import androidx.preference.PreferenceManager.getDefaultSharedPreferences
|
||||
import com.dezlum.codelabs.getjson.GetJson
|
||||
import com.vanced.manager.R
|
||||
import com.vanced.manager.utils.InternetTools.displayJsonInt
|
||||
import com.vanced.manager.utils.InternetTools.displayJsonString
|
||||
import com.vanced.manager.utils.PackageHelper.isPackageInstalled
|
||||
|
||||
class HomeViewModel(application: Application): AndroidViewModel(application) {
|
||||
|
||||
private val variant = getDefaultSharedPreferences(application).getString("vanced_variant", "nonroot")
|
||||
private val connected: Boolean = GetJson().isConnected(application)
|
||||
|
||||
private val vancedPkgName: String =
|
||||
if (getDefaultSharedPreferences(application).getString("vanced_variant", "nonroot") == "root") {
|
||||
if (variant== "root") {
|
||||
"com.google.android.youtube"
|
||||
} else {
|
||||
"com.vanced.android.youtube"
|
||||
}
|
||||
|
||||
private val pm = application.packageManager
|
||||
|
||||
val microgInstalled: Boolean = isPackageInstalled("com.mgoogle.android.gms", application.packageManager)
|
||||
val vancedInstalled: Boolean = isPackageInstalled(vancedPkgName, application.packageManager)
|
||||
|
||||
|
@ -34,7 +43,19 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
|
|||
val vancedVersion: MutableLiveData<String> = MutableLiveData()
|
||||
val microgVersion: MutableLiveData<String> = MutableLiveData()
|
||||
|
||||
val isNonrootModeSelected: Boolean = getDefaultSharedPreferences(application).getString("vanced_variant", "nonroot") == "nonroot"
|
||||
private val vancedInstalledVersionCode = getPkgVerCode(vancedInstalled, vancedPkgName)
|
||||
private val microgInstalledVersionCode = getPkgVerCode(microgInstalled, "com.mgoogle.android.gms")
|
||||
|
||||
private val vancedVersionCode = displayJsonInt("vanced.json", "versionCode", application)
|
||||
private val microgVersionCode = displayJsonInt("microg.json", "versionCode", application)
|
||||
|
||||
val vancedInstallButtonTxt = compareInt(vancedInstalledVersionCode, vancedVersionCode, application)
|
||||
val microgInstallButtonTxt = compareInt(microgInstalledVersionCode, microgVersionCode, application)
|
||||
|
||||
val vancedInstallButtonIcon = compareIntDrawable(vancedInstalledVersionCode, vancedVersionCode, application)
|
||||
val microgInstallButtonIcon = compareIntDrawable(microgInstalledVersionCode, microgVersionCode, application)
|
||||
|
||||
val nonrootModeSelected: Boolean = variant == "nonroot"
|
||||
|
||||
private val signatureString = application.getString(R.string.unavailable)
|
||||
val signatureStatusTxt: MutableLiveData<String> = MutableLiveData()
|
||||
|
@ -74,12 +95,40 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
|
|||
|
||||
private fun getPkgInfo(toCheck: Boolean, pkg: String, application: Application): String {
|
||||
return if (toCheck) {
|
||||
application.packageManager.getPackageInfo(pkg, 0).versionName
|
||||
pm.getPackageInfo(pkg, 0).versionName
|
||||
} else {
|
||||
application.getString(R.string.unavailable)
|
||||
}
|
||||
}
|
||||
|
||||
private fun getPkgVerCode(toCheck: Boolean, pkg: String): Int {
|
||||
return if (toCheck) {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P)
|
||||
pm.getPackageInfo(pkg, 0).longVersionCode.and(0xFFFFFFFF).toInt()
|
||||
else
|
||||
pm.getPackageInfo(pkg, 0).versionCode
|
||||
} else 0
|
||||
}
|
||||
|
||||
private fun compareInt(int1: Int, int2: Int, application: Application): String {
|
||||
return if (connected)
|
||||
when {
|
||||
int1 > int2 -> application.getString(R.string.update)
|
||||
int2 == int1 -> application.getString(R.string.button_installed)
|
||||
else -> application.getString(R.string.install)
|
||||
} else application.getString(R.string.install)
|
||||
}
|
||||
|
||||
private fun compareIntDrawable(int1: Int, int2: Int, application: Application): Drawable? {
|
||||
return if (connected)
|
||||
when {
|
||||
int1 > int2 -> application.getDrawable(R.drawable.ic_cloud_upload_black_24dp)
|
||||
int2 == int1 -> application.getDrawable(R.drawable.outline_cloud_done_24)
|
||||
else -> application.getDrawable(R.drawable.outline_cloud_download_24)
|
||||
} else application.getDrawable(R.drawable.outline_cloud_download_24)
|
||||
|
||||
}
|
||||
|
||||
init {
|
||||
signatureStatusTxt.value = signatureString
|
||||
vancedVersion.value = displayJsonString("vanced.json","version", application)
|
||||
|
@ -89,4 +138,5 @@ class HomeViewModel(application: Application): AndroidViewModel(application) {
|
|||
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -32,11 +32,13 @@ object InternetTools {
|
|||
}
|
||||
|
||||
fun displayJsonInt(json: String, obj: String, context: Context): Int {
|
||||
return try {
|
||||
return if (GetJson().isConnected(context)) {
|
||||
try {
|
||||
GetJson().AsJSONObject("https://vanced.app/api/v1/$json").get(obj).asInt
|
||||
} catch (e: IllegalStateException) {
|
||||
GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/$json").get(obj).asInt
|
||||
}
|
||||
} else 0
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -26,22 +26,11 @@
|
|||
android:layout_marginTop="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/home_network_wrapper"
|
||||
layout="@layout/include_network_error"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<Spinner
|
||||
android:id="@+id/home_variant_selector"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="@dimen/eightdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tablayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?colorSurfaceVariant"
|
||||
app:tabIndicatorColor="?colorPrimary"
|
||||
app:tabSelectedTextColor="?colorPrimary"
|
||||
app:tabTextColor="?colorPrimary"
|
||||
app:layout_constraintTop_toBottomOf="parent" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
|
@ -1,46 +1,12 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
style="@style/MaterialCard"
|
||||
<com.alespero.expandablecardview.ExpandableCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
app:contentPaddingTop="2dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
style="@style/CardTitle"
|
||||
android:id="@+id/changelog_text"
|
||||
android:text="@string/changelogs" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.google.android.material.tabs.TabLayout
|
||||
android:id="@+id/tablayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?colorSurfaceVariant"
|
||||
app:tabIndicatorColor="?colorPrimary"
|
||||
app:tabSelectedTextColor="?colorPrimary"
|
||||
app:tabTextColor="?colorPrimary"
|
||||
app:layout_constraintTop_toBottomOf="@id/changelog_text" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewpager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
app:title="@string/changelogs"
|
||||
app:contentPaddingTop="2dp"
|
||||
app:expandOnClick="true"
|
||||
app:inner_view="@layout/include_changelog_pages"
|
||||
android:background="?colorSurface"/>
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/microg_installbtn"
|
||||
style="@style/ButtonStyle"
|
||||
android:text="@string/install"
|
||||
app:icon="@drawable/outline_cloud_download_24"
|
||||
android:text="@{viewModel.microgInstallButtonTxt}"
|
||||
app:icon="@{viewModel.microgInstallButtonIcon}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toTopOf="@id/microg_uninstallbtn" />
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.vanced.manager.ui.core.SlidingCardView
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
style="@style/MaterialCard">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/network_error"
|
||||
android:fontFamily="@font/exo_semibold"
|
||||
android:textColor="?attr/colorError"
|
||||
android:textSize="18sp"
|
||||
android:gravity="center" />
|
||||
|
||||
</com.vanced.manager.ui.core.SlidingCardView>
|
|
@ -31,12 +31,6 @@
|
|||
android:orientation="vertical"
|
||||
android:layout_marginTop="2dp">
|
||||
|
||||
<include
|
||||
layout="@layout/include_vanced_medias"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
bind:viewModel="@{viewModel}"/>
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
style="@style/LinkButtonStyle"
|
||||
android:id="@+id/brave_button"
|
||||
|
@ -52,6 +46,12 @@
|
|||
app:cornerRadius="@dimen/eightdp"
|
||||
android:onClick='@{()-> viewModel.openUrl("https://vanced.app")}'/>
|
||||
|
||||
<include
|
||||
layout="@layout/include_vanced_medias"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
bind:viewModel="@{viewModel}"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
|
@ -46,10 +46,10 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/vanced_installbtn"
|
||||
style="@style/ButtonStyle"
|
||||
android:text="@string/install"
|
||||
android:text="@{viewModel.vancedInstallButtonTxt}"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:icon="@drawable/outline_cloud_download_24" />
|
||||
app:icon="@{viewModel.vancedInstallButtonIcon}" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/vanced_title_buttons_barrier"
|
||||
|
|
Loading…
Reference in New Issue