0
0
Fork 0
mirror of https://github.com/YTVanced/VancedManager synced 2024-11-26 21:13: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)
}
/*val microgVerText = view.findViewById<TextView>(R.id.microg_installed_version)
val microgVerText = view.findViewById<TextView>(R.id.microg_installed_version)
if (microgStatus!!) {
val microgVer = pm.getPackageInfo("com.mgoogle.android.gms", 0).versionName
microguninstallbtn.setOnClickListener {
@ -68,9 +68,9 @@ open class Home : BaseFragment() {
microgsettingsbtn.visibility = View.INVISIBLE
microguninstallbtn.visibility = View.INVISIBLE
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!!) {
val vancedVer = pm.getPackageInfo("com.vanced.android.youtube", 0).versionName
vanceduninstallbtn.setOnClickListener {
@ -82,7 +82,7 @@ open class Home : BaseFragment() {
} else {
vanceduninstallbtn.visibility = View.INVISIBLE
vancedVerText.text = getString(R.string.unavailable)
}*/
}
bravebtn.setOnClickListener {
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.content.pm.PackageManager
import androidx.lifecycle.ViewModel
import com.vanced.manager.R
class HomeViewModel {
@ -23,8 +22,6 @@ class HomeViewModel {
}
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"?>
<layout
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
tools:ignore="ContentDescription, KeyboardInaccessibleWidget">
style="@style/MaterialCard">
<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
name="viewModel"
type="com.vanced.manager.ui.fragments.HomeViewModel" />
<TextView
style="@style/TextAppTitle"
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
style="@style/MaterialCard">
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.Barrier
android:id="@+id/microg_title_buttons_barrier"
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
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" />
<LinearLayout
android:id="@+id/microg_remote_latest_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/microg_title_buttons_barrier"
app:layout_constraintBottom_toTopOf="@id/linearLayout2">
<TextView
style="@style/TextAppTitle"
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" />
style="@style/AppVer"
android:id="@+id/microg_latest"
android:text="@string/latest" />
<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" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/microg_latest_version"
android:text="@string/loading" />
<androidx.constraintlayout.widget.Barrier
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:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/microg_title_buttons_barrier"
app:layout_constraintBottom_toTopOf="@id/linearLayout2">
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/microg_remote_latest_version"
app:layout_constraintBottom_toBottomOf="parent">
<TextView
style="@style/AppVer"
android:id="@+id/microg_latest"
android:text="@string/latest" />
<TextView
style="@style/AppVer"
android:id="@+id/microg_installed"
android:text="@string/installed" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/microg_latest_version"
android:text="@string/loading" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/microg_installed_version"
android:text="@string/loading" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/microg_remote_latest_version"
app:layout_constraintBottom_toBottomOf="parent">
<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"/>
<TextView
style="@style/AppVer"
android:id="@+id/microg_installed"
android:text="@string/installed" />
<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" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/microg_installed_version"
android:text="@{viewModel.microgStatus ? viewModel.microgInstalledTxt : @string/unavailable}" />
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
<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>
</com.google.android.material.card.MaterialCardView>

View file

@ -1,111 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<layout
<com.google.android.material.card.MaterialCardView
xmlns:android="http://schemas.android.com/apk/res/android"
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="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
name="viewModel"
type="com.vanced.manager.ui.fragments.HomeViewModel" />
<TextView
style="@style/TextAppTitle"
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
style="@style/MaterialCard">
<androidx.constraintlayout.widget.ConstraintLayout
<androidx.constraintlayout.widget.Barrier
android:id="@+id/vanced_title_buttons_barrier"
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
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"
android:visibility="@{viewModel.vancedStatus ? View.VISIBLE : View.GONE}"/>
<ImageView
style="@style/ClickableImageWidget.Red"
android:id="@+id/vanced_uninstallbtn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/vanced_title_buttons_barrier"
app:srcCompat="@drawable/ic_delete_black_24dp" />
<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
style="@style/TextAppTitle"
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" />
style="@style/AppVer"
android:id="@+id/vanced_latest"
android:text="@string/latest" />
<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" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/vanced_latest_version"
android:text="@string/loading" />
<androidx.constraintlayout.widget.Barrier
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"/>
</LinearLayout>
<ImageView
style="@style/ClickableImageWidget.Red"
android:id="@+id/vanced_uninstallbtn"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@id/vanced_title_buttons_barrier"
app:srcCompat="@drawable/ic_delete_black_24dp" />
<LinearLayout
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">
<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
style="@style/AppVer"
android:id="@+id/vanced_installed"
android:text="@string/installed" />
<TextView
style="@style/AppVer"
android:id="@+id/vanced_latest"
android:text="@string/latest" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/vanced_installed_version"
android:text="@string/loading" />
<TextView
style="@style/AppVer.Bold"
android:id="@+id/vanced_latest_version"
android:text="@string/loading" />
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
<LinearLayout
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>
</com.google.android.material.card.MaterialCardView>
</layout>