英文:
Open by default column three or any other in draglist(Woxblom)android
问题
I understand that you want to translate the code-related portion. Here it is:
private fun resetBoard(
oldColumn: Int, oldRow: Int, newColumn: Int, isDraggable: Boolean,
) {
binding.boardView.clearBoard()
binding.boardView.setCustomDragItem(MyDragItem(activity, R.layout.column_item))
binding.boardView.setCustomColumnDragItem(MyDragItem(activity, R.layout.column_drag_layout))
if (isDraggable) {
if (mDraftItemArray.size > oldRow) {
if (oldRow == 0) {
mDraftItemArray[oldRow].second.topMargin = true
} else if (!mDraftItemArray[oldRow].second.itemIdSort.equals(
mDraftItemArray[oldRow - 1].second.itemIdSort,
true
)
) {
mDraftItemArray[oldRow].second.topMargin = true
}
}
if (newColumn == ColumnStatus.Inprogress.column || oldColumn == ColumnStatus.Todo.column) {
updateRowItems(mToDoItemArray)
}
if (newColumn == ColumnStatus.Inprogress.column || oldColumn == ColumnStatus.Inprogress.column) {
updateRowItems(mInProgressItemArray)
}
if (newColumn == ColumnStatus.ForApproval.column || oldColumn == ColumnStatus.ForApproval.column) {
updateRowItems(mForApprovalItemArray)
}
if (newColumn == ColumnStatus.Completed.column || oldColumn == ColumnStatus.Completed.column) {
updateRowItems(mCompletedItemArray)
}
}
addColumn(mDraftItemArray)
addColumn(mToDoItemArray)
addColumn(mInProgressItemArray)
addColumn(mForApprovalItemArray)
addColumn(mCompletedItemArray)
binding.boardView.scrollToColumn(2,true)
}
If you need further assistance, please let me know.
英文:
i am using https://github.com/woxblom/DragListView (Woxblom) lib,i have a trouble while open dragList. i want to open by default column number three after setting all columns , is it possible.....?
can someone help is appreciated in advance
i have try this after adding all columns but it could not open specified column
private fun resetBoard(
oldColumn: Int, oldRow: Int, newColumn: Int, isDraggable: Boolean,
) {
binding.boardView.clearBoard()
binding.boardView.setCustomDragItem(MyDragItem(activity, R.layout.column_item))
binding.boardView.setCustomColumnDragItem(MyDragItem(activity, R.layout.column_drag_layout))
if (isDraggable) {
if (mDraftItemArray.size > oldRow) {
if (oldRow == 0) {
mDraftItemArray[oldRow].second.topMargin = true
} else if (!mDraftItemArray[oldRow].second.itemIdSort.equals(
mDraftItemArray[oldRow - 1].second.itemIdSort,
true
)
) {
mDraftItemArray[oldRow].second.topMargin = true
}
}
if (newColumn == ColumnStatus.Inprogress.column || oldColumn == ColumnStatus.Todo.column) {
updateRowItems(mToDoItemArray)
}
if (newColumn == ColumnStatus.Inprogress.column || oldColumn == ColumnStatus.Inprogress.column) {
updateRowItems(mInProgressItemArray)
}
if (newColumn == ColumnStatus.ForApproval.column || oldColumn == ColumnStatus.ForApproval.column) {
updateRowItems(mForApprovalItemArray)
}
if (newColumn == ColumnStatus.Completed.column || oldColumn == ColumnStatus.Completed.column) {
updateRowItems(mCompletedItemArray)
}
}
addColumn(mDraftItemArray)
addColumn(mToDoItemArray)
addColumn(mInProgressItemArray)
addColumn(mForApprovalItemArray)
addColumn(mCompletedItemArray)
binding.boardView.scrollToColumn(2,true)
}
答案1
得分: 0
Handler(Looper.getMainLooper()).postDelayed({
binding.boardView.scrollToColumn(2, true)
}, 500)
英文:
Handler(Looper.getMainLooper()).postDelayed({
binding.boardView.scrollToColumn(2, true)
},500)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论