fixed app crash on installation

This commit is contained in:
X1nto 2020-05-23 21:54:00 +04:00
parent a788ee1ab5
commit 04cd178047
4 changed files with 4 additions and 31 deletions

View File

@ -52,7 +52,7 @@ open class Home : BaseFragment() {
val microgStatus = pm?.let { isPackageInstalled("com.mgoogle.android.gms", it) }
val vancedStatus = pm?.let { isPackageInstalled("com.vanced.android.youtube", it) }
/*val vancedLatestTxt = view.findViewById<TextView>(R.id.vanced_latest_version)
val vancedLatestTxt = view.findViewById<TextView>(R.id.vanced_latest_version)
val microgLatestTxt = view.findViewById<TextView>(R.id.microg_latest_version)
if (GetJson().isConnected(requireContext())) {
@ -64,7 +64,7 @@ open class Home : BaseFragment() {
} else {
vancedLatestTxt.text = getString(R.string.unavailable)
microgLatestTxt.text = getString(R.string.unavailable)
}*/
}
vancedinstallbtn.setOnClickListener {
view.findNavController().navigate(R.id.toInstallThemeFragment)

View File

@ -17,7 +17,7 @@ open class ThemeInstall : BaseFragment() {
val nextButton = view.findViewById<Button>(R.id.vanced_next_to_variant)
val loadBar = view.findViewById<ProgressBar>(R.id.vantheme_progress)
val themeGroup = view.findViewById<RadioGroup>(R.id.lang_radiogroup)
val themeGroup = view.findViewById<RadioGroup>(R.id.theme_radiogroup)
val selectedThemeId = themeGroup.checkedRadioButtonId
nextButton.setOnClickListener {

View File

@ -84,23 +84,8 @@ class HomeFragment : Home() {
override fun onAvailable(network: Network) {
super.onAvailable(network)
val microginstallbtn = view?.findViewById<Button>(R.id.microg_installbtn)
val vancedinstallbtn = view?.findViewById<Button>(R.id.vanced_installbtn)
val microgLatestTxt = view?.findViewById<TextView>(R.id.microg_latest_version)
val vancedLatestTxt = view?.findViewById<TextView>(R.id.vanced_latest_version)
val vancedVer: JsonObject = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/vanced.json")
val microgVer: JsonObject = GetJson().AsJSONObject("https://x1nto.github.io/VancedFiles/microg.json")
activity?.runOnUiThread {
microginstallbtn?.visibility = View.VISIBLE
vancedinstallbtn?.visibility = View.VISIBLE
vancedLatestTxt?.text = vancedVer.get("version").asString
microgLatestTxt?.text = microgVer.get("version").asString
val networkErrorLayout = view?.findViewById<MaterialCardView>(R.id.home_network_wrapper)
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0f, 0.3f)
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, -1f)
@ -122,12 +107,6 @@ class HomeFragment : Home() {
private fun netUnavailable() {
val microginstallbtn = view?.findViewById<Button>(R.id.microg_installbtn)
val vancedinstallbtn = view?.findViewById<Button>(R.id.vanced_installbtn)
val vancedLatestTxt = view?.findViewById<TextView>(R.id.vanced_latest_version)
val microgLatestTxt = view?.findViewById<TextView>(R.id.microg_latest_version)
if (GetJson().isConnected(requireContext())) {
val networkErrorLayout = view?.findViewById<MaterialCardView>(R.id.home_network_wrapper)
@ -135,12 +114,6 @@ class HomeFragment : Home() {
activity?.runOnUiThread {
microginstallbtn?.visibility = View.GONE
vancedinstallbtn?.visibility = View.GONE
vancedLatestTxt?.text = getString(R.string.unavailable)
microgLatestTxt?.text = getString(R.string.unavailable)
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", -1f, 0.3f)
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, 0f)

View File

@ -21,7 +21,7 @@
android:text="@string/choose_preferred_theme" />
<RadioGroup
android:id="@+id/vanced_theme_buttons"
android:id="@+id/theme_radiogroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checkedButton="@id/dark">