[fea]
[taxi]
[选择新的标定站点]
This commit is contained in:
yangyakun
2024-12-30 18:03:24 +08:00
parent 00c22b5767
commit cff56a1267
37 changed files with 917 additions and 108 deletions

View File

@@ -122,6 +122,12 @@ object BizLoopManager {
}
}
fun runInMainThreadDelay(delay:Long,function:Runnable){
ThreadUtils.runOnUiThreadDelayed({
function.run()
},delay,ThreadUtils.MODE.QUEUE)
}
fun runInIoThread(runable:Runnable){
if(ThreadUtils.isMainThread()){
ThreadUtils.getIoPool().submit(runable)

View File

@@ -0,0 +1,53 @@
package com.mogo.och.common.module.wigets
import android.graphics.Rect
import android.view.View
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,val norDistance: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
}
}else if(layoutManager is LinearLayoutManager){
if(pos==itemCount-1) {
outRect.bottom = distance
}else{
outRect.bottom = norDistance
}
}
//super.getItemOffsets(outRect, view, parent, state)
}
}

View File

@@ -46,6 +46,6 @@
<color name="common_3B3D44">#3B3D44</color>
<color name="common_2E323A">#2E323A</color>
<color name="common_ffffffff">#ffffffff</color>
<color name="common_2eacff">#2EACFF</color>
</resources>

View File

@@ -39,4 +39,6 @@
<string name="common_dialog_confirm">确认</string>
<string name="common_dialog_cancel">取消</string>
<string name="common_dialog_goback">返回</string>
</resources>