0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-30 06:53:01 +00:00

revert all changes

This commit is contained in:
X1nto 2020-05-17 12:46:42 +04:00
parent b6ea249dd7
commit f81bb2f0e6
4 changed files with 159 additions and 195 deletions

View file

@ -46,7 +46,7 @@ open class Home : BaseFragment() {
openUrl("https://youtu.be/dQw4w9WgXcQ", R.color.YT) openUrl("https://youtu.be/dQw4w9WgXcQ", R.color.YT)
} }
/*val microgVerText = view.findViewById<TextView>(R.id.microg_installed_version) val microgVerText = view.findViewById<TextView>(R.id.microg_installed_version)
if (microgStatus!!) { if (microgStatus!!) {
val microgVer = pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName val microgVer = pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName
microguninstallbtn.setOnClickListener { microguninstallbtn.setOnClickListener {
@ -68,9 +68,9 @@ open class Home : BaseFragment() {
microgsettingsbtn.visibility = View.INVISIBLE microgsettingsbtn.visibility = View.INVISIBLE
microguninstallbtn.visibility = View.INVISIBLE microguninstallbtn.visibility = View.INVISIBLE
microgVerText.text = getString(R.string.unavailable) microgVerText.text = getString(R.string.unavailable)
}*/ }
/*val vancedVerText = view.findViewById<TextView>(R.id.vanced_installed_version) val vancedVerText = view.findViewById<TextView>(R.id.vanced_installed_version)
if (vancedStatus!!) { if (vancedStatus!!) {
val vancedVer = pm.getPackageInfo("com.vanced.android.youtube", 0).versionName val vancedVer = pm.getPackageInfo("com.vanced.android.youtube", 0).versionName
vanceduninstallbtn.setOnClickListener { vanceduninstallbtn.setOnClickListener {
@ -82,7 +82,7 @@ open class Home : BaseFragment() {
} else { } else {
vanceduninstallbtn.visibility = View.INVISIBLE vanceduninstallbtn.visibility = View.INVISIBLE
vancedVerText.text = getString(R.string.unavailable) vancedVerText.text = getString(R.string.unavailable)
}*/ }
bravebtn.setOnClickListener { bravebtn.setOnClickListener {
openUrl("https://brave.com/van874", R.color.Brave) openUrl("https://brave.com/van874", R.color.Brave)

View file

@ -3,7 +3,6 @@ package com.vanced.manager.ui.fragments
import android.app.Activity import android.app.Activity
import android.content.pm.PackageManager import android.content.pm.PackageManager
import androidx.lifecycle.ViewModel import androidx.lifecycle.ViewModel
import com.vanced.manager.R
class HomeViewModel { class HomeViewModel {
@ -23,8 +22,6 @@ class HomeViewModel {
} }
val microgInstalledTxt: String? = pm?.getPackageInfo("com.mgoogle.android.gms", 0)?.versionName val microgInstalledTxt: String? = pm?.getPackageInfo("com.mgoogle.android.gms", 0)?.versionName
val vancedInstalledTxt: String? = pm?.getPackageInfo("com.vanced.android.youtube", 0)?.versionName.toString() val vancedInstalledTxt: String? = pm?.getPackageInfo("com.vanced.android.youtube", 0)?.versionName
} }

View file

@ -1,121 +1,103 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout <com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" style="@style/MaterialCard">
tools:ignore="ContentDescription, KeyboardInaccessibleWidget">
<data> <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<import type="android.view.View" /> <ImageView
android:id="@+id/home_microg_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_microg"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/microg_title_buttons_barrier" />
<variable <TextView
name="viewModel" style="@style/TextAppTitle"
type="com.vanced.manager.ui.fragments.HomeViewModel" /> android:id="@+id/microg_title"
android:text="@string/microg"
app:layout_constraintStart_toEndOf="@id/home_microg_logo"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/microg_title_buttons_barrier" />
</data> <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"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/microg_uninstallbtn" />
<com.google.android.material.card.MaterialCardView <androidx.constraintlayout.widget.Barrier
style="@style/MaterialCard"> android:id="@+id/microg_title_buttons_barrier"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="microg_title, microg_installbtn"/>
<ImageView <LinearLayout
android:id="@+id/home_microg_logo" android:id="@+id/microg_remote_latest_version"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_microg" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@+id/microg_title_buttons_barrier"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintBottom_toTopOf="@id/linearLayout2">
app:layout_constraintBottom_toTopOf="@id/microg_title_buttons_barrier" />
<TextView <TextView
style="@style/TextAppTitle" style="@style/AppVer"
android:id="@+id/microg_title" android:id="@+id/microg_latest"
android:text="@string/microg" android:text="@string/latest" />
app:layout_constraintStart_toEndOf="@id/home_microg_logo"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/microg_title_buttons_barrier" />
<com.google.android.material.button.MaterialButton <TextView
android:id="@+id/microg_installbtn" style="@style/AppVer.Bold"
style="@style/ButtonStyle" android:id="@+id/microg_latest_version"
android:text="@string/install" android:text="@string/loading" />
app:icon="@drawable/outline_cloud_download_24"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/microg_uninstallbtn" />
<androidx.constraintlayout.widget.Barrier </LinearLayout>
android:id="@+id/microg_title_buttons_barrier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="microg_title, microg_installbtn"/>
<LinearLayout <LinearLayout
android:id="@+id/microg_remote_latest_version" android:id="@+id/linearLayout2"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/microg_title_buttons_barrier" app:layout_constraintTop_toBottomOf="@id/microg_remote_latest_version"
app:layout_constraintBottom_toTopOf="@id/linearLayout2"> app:layout_constraintBottom_toBottomOf="parent">
<TextView <TextView
style="@style/AppVer" style="@style/AppVer"
android:id="@+id/microg_latest" android:id="@+id/microg_installed"
android:text="@string/latest" /> android:text="@string/installed" />
<TextView <TextView
style="@style/AppVer.Bold" style="@style/AppVer.Bold"
android:id="@+id/microg_latest_version" android:id="@+id/microg_installed_version"
android:text="@string/loading" /> android:text="@string/loading" />
</LinearLayout> </LinearLayout>
<LinearLayout <ImageView
android:id="@+id/linearLayout2" style="@style/ClickableImageWidget"
android:layout_width="wrap_content" android:id="@+id/microg_settingsbtn"
android:layout_height="wrap_content" app:srcCompat="@drawable/ic_microg_settings"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/microg_remote_latest_version" app:layout_constraintEnd_toStartOf="@id/microg_uninstallbtn"
app:layout_constraintBottom_toBottomOf="parent"> app:layout_constraintTop_toBottomOf="@id/microg_title_buttons_barrier"
android:layout_marginEnd="4dp"/>
<TextView <ImageView
style="@style/AppVer" style="@style/ClickableImageWidget.Red"
android:id="@+id/microg_installed" android:id="@+id/microg_uninstallbtn"
android:text="@string/installed" /> app:srcCompat="@drawable/ic_delete_black_24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/microg_title_buttons_barrier" />
<TextView </androidx.constraintlayout.widget.ConstraintLayout>
style="@style/AppVer.Bold"
android:id="@+id/microg_installed_version"
android:text="@{viewModel.microgStatus ? viewModel.microgInstalledTxt : @string/unavailable}" />
</LinearLayout> </com.google.android.material.card.MaterialCardView>
<ImageView
style="@style/ClickableImageWidget"
android:id="@+id/microg_settingsbtn"
app:srcCompat="@drawable/ic_microg_settings"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/microg_uninstallbtn"
app:layout_constraintTop_toBottomOf="@id/microg_title_buttons_barrier"
android:layout_marginEnd="4dp"
android:visibility="@{viewModel.microgStatus ? View.VISIBLE : View.GONE}"/>
<ImageView
style="@style/ClickableImageWidget.Red"
android:id="@+id/microg_uninstallbtn"
app:srcCompat="@drawable/ic_delete_black_24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/microg_title_buttons_barrier"
android:visibility="@{viewModel.microgStatus ? View.VISIBLE : View.GONE}"/>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</layout>

View file

@ -1,111 +1,96 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<layout <com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
style="@style/MaterialCard"
tools:ignore="ContentDescription, KeyboardInaccessibleWidget"> tools:ignore="ContentDescription, KeyboardInaccessibleWidget">
<data> <androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<import type="android.view.View" /> <ImageView
android:id="@+id/home_vanced_logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:srcCompat="@drawable/ic_vanced"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/vanced_title_buttons_barrier" />
<variable <TextView
name="viewModel" style="@style/TextAppTitle"
type="com.vanced.manager.ui.fragments.HomeViewModel" /> android:id="@+id/vanced_title"
android:text="@string/vanced"
app:layout_constraintStart_toEndOf="@id/home_vanced_logo"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/vanced_title_buttons_barrier" />
</data> <com.google.android.material.button.MaterialButton
android:id="@+id/vanced_installbtn"
style="@style/ButtonStyle"
android:text="@string/install"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:icon="@drawable/outline_cloud_download_24" />
<com.google.android.material.card.MaterialCardView <androidx.constraintlayout.widget.Barrier
style="@style/MaterialCard"> android:id="@+id/vanced_title_buttons_barrier"
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="home_vanced_logo, vanced_title, vanced_installbtn"/>
<ImageView <ImageView
android:id="@+id/home_vanced_logo" style="@style/ClickableImageWidget.Red"
android:layout_width="wrap_content" android:id="@+id/vanced_uninstallbtn"
android:layout_height="wrap_content" app:layout_constraintEnd_toEndOf="parent"
app:srcCompat="@drawable/ic_vanced" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/vanced_title_buttons_barrier"
app:layout_constraintTop_toTopOf="parent" app:srcCompat="@drawable/ic_delete_black_24dp" />
app:layout_constraintBottom_toTopOf="@id/vanced_title_buttons_barrier"
android:visibility="@{viewModel.vancedStatus ? View.VISIBLE : View.GONE}"/> <LinearLayout
android:id="@+id/vanced_remote_latest_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/linearLayout2"
app:layout_constraintTop_toBottomOf="@+id/vanced_title_buttons_barrier">
<TextView <TextView
style="@style/TextAppTitle" style="@style/AppVer"
android:id="@+id/vanced_title" android:id="@+id/vanced_latest"
android:text="@string/vanced" android:text="@string/latest" />
app:layout_constraintStart_toEndOf="@id/home_vanced_logo"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toTopOf="@id/vanced_title_buttons_barrier" />
<com.google.android.material.button.MaterialButton <TextView
android:id="@+id/vanced_installbtn" style="@style/AppVer.Bold"
style="@style/ButtonStyle" android:id="@+id/vanced_latest_version"
android:text="@string/install" android:text="@string/loading" />
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:icon="@drawable/outline_cloud_download_24" />
<androidx.constraintlayout.widget.Barrier </LinearLayout>
android:id="@+id/vanced_title_buttons_barrier"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:barrierDirection="bottom"
app:constraint_referenced_ids="home_vanced_logo, vanced_title, vanced_installbtn"/>
<ImageView <LinearLayout
style="@style/ClickableImageWidget.Red" android:id="@+id/linearLayout2"
android:id="@+id/vanced_uninstallbtn" android:layout_width="wrap_content"
app:layout_constraintEnd_toEndOf="parent" android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vanced_title_buttons_barrier" app:layout_constraintTop_toBottomOf="@id/vanced_remote_latest_version">
app:srcCompat="@drawable/ic_delete_black_24dp" />
<LinearLayout <TextView
android:id="@+id/vanced_remote_latest_version" style="@style/AppVer"
android:layout_width="wrap_content" android:id="@+id/vanced_installed"
android:layout_height="wrap_content" android:text="@string/installed" />
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toTopOf="@id/linearLayout2"
app:layout_constraintTop_toBottomOf="@+id/vanced_title_buttons_barrier">
<TextView <TextView
style="@style/AppVer" style="@style/AppVer.Bold"
android:id="@+id/vanced_latest" android:id="@+id/vanced_installed_version"
android:text="@string/latest" /> android:text="@string/loading" />
<TextView </LinearLayout>
style="@style/AppVer.Bold"
android:id="@+id/vanced_latest_version"
android:text="@string/loading" />
</LinearLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout </com.google.android.material.card.MaterialCardView>
android:id="@+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/vanced_remote_latest_version">
<TextView
style="@style/AppVer"
android:id="@+id/vanced_installed"
android:text="@string/installed" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/vanced_installed_version"
android:text="@{viewModel.vancedStatus ? viewModel.vancedInstalledTxt : @string/unavailable}" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</com.google.android.material.card.MaterialCardView>
</layout>