[6.9.0]
[fea] [taxi] [选择新的标定站点]
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -39,4 +39,6 @@
|
||||
<string name="common_dialog_confirm">确认</string>
|
||||
<string name="common_dialog_cancel">取消</string>
|
||||
|
||||
<string name="common_dialog_goback">返回</string>
|
||||
|
||||
</resources>
|
||||
Reference in New Issue
Block a user