{"id":22360292,"url":"https://github.com/jakebonk/boardview","last_synced_at":"2025-04-05T11:08:54.864Z","repository":{"id":65591359,"uuid":"94128602","full_name":"jakebonk/BoardView","owner":"jakebonk","description":"A draggable boardview for java android (Kanban style)","archived":false,"fork":false,"pushed_at":"2018-11-16T22:23:57.000Z","size":198,"stargazers_count":318,"open_issues_count":5,"forks_count":36,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-05T11:08:46.544Z","etag":null,"topics":["adapter","android","android-app","android-library","boardview","drag","drag-listeners","drop","gradle","java","listener","listview","recyclerview"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jakebonk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-12T18:37:54.000Z","updated_at":"2025-01-16T09:39:51.000Z","dependencies_parsed_at":"2023-01-30T22:25:13.187Z","dependency_job_id":null,"html_url":"https://github.com/jakebonk/BoardView","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakebonk%2FBoardView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakebonk%2FBoardView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakebonk%2FBoardView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jakebonk%2FBoardView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jakebonk","download_url":"https://codeload.github.com/jakebonk/BoardView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325693,"owners_count":20920714,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adapter","android","android-app","android-library","boardview","drag","drag-listeners","drop","gradle","java","listener","listview","recyclerview"],"created_at":"2024-12-04T16:15:03.580Z","updated_at":"2025-04-05T11:08:54.844Z","avatar_url":"https://github.com/jakebonk.png","language":"Java","readme":"[![](https://jitpack.io/v/jakebonk/BoardView.svg)](https://jitpack.io/#jakebonk/BoardView)\n\n# BoardView\nBoardView is a custom view that allows you to be able to re-order items in a list as well as in a board. You can drag and drop items between columns as well as drag and drop columns.\n\n## Example\n\n![Basic Example](https://thumbs.gfycat.com/DeadUntidyHartebeest-size_restricted.gif)\n\n## Download library with Jitpack.io\nAdd this to your build.gradle file for your app.\n```java\n\tallprojects {\n\t\trepositories {\n\t\t\t...\n\t\t\tmaven { url 'https://jitpack.io' }\n\t\t}\n\t}\n```\t\n\nAdd this to your dependencies in build.gradle for your project.\n```java\n\tdependencies {\n\t        implementation 'com.github.jakebonk:BoardView:1.3.6'\n\t}\n```\n## Usage\n\nBoardView utilizes a BoardAdapter, SimpleBoardAdapter is an example of how to extend BoardAdapter.\n```java\n\tBoardView boardView = (BoardView)findViewById(R.id.boardview);\n\tArrayList\u003cSimpleBoardAdapter.SimpleColumn\u003e data = new ArrayList\u003c\u003e();\n        ArrayList\u003cString\u003e list = new ArrayList\u003cString\u003e();\n        list.add(\"Item 1\");\n        list.add(\"Item 2\");\n        list.add(\"Item 3\");\n        list.add(\"Item 4\");\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 1\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 2\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 3\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 4\",list));\n        data.add(new SimpleBoardAdapter.SimpleColumn(\"Column 5\",list));\n        SimpleBoardAdapter boardAdapter = new SimpleBoardAdapter(this,data);\n        boardView.setAdapter(boardAdapter);\n```\nTo manipulate the BoardView simply call one of the new functions in BoardAdapter\n\n```java\nvoid removeColumn(int index)\nvoid removeItem(int column, int index)\nvoid addItem(int column,int index, Object item)\nvoid addColumn(int index, Column column)\n```\n\nI also added the ability to set Transition animations when adding items/columns.\n\n```java\n void SetColumnTransition(Transition t)\n void SetItemTransition(Transition t)\n```\n\nThere are two types of drag listeners, the first is for columns\n```java\n\t boardView.setOnDragColumnListener(new BoardView.DragColumnStartCallback() {\n            @Override\n            public void startDrag(View view, int startColumnPos) {\n\n            }\n\n            @Override\n            public void changedPosition(View view, int startColumnPos, int newColumnPos) {\n\n            }\n\t    \n\t    @Override\n            public void dragging(View itemView, MotionEvent event) {\n                \n            }\n\n            @Override\n            public void endDrag(View view, int startColumnPos, int endColumnPos) {\n\n            }\n        });\n```\nSimilarly we can get the drag listener for items\n```java\n\t boardView.setOnDragItemListener(new BoardView.DragItemStartCallback() {\n            @Override\n            public void startDrag(View view, int startItemPos, int startColumnPos) {\n\n            }\n\n            @Override\n            public void changedPosition(View view, int startItemPos, int startColumnPos, int newItemPos, int newColumnPos) {\n\n            }\n\t    \n\t     @Override\n            public void dragging(View itemView, MotionEvent event) {\n\t    \n            }\n\n            @Override\n            public void endDrag(View view, int startItemPos, int startColumnPos, int endItemPos, int endColumnPos) {\n\n            }\n        });\n```\n\nThere is also a listener for when the BoardView has finished creating and assigning its views.\n\n```java \n\n\t boardView.setOnDoneListener(new BoardView.DoneListener() {\n            @Override\n            public void onDone() {\n                Log.e(\"ee\",\"Done\");\n            }\n        });\n\n```\n\nThis is how to set the click listener for a item, header and footer, which gives their respective positions.\n\t\n```java\n\t\n\tboardView.setOnItemClickListener(new BoardView.ItemClickListener() {\n            @Override\n            public void onClick(View v, int column_pos, int item_pos) {\n                \n            }\n        });\n        boardView.setOnHeaderClickListener(new BoardView.HeaderClickListener() {\n            @Override\n            public void onClick(View v, int column_pos) {\n                \n            }\n        });\t\n\tboardView.setOnFooterClickListener(new BoardView.FooterClickListener() {\n            @Override\n            public void onClick(View v, int column_pos) {\n\t    \n            }\n        });\n\n```\n\nBy setting SetColumnSnap you can allow the BoardView to snap to the closest column when scrolling, this is activated by default. To set it back to normal just set it to false\n\n```java\n\nboardView.SetColumnSnap(true);\n\t\n\tor\n\t\nboardView.SetColumnSnap(false);\n\n```\n\t\n### Creating your own BoardAdapter\n\nCreating a custom BoardAdapter is pretty similar to that of a BaseAdapter, the main focus being to create some type of object that help you create your custom views for both headers and items.\nThe adapter also has two new abstract methods called, isColumnLocked when true prevents the column from being draggable. isItemLocked will not allow item to be dragged to or from this column.\n\n```java\n\t@Override\n\tpublic boolean isColumnLocked(int column_position) {\n\t\treturn false;\n\t}\n\n\t@Override\n\tpublic boolean isItemLocked(int column_position) {\t\t\n\t\treturn false;\n\t}\n```\n\nYou can also set the maximum amount of items you want in a list. If -1 is returned then there will be no cap otherwise the returned value will be the cap. The example below allow only 4 items inside any given column.\n\n```java\n@Override\n    public int maxItemCount(int column_position) {\n        return 4;\n    }\n```    \n\n### Things to fix\nThere is a scaling issue when the column is beginning dragging or has ended dragging. I know this is an issue but I don't know of a good way to solve this at the moment. I eventually will fix it but for now I'm putting it on the back burners.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakebonk%2Fboardview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjakebonk%2Fboardview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjakebonk%2Fboardview/lists"}