mirror of
https://github.com/YTVanced/VancedManager
synced 2024-11-30 06:53:01 +00:00
fixed uninstall button
This commit is contained in:
parent
87b563b891
commit
f4e7ac4f25
3 changed files with 64 additions and 40 deletions
|
@ -66,7 +66,7 @@ open class Home : BaseFragment() {
|
|||
}
|
||||
|
||||
if (vancedStatus!!) {
|
||||
microguninstallbtn.setOnClickListener {
|
||||
vanceduninstallbtn.setOnClickListener {
|
||||
val uri = Uri.parse("package:com.vanced.android.youtube")
|
||||
val vanUninstall = Intent(Intent.ACTION_DELETE, uri)
|
||||
startActivity(vanUninstall)
|
||||
|
|
|
@ -8,6 +8,7 @@ import android.net.NetworkCapabilities
|
|||
import android.net.NetworkRequest
|
||||
import android.os.Bundle
|
||||
import android.view.*
|
||||
import android.widget.LinearLayout
|
||||
import androidx.core.animation.addListener
|
||||
import androidx.viewpager2.widget.ViewPager2
|
||||
import com.google.android.material.card.MaterialCardView
|
||||
|
@ -65,18 +66,25 @@ class HomeFragment : Home() {
|
|||
activity?.runOnUiThread {
|
||||
|
||||
val networkErrorLayout = view?.findViewById<MaterialCardView>(R.id.home_network_wrapper)
|
||||
val oa1 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", -1f, 0.3f)
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, 0f)
|
||||
val mainLayout = view?.findViewById<LinearLayout>(R.id.home_main_wrapper)
|
||||
val oa0 = ObjectAnimator.ofFloat(mainLayout, "yFraction", 0f, 0.3f)
|
||||
val oa1 = ObjectAnimator.ofFloat(mainLayout, "yFraction", 0.3f, 0f)
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", -1f, 0.3f)
|
||||
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, 0f)
|
||||
|
||||
|
||||
oa1.apply {
|
||||
oa1.addListener(onStart = {
|
||||
oa2.apply {
|
||||
oa2.addListener(onStart = {
|
||||
networkErrorLayout?.visibility = View.VISIBLE
|
||||
oa0.start()
|
||||
}
|
||||
)
|
||||
oa2.addListener(onEnd = {
|
||||
oa1.start()
|
||||
})
|
||||
start()
|
||||
}
|
||||
oa2.start()
|
||||
oa3.start()
|
||||
|
||||
}
|
||||
|
||||
|
@ -88,12 +96,20 @@ class HomeFragment : Home() {
|
|||
activity?.runOnUiThread {
|
||||
|
||||
val networkErrorLayout = view?.findViewById<MaterialCardView>(R.id.home_network_wrapper)
|
||||
val oa1 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0f, 0.3f)
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, -1f)
|
||||
val mainLayout = view?.findViewById<LinearLayout>(R.id.home_main_wrapper)
|
||||
val oa0 = ObjectAnimator.ofFloat(mainLayout, "yFraction", 0f, 0.3f)
|
||||
val oa1 = ObjectAnimator.ofFloat(mainLayout, "yFraction", 0.3f, 0f)
|
||||
val oa2 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0f, 0.3f)
|
||||
val oa3 = ObjectAnimator.ofFloat(networkErrorLayout, "yFraction", 0.3f, -1f)
|
||||
|
||||
oa1.start()
|
||||
oa2.apply {
|
||||
oa2.addListener(onEnd = {
|
||||
oa2.start()
|
||||
oa3.apply {
|
||||
oa3.addListener(onStart = {
|
||||
oa0.start()
|
||||
})
|
||||
|
||||
oa3.addListener(onEnd = {
|
||||
oa1.start()
|
||||
networkErrorLayout?.visibility = View.GONE
|
||||
}
|
||||
)
|
||||
|
|
|
@ -26,42 +26,50 @@
|
|||
android:visibility="gone"
|
||||
tools:visibility="visible"/>
|
||||
|
||||
<include
|
||||
android:id="@+id/home_vanced_wrapper"
|
||||
layout="@layout/include_vanced"
|
||||
<LinearLayout
|
||||
android:id="@+id/home_main_wrapper"
|
||||
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:orientation="vertical">
|
||||
|
||||
<include
|
||||
android:id="@+id/home_microg_wrapper"
|
||||
layout="@layout/include_microg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginTop="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
<include
|
||||
android:id="@+id/home_vanced_wrapper"
|
||||
layout="@layout/include_vanced"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
|
||||
<include
|
||||
android:id="@+id/home_changelog_wrapper"
|
||||
layout="@layout/include_changelogs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginTop="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
<include
|
||||
android:id="@+id/home_microg_wrapper"
|
||||
layout="@layout/include_microg"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginTop="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
|
||||
<include
|
||||
android:id="@+id/home_changelog_wrapper"
|
||||
layout="@layout/include_changelogs"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginTop="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
|
||||
|
||||
<include
|
||||
android:id="@+id/home_useful_links_wrapper"
|
||||
layout="@layout/include_useful_links"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginTop="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
<include
|
||||
android:id="@+id/home_useful_links_wrapper"
|
||||
layout="@layout/include_useful_links"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/stdp"
|
||||
android:layout_marginTop="@dimen/stdp"
|
||||
android:layout_marginEnd="@dimen/stdp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
Loading…
Reference in a new issue