新增一个动画
This commit is contained in:
parent
954ccfad39
commit
37e76ac5b9
|
|
@ -23,6 +23,7 @@ import androidx.appcompat.widget.AppCompatImageView
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout
|
import androidx.constraintlayout.widget.ConstraintLayout
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.lifecycleScope
|
import androidx.lifecycle.lifecycleScope
|
||||||
|
import com.airbnb.lottie.LottieAnimationView
|
||||||
import com.cncat.vpn.common.constants.Intents
|
import com.cncat.vpn.common.constants.Intents
|
||||||
import com.cncat.vpn.common.log.Log
|
import com.cncat.vpn.common.log.Log
|
||||||
import com.cncat.vpn.core.Clash
|
import com.cncat.vpn.core.Clash
|
||||||
|
|
@ -88,6 +89,8 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
||||||
private lateinit var clickOnLink: ConstraintLayout
|
private lateinit var clickOnLink: ConstraintLayout
|
||||||
private lateinit var InTheLink: AppCompatImageView
|
private lateinit var InTheLink: AppCompatImageView
|
||||||
private lateinit var ClickTheLink: TextView
|
private lateinit var ClickTheLink: TextView
|
||||||
|
|
||||||
|
private lateinit var lottieView: LottieAnimationView
|
||||||
override fun init(
|
override fun init(
|
||||||
titleBarRl: RelativeLayout,
|
titleBarRl: RelativeLayout,
|
||||||
backIv: ImageView,
|
backIv: ImageView,
|
||||||
|
|
@ -147,7 +150,9 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
||||||
clickOnLink=view.findViewById(R.id.clickOnLink)
|
clickOnLink=view.findViewById(R.id.clickOnLink)
|
||||||
InTheLink=view.findViewById(R.id.InTheLink)
|
InTheLink=view.findViewById(R.id.InTheLink)
|
||||||
ClickTheLink=view.findViewById(R.id.ClickTheLink)
|
ClickTheLink=view.findViewById(R.id.ClickTheLink)
|
||||||
|
lottieView=view.findViewById(R.id.lottieView)
|
||||||
|
lottieView.setAnimation(R.raw.mylinek)
|
||||||
|
lottieView.pauseAnimation()
|
||||||
clickOnLink.setOnClickListener {
|
clickOnLink.setOnClickListener {
|
||||||
if (clashRunning) {
|
if (clashRunning) {
|
||||||
val rxDialogSureCancel = RxDialogSureCancel(activity)
|
val rxDialogSureCancel = RxDialogSureCancel(activity)
|
||||||
|
|
@ -169,7 +174,7 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
||||||
if(connectId!=-1){
|
if(connectId!=-1){
|
||||||
accelerateViewModel.appStopStatus(connectId)
|
accelerateViewModel.appStopStatus(connectId)
|
||||||
}
|
}
|
||||||
|
lottieView.pauseAnimation()
|
||||||
}
|
}
|
||||||
rxDialogSureCancel.show()
|
rxDialogSureCancel.show()
|
||||||
|
|
||||||
|
|
@ -247,11 +252,18 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
||||||
InTheLink.setImageResource(R.mipmap.ic_click)
|
InTheLink.setImageResource(R.mipmap.ic_click)
|
||||||
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
|
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
|
||||||
}
|
}
|
||||||
|
launch(Dispatchers.Main){
|
||||||
|
lottieView.playAnimation()
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
clickOnLink.setBackgroundResource(R.drawable.home_circle_connecting)
|
clickOnLink.setBackgroundResource(R.drawable.home_circle_connecting)
|
||||||
InTheLink.setImageResource(R.mipmap.ic_click)
|
InTheLink.setImageResource(R.mipmap.ic_click)
|
||||||
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
|
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
|
||||||
accelerateViewModel.appStartupStatus()
|
accelerateViewModel.appStartupStatus()
|
||||||
|
launch(Dispatchers.Main){
|
||||||
|
lottieView.playAnimation()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
stop_u_timer()
|
stop_u_timer()
|
||||||
|
|
@ -264,6 +276,9 @@ class NewAccFragment : BaseFragment(), CoroutineScope by CoroutineScope(Dispatch
|
||||||
InTheLink.setImageResource(R.mipmap.ic_click)
|
InTheLink.setImageResource(R.mipmap.ic_click)
|
||||||
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
|
ClickTheLink.text=requireActivity().resources.getString(R.string.CloseConnection)
|
||||||
clickOnLink.setBackgroundResource(R.drawable.home_circle_connecting)
|
clickOnLink.setBackgroundResource(R.drawable.home_circle_connecting)
|
||||||
|
launch(Dispatchers.Main){
|
||||||
|
lottieView.playAnimation()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,13 @@
|
||||||
android:layout_marginStart="50dp"
|
android:layout_marginStart="50dp"
|
||||||
android:layout_marginEnd="50dp"
|
android:layout_marginEnd="50dp"
|
||||||
>
|
>
|
||||||
|
<com.airbnb.lottie.LottieAnimationView
|
||||||
|
android:id="@+id/lottieView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
app:lottie_autoPlay="true"
|
||||||
|
app:lottie_loop="true"
|
||||||
|
/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/ClickTheLink"
|
android:id="@+id/ClickTheLink"
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue