打开Woxblom的拖动列表中的第三列或其他列。

huangapple go评论62阅读模式
英文:

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)

huangapple
  • 本文由 发表于 2023年5月10日 19:43:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76217982.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定