[6.9.0]
[fea] [taxi] [选择新的标定站点]
This commit is contained in:
@@ -68,7 +68,6 @@ class SwitchLineTaskAdapter(
|
||||
if(checkTask==task){
|
||||
checkTask = null
|
||||
}else {
|
||||
resetOther()
|
||||
mData.forEachIndexed { index, result ->
|
||||
if(checkTask == result){
|
||||
checkTask = null
|
||||
@@ -85,10 +84,6 @@ class SwitchLineTaskAdapter(
|
||||
}
|
||||
}
|
||||
|
||||
private fun resetOther() {
|
||||
|
||||
}
|
||||
|
||||
override fun getItemCount(): Int {
|
||||
return mData.size
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
|
||||
import com.mogo.eagle.core.utilcode.util.ToastUtils
|
||||
import com.mogo.och.common.module.manager.loop.BizLoopManager
|
||||
import com.mogo.och.common.module.utils.ResourcesUtils
|
||||
import com.mogo.och.common.module.wigets.TaskBottomDecoration
|
||||
import com.mogo.och.common.module.wigets.WindowRelativeLayout
|
||||
import com.mogo.och.shuttle.weaknet.R
|
||||
import com.mogo.och.data.db.bean.LineDataBean
|
||||
@@ -65,9 +66,7 @@ class SwitchTaskView: WindowRelativeLayout, SwtichTaskModel.SwtichLineViewCallba
|
||||
mAdapter = SwitchLineTaskAdapter(context,null, mutableListOf())
|
||||
rv_switch_task.setAdapter(mAdapter)
|
||||
rv_switch_task.addItemDecoration(
|
||||
TaskBottomDecoration(
|
||||
AutoSizeUtils.dp2px(context, 174f)
|
||||
)
|
||||
TaskBottomDecoration(AutoSizeUtils.dp2px(context, 174f),0)
|
||||
)
|
||||
|
||||
actv_submit_task.onClick {
|
||||
|
||||
@@ -1,48 +0,0 @@
|
||||
package com.mogo.och.weaknet.ui.switchtask
|
||||
|
||||
import android.graphics.Rect
|
||||
import android.view.View
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
|
||||
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_BUS
|
||||
|
||||
class TaskBottomDecoration(val distance: Int) : RecyclerView.ItemDecoration() {
|
||||
|
||||
private val TAG = M_BUS + "TaskBottomDecoration"
|
||||
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
view: View,
|
||||
parent: RecyclerView,
|
||||
state: RecyclerView.State
|
||||
) {
|
||||
val pos = parent.getChildAdapterPosition(view)
|
||||
|
||||
/**
|
||||
* 通过设置Item左右边距实现第一个左侧和最后一个右侧设置边距,确保显示的视图位于屏幕中间
|
||||
*/
|
||||
val itemCount = parent.adapter!!.itemCount
|
||||
val layoutManager = parent.layoutManager
|
||||
|
||||
if (layoutManager is GridLayoutManager) {
|
||||
var lastPathCount = itemCount % layoutManager.spanCount
|
||||
//2 5 % 3
|
||||
CallerLogger.d(
|
||||
TAG,
|
||||
"位置---${pos}_lastPathCount:${lastPathCount}_____itemCount:${itemCount}__spanCount:${layoutManager.spanCount}"
|
||||
)
|
||||
if (lastPathCount == 0) {
|
||||
lastPathCount = layoutManager.spanCount
|
||||
}
|
||||
if (pos < itemCount - lastPathCount) {
|
||||
|
||||
} else {
|
||||
outRect.bottom = distance
|
||||
}
|
||||
}
|
||||
//super.getItemOffsets(outRect, view, parent, state)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user