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

fixed uninstall button

This commit is contained in:
X1nto 2020-05-10 18:44:33 +04:00
parent 87b563b891
commit f4e7ac4f25
3 changed files with 64 additions and 40 deletions

View file

@ -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)

View file

@ -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)
oa2.start()
oa3.apply {
oa3.addListener(onStart = {
oa0.start()
})
oa3.addListener(onEnd = {
oa1.start()
oa2.apply {
oa2.addListener(onEnd = {
networkErrorLayout?.visibility = View.GONE
}
)

View file

@ -26,12 +26,18 @@
android:visibility="gone"
tools:visibility="visible"/>
<LinearLayout
android:id="@+id/home_main_wrapper"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:orientation="vertical">
<include
android:id="@+id/home_vanced_wrapper"
layout="@layout/include_vanced"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:layout_marginStart="@dimen/stdp"
android:layout_marginEnd="@dimen/stdp" />
@ -65,4 +71,6 @@
</LinearLayout>
</LinearLayout>
</com.vanced.manager.ui.core.SlidingNestedScrollView>