[8.2.0]
[算路] [过滤条件]
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.mogo.och.biz.routing.ui.routingselect
|
||||
|
||||
import android.animation.ObjectAnimator
|
||||
import android.animation.ValueAnimator
|
||||
import android.content.Context
|
||||
import android.util.AttributeSet
|
||||
import android.view.LayoutInflater
|
||||
@@ -10,6 +12,7 @@ import androidx.lifecycle.findViewTreeViewModelStoreOwner
|
||||
import com.mogo.eagle.core.utilcode.kotlin.onClick
|
||||
import com.mogo.eagle.core.utilcode.mogo.view.SpacesItemDecoration
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
|
||||
import com.mogo.och.biz.R
|
||||
import com.mogo.och.biz.routing.bean.GrayLineBean
|
||||
import com.mogo.och.biz.routing.bean.StartGrayAndQueryContrailRsp
|
||||
@@ -17,7 +20,9 @@ import com.mogo.och.common.module.wigets.WrapContentLinearLayoutManager
|
||||
import com.mogo.och.biz.routing.ui.RoutingSwitchModel
|
||||
import com.mogo.och.biz.routing.ui.routingselect.RoutingSelectModel.SwtichRoutingViewCallback
|
||||
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
|
||||
import kotlinx.android.synthetic.main.biz_taxi_select.view.actv_refresh
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import kotlinx.android.synthetic.main.biz_taxi_select.view.aciv_refresh_task
|
||||
import kotlinx.android.synthetic.main.biz_taxi_select.view.include_empty
|
||||
import kotlinx.android.synthetic.main.biz_taxi_select.view.include_error
|
||||
import kotlinx.android.synthetic.main.biz_taxi_select.view.switch_routing_rv
|
||||
@@ -47,6 +52,11 @@ class RoutingSelectView: ConstraintLayout, SwtichRoutingViewCallback {
|
||||
private val mRoutingLineList: MutableList<GrayLineBean> = ArrayList()
|
||||
private var mCurrentChosenPosition: Int = -1
|
||||
|
||||
private var animator: ObjectAnimator?=null
|
||||
|
||||
private var animatorStart = System.currentTimeMillis()
|
||||
|
||||
|
||||
|
||||
|
||||
init {
|
||||
@@ -75,8 +85,17 @@ class RoutingSelectView: ConstraintLayout, SwtichRoutingViewCallback {
|
||||
}
|
||||
})
|
||||
|
||||
actv_refresh.onClick {
|
||||
aciv_refresh_task.onClick {
|
||||
viewModel?.queryRoutingGrayLineList()
|
||||
aciv_refresh_task.isEnabled = false
|
||||
animatorStart = System.currentTimeMillis()
|
||||
if(animator==null) {
|
||||
animator = ObjectAnimator.ofFloat(aciv_refresh_task, "rotation", 0f, 360f)
|
||||
animator?.setDuration(1000) // 设置动画持续时间
|
||||
animator?.repeatCount = ValueAnimator.INFINITE // 设置动画无限重复
|
||||
animator?.repeatMode = ValueAnimator.RESTART // 设置重复模式
|
||||
}
|
||||
animator?.start()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,10 +152,12 @@ class RoutingSelectView: ConstraintLayout, SwtichRoutingViewCallback {
|
||||
|
||||
override fun onQueryRoutingGrayLineListSuccess(data: MutableList<GrayLineBean>) {
|
||||
onRoutingGrayLineListChanged(data)
|
||||
cancleAni()
|
||||
}
|
||||
|
||||
override fun onQueryRoutingGrayLineListFailed(errorStr: String) {
|
||||
showErrorView()
|
||||
cancleAni()
|
||||
}
|
||||
|
||||
override fun onStartGrayTaskAndQueryContrailSuccess(data: StartGrayAndQueryContrailRsp) {
|
||||
@@ -147,4 +168,13 @@ class RoutingSelectView: ConstraintLayout, SwtichRoutingViewCallback {
|
||||
swtichViewModel?.showRoutingSelectView()
|
||||
}
|
||||
|
||||
private fun cancleAni(){
|
||||
val endTime = System.currentTimeMillis()
|
||||
val dex = (1000-(endTime - animatorStart)).takeIf { it>=0 }?:0
|
||||
UiThreadHandler.postDelayed({
|
||||
animator?.cancel()
|
||||
aciv_refresh_task.isEnabled = true
|
||||
},dex, UiThreadHandler.MODE.QUEUE,)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,27 +20,15 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"/>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/actv_running_task_time"
|
||||
android:gravity="center"
|
||||
android:layout_marginEnd="@dimen/dp_54"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:layout_marginTop="@dimen/dp_2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="@dimen/dp_100">
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
android:id="@+id/actv_refresh"
|
||||
android:layout_width="@dimen/dp_200"
|
||||
android:layout_height="@dimen/dp_80"
|
||||
app:pressed_enabled="false"
|
||||
android:gravity="center"
|
||||
android:text="刷新列表"
|
||||
android:background="@drawable/biz_button_selector"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/dp_40" />
|
||||
|
||||
</LinearLayout>
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/aciv_refresh_task"
|
||||
app:layout_constraintTop_toTopOf="@+id/actv_routing_title"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/actv_routing_title"
|
||||
app:layout_constraintStart_toEndOf="@+id/actv_routing_title"
|
||||
android:layout_marginStart="@dimen/dp_30"
|
||||
android:src="@drawable/shuttle_refresh_task"
|
||||
android:layout_width="@dimen/dp_60"
|
||||
android:layout_height="@dimen/dp_50"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/switch_routing_rv"
|
||||
|
||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Reference in New Issue
Block a user