|
|
@@ -19,6 +19,8 @@ import com.grkj.iscs.view.iview.IStepView
|
|
|
import com.grkj.iscs.view.presenter.StepPresenter
|
|
|
import com.zhy.adapter.recyclerview.CommonAdapter
|
|
|
import com.zhy.adapter.recyclerview.base.ViewHolder
|
|
|
+import kotlin.math.ceil
|
|
|
+import kotlin.math.sqrt
|
|
|
|
|
|
/**
|
|
|
* 作业票执行步骤页 - 八大步骤
|
|
|
@@ -162,8 +164,10 @@ class StepFragment(val goBack: () -> Unit, val changePage: (PageChangeBO) -> Uni
|
|
|
mLotoList.clear()
|
|
|
mLotoList.addAll(it)
|
|
|
} ?: mLotoList.clear()
|
|
|
- (mBinding?.rvLoto?.layoutManager as GridLayoutManager).spanCount =
|
|
|
- if (mLotoList.size == 0) 3 else mLotoList.size / 3 + if (mLotoList.size % 3 == 0) 0 else 1
|
|
|
+
|
|
|
+ val spanCount = (ceil(sqrt(mLotoList.size.toFloat())) - 1).toInt()
|
|
|
+ (mBinding?.rvLoto?.layoutManager as GridLayoutManager).spanCount = spanCount
|
|
|
+
|
|
|
mBinding?.rvLoto?.adapter?.notifyDataSetChanged()
|
|
|
}
|
|
|
}
|