tiny fixes

This commit is contained in:
X1nto 2020-08-08 19:02:10 +04:00
parent 07263e19f1
commit 68213c8556
3 changed files with 24 additions and 27 deletions

View File

@ -104,29 +104,34 @@ class HomeFragment : Fragment(), View.OnClickListener {
when (v?.id) {
R.id.vanced_installbtn -> {
if (!isInstallationRunning(requireActivity())) {
if (variant == "nonroot" && !viewModel.microgInstalled.get()!!) {
Snackbar.make(binding.homeRefresh, R.string.no_microg, Snackbar.LENGTH_LONG)
.setAction(R.string.install) {
if (!viewModel.fetching.get()!!) {
if (variant == "nonroot" && !viewModel.microgInstalled.get()!!) {
Snackbar.make(
binding.homeRefresh,
R.string.no_microg,
Snackbar.LENGTH_LONG
)
.setAction(R.string.install) {
requireActivity().startService(
Intent(
requireActivity(),
MicrogDownloadService::class.java
)
)
}.show()
} else {
if (prefs?.getBoolean("valuesModified", false)!!) {
requireActivity().startService(
Intent(
requireActivity(),
MicrogDownloadService::class.java
VancedDownloadService::class.java
)
)
}.show()
} else {
if (prefs?.getBoolean("valuesModified", false)!!) {
requireActivity().startService(
Intent(
requireActivity(),
VancedDownloadService::class.java
)
)
} else {
view?.findNavController()?.navigate(R.id.toInstallThemeFragment)
} else {
view?.findNavController()?.navigate(R.id.toInstallThemeFragment)
}
}
}
} else
Toast.makeText(requireActivity(), R.string.installation_wait, Toast.LENGTH_SHORT)

View File

@ -75,7 +75,7 @@ open class HomeViewModel(application: Application): AndroidViewModel(application
microgInstalled.set(isPackageInstalled("com.mgoogle.android.gms", pm))
vancedInstalled.set(isPackageInstalled(vancedPkgName, pm))
vancedInstalledVersion.set(getPkgInfo(vancedInstalled.get()!!, vancedPkgName, getApplication()))
microgInstalledVersion.set(getPkgInfo(microgInstalled.get()!!, "com.mgoogle.android.gms", getApplication()))
microgInstalledVersion.set(getPkgInfo(microgInstalled.get()!!, "com.mgoogle.android.gms", getApplication()).removeSuffix("-vanced"))
vancedVersionCode.set(getJsonInt("vanced.json", "versionCode", getApplication()))
microgVersionCode.set(getJsonInt("microg.json", "versionCode", getApplication()))
vancedInstalledVersionCode.set(getPkgVerCode(vancedInstalled.get()!!, vancedPkgName))
@ -167,6 +167,7 @@ open class HomeViewModel(application: Application): AndroidViewModel(application
}
init {
fetching.set(false)
fetchData()
}

View File

@ -10,15 +10,6 @@
android:id="@+id/vanced_changelog"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textSize="16sp"
android:text="Removed:\n
- Auto subtitles (has been replaced with live captions)\n
- minimised video player style (Google removed it) \n
- auto repeat (might be fixed later) \n
- accessibility seek buttons (might be fixed later) \n\nChanged:\n
- Whatever Youtube fixed over 9 months :P \n
- some small bugs \n
- Installation now with SAI"
tools:ignore="HardcodedText" />
android:textSize="16sp" />
</FrameLayout>