All Projects → jakebonk → Boardview

jakebonk / Boardview

Licence: apache-2.0
A draggable boardview for java android (Kanban style)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Boardview

recycler-adapter
RecyclerView-driven declarative UIs
Stars: ✭ 124 (-59.87%)
Mutual labels:  adapter, listview, recyclerview
GenericRecyclerAdapter
Easiest way to use RecyclerView. Reduce boilerplate code! You don't need to write adapters for listing pages anymore!
Stars: ✭ 53 (-82.85%)
Mutual labels:  adapter, listview, recyclerview
Adapter
A quick adapter library for RecyclerView, GridView, ListView, ViewPager, Spinner
Stars: ✭ 376 (+21.68%)
Mutual labels:  adapter, recyclerview, listview
Android
Android projects with reusable components which will be useful in your applications.
Stars: ✭ 81 (-73.79%)
Mutual labels:  drag, listview, drop
Commonadapter
一个适用于ListView/GridView/RecyclerView的Adapter库,简化大量重复代码,支持多种布局,可自定义图片加载的实现。
Stars: ✭ 219 (-29.13%)
Mutual labels:  adapter, recyclerview, listview
Fullrecyclerview
This is a compilation of different kinds and actions in recyclerView
Stars: ✭ 127 (-58.9%)
Mutual labels:  recyclerview, drag, drop
Google Books Android Viewer
Android library to bridge between RecyclerView and sources like web page or database. Includes demonstrator (Google Books viewer)
Stars: ✭ 37 (-88.03%)
Mutual labels:  adapter, recyclerview, listview
Recyclerviewhelper
📃 [Android Library] Giving powers to RecyclerView
Stars: ✭ 643 (+108.09%)
Mutual labels:  recyclerview, drag, drop
adapster
Android library designed to enrich and make your RecyclerView adapters more SOLID
Stars: ✭ 17 (-94.5%)
Mutual labels:  adapter, listview, recyclerview
Easyadapter
Android 轻量级适配器,简化使用,适应所有的AbsListView、RecyclerView。支持HeaderView与FooterView~
Stars: ✭ 160 (-48.22%)
Mutual labels:  adapter, recyclerview, listview
Superadapter
[Deprecated]. 🚀 Adapter(BaseAdapter, RecyclerView.Adapter) wrapper for Android. 一个Adapter同时适用RecyclerView、ListView、GridView等。
Stars: ✭ 638 (+106.47%)
Mutual labels:  adapter, recyclerview, listview
Candyview
Implement any RecyclerView in just 1 Line. CandyView handles everything for you.
Stars: ✭ 15 (-95.15%)
Mutual labels:  gradle, adapter, recyclerview
Kotlin Adapter
🔥 RecyclerView,AbsListView适配器, 支持多种视图样式, 支持吸顶、侧滑删除、拖拽效果
Stars: ✭ 132 (-57.28%)
Mutual labels:  adapter, recyclerview, listview
Dsladapter
🔥 Kotlin时代的Adapter, Dsl 的形式使用 RecyclerView.Adapter, 支持折叠展开, 树结构,悬停,情感图状态切换, 加载更多, 多类型Item,侧滑菜单等
Stars: ✭ 231 (-25.24%)
Mutual labels:  adapter, recyclerview, drag
GenericAdapter
⛳️ Easy to use android databinding ready recyclerview adapter
Stars: ✭ 26 (-91.59%)
Mutual labels:  adapter, listview, recyclerview
kandy
Sweet Android libraries written in Kotlin
Stars: ✭ 19 (-93.85%)
Mutual labels:  listview, recyclerview
navbuilder
Generiert frei definierbare Navigationsbäume mittels Drag & Drop
Stars: ✭ 21 (-93.2%)
Mutual labels:  drag, drop
AdapterLayout
ViewGroup backed by RecyclerView.Adapter = magic
Stars: ✭ 58 (-81.23%)
Mutual labels:  adapter, recyclerview
react-native-nlist
原生Listview Native lListView react-native encapsulation Memory recovery reusing High performance
Stars: ✭ 60 (-80.58%)
Mutual labels:  listview, recyclerview
jOrgChart
Here more functionality of jquery orgchart with json support
Stars: ✭ 29 (-90.61%)
Mutual labels:  drag, drop

BoardView

BoardView 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.

Example

Basic Example

Download library with Jitpack.io

Add this to your build.gradle file for your app.

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Add this to your dependencies in build.gradle for your project.

	dependencies {
	        implementation 'com.github.jakebonk:BoardView:1.3.6'
	}

Usage

BoardView utilizes a BoardAdapter, SimpleBoardAdapter is an example of how to extend BoardAdapter.

	BoardView boardView = (BoardView)findViewById(R.id.boardview);
	ArrayList<SimpleBoardAdapter.SimpleColumn> data = new ArrayList<>();
        ArrayList<String> list = new ArrayList<String>();
        list.add("Item 1");
        list.add("Item 2");
        list.add("Item 3");
        list.add("Item 4");
        data.add(new SimpleBoardAdapter.SimpleColumn("Column 1",list));
        data.add(new SimpleBoardAdapter.SimpleColumn("Column 2",list));
        data.add(new SimpleBoardAdapter.SimpleColumn("Column 3",list));
        data.add(new SimpleBoardAdapter.SimpleColumn("Column 4",list));
        data.add(new SimpleBoardAdapter.SimpleColumn("Column 5",list));
        SimpleBoardAdapter boardAdapter = new SimpleBoardAdapter(this,data);
        boardView.setAdapter(boardAdapter);

To manipulate the BoardView simply call one of the new functions in BoardAdapter

void removeColumn(int index)
void removeItem(int column, int index)
void addItem(int column,int index, Object item)
void addColumn(int index, Column column)

I also added the ability to set Transition animations when adding items/columns.

 void SetColumnTransition(Transition t)
 void SetItemTransition(Transition t)

There are two types of drag listeners, the first is for columns

	 boardView.setOnDragColumnListener(new BoardView.DragColumnStartCallback() {
            @Override
            public void startDrag(View view, int startColumnPos) {

            }

            @Override
            public void changedPosition(View view, int startColumnPos, int newColumnPos) {

            }
	    
	    @Override
            public void dragging(View itemView, MotionEvent event) {
                
            }

            @Override
            public void endDrag(View view, int startColumnPos, int endColumnPos) {

            }
        });

Similarly we can get the drag listener for items

	 boardView.setOnDragItemListener(new BoardView.DragItemStartCallback() {
            @Override
            public void startDrag(View view, int startItemPos, int startColumnPos) {

            }

            @Override
            public void changedPosition(View view, int startItemPos, int startColumnPos, int newItemPos, int newColumnPos) {

            }
	    
	     @Override
            public void dragging(View itemView, MotionEvent event) {
	    
            }

            @Override
            public void endDrag(View view, int startItemPos, int startColumnPos, int endItemPos, int endColumnPos) {

            }
        });

There is also a listener for when the BoardView has finished creating and assigning its views.

	 boardView.setOnDoneListener(new BoardView.DoneListener() {
            @Override
            public void onDone() {
                Log.e("ee","Done");
            }
        });

This is how to set the click listener for a item, header and footer, which gives their respective positions.

	
	boardView.setOnItemClickListener(new BoardView.ItemClickListener() {
            @Override
            public void onClick(View v, int column_pos, int item_pos) {
                
            }
        });
        boardView.setOnHeaderClickListener(new BoardView.HeaderClickListener() {
            @Override
            public void onClick(View v, int column_pos) {
                
            }
        });	
	boardView.setOnFooterClickListener(new BoardView.FooterClickListener() {
            @Override
            public void onClick(View v, int column_pos) {
	    
            }
        });

By 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

boardView.SetColumnSnap(true);
	
	or
	
boardView.SetColumnSnap(false);

Creating your own BoardAdapter

Creating 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. The 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.

	@Override
	public boolean isColumnLocked(int column_position) {
		return false;
	}

	@Override
	public boolean isItemLocked(int column_position) {		
		return false;
	}

You 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.

@Override
    public int maxItemCount(int column_position) {
        return 4;
    }

Things to fix

There 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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].