mirror of
				https://github.com/AdrianKuta/Unbound-Drag-Drop.git
				synced 2025-10-31 00:13:39 +01:00 
			
		
		
		
	Add README and LICENSE
This commit is contained in:
		
							
								
								
									
										21
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | MIT License | ||||||
|  |  | ||||||
|  | Copyright (c) 2024 Adrian Kuta | ||||||
|  |  | ||||||
|  | Permission is hereby granted, free of charge, to any person obtaining a copy | ||||||
|  | of this software and associated documentation files (the "Software"), to deal | ||||||
|  | in the Software without restriction, including without limitation the rights | ||||||
|  | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||||||
|  | copies of the Software, and to permit persons to whom the Software is | ||||||
|  | furnished to do so, subject to the following conditions: | ||||||
|  |  | ||||||
|  | The above copyright notice and this permission notice shall be included in all | ||||||
|  | copies or substantial portions of the Software. | ||||||
|  |  | ||||||
|  | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||||||
|  | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||||||
|  | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||||||
|  | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||||||
|  | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||||||
|  | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||||||
|  | SOFTWARE. | ||||||
							
								
								
									
										68
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										68
									
								
								README.md
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,68 @@ | |||||||
|  | # Unbound Drag & Drop | ||||||
|  | [](https://central.sonatype.com/artifact/dev.adriankuta/unbound-drag-drop) | ||||||
|  | [](https://github.com/AdrianKuta/Unbound-Drag-Drop/blob/master/LICENSE) | ||||||
|  |  | ||||||
|  |  | ||||||
|  | Unbound Drag & Drop is a versatile and user-friendly feature designed to enhance your Android applications by enabling drag and drop functionality across multiple RecyclerViews. Unlike the default behavior, which restricts drag and drop actions within a single RecyclerView, Unbound Drag & Drop allows users to seamlessly move items between different RecyclerViews, providing a more flexible and intuitive user experience. | ||||||
|  |  | ||||||
|  | ## Features | ||||||
|  |  | ||||||
|  | - **Multi-RecyclerView Drag and Drop**: Easily drag and drop items between multiple RecyclerViews. | ||||||
|  | - **Customizable and Extensible**: Adapt the feature to fit your specific needs with customizable options and extensible components. | ||||||
|  | - **Smooth and Intuitive User Experience**: Enhance the interactivity of your app with a user-friendly drag and drop interface. | ||||||
|  | - **Easy Integration**: Quickly integrate Unbound Drag & Drop into your existing Android projects with minimal setup. | ||||||
|  |  | ||||||
|  | ## Installation | ||||||
|  |  | ||||||
|  | To include Unbound Drag & Drop in your project, add the following dependency to your build.gradle file: | ||||||
|  |  | ||||||
|  | ```kotlin | ||||||
|  | implementation("dev.adriankuta:unbound-drag-drop:0.0.2") | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ## Usage | ||||||
|  |  | ||||||
|  | ### Setup | ||||||
|  |  | ||||||
|  | #### Step 1: Implement the Callback | ||||||
|  |  | ||||||
|  | Create a class that extends `DragDropHelper.Callback` to handle drag and drop events. | ||||||
|  |  | ||||||
|  | ```kotlin | ||||||
|  | class MyDragDropCallback : DragDropHelper.Callback() { | ||||||
|  |     override fun onMove( | ||||||
|  |         recyclerView: RecyclerView, | ||||||
|  |         viewHolder: RecyclerView.ViewHolder, | ||||||
|  |         targetRecyclerView: RecyclerView, | ||||||
|  |         targetViewHolder: RecyclerView.ViewHolder? | ||||||
|  |     ): Boolean { | ||||||
|  |         // Handle the move logic here | ||||||
|  |         return true | ||||||
|  |     } | ||||||
|  |  | ||||||
|  |     override fun onMoved( | ||||||
|  |         recyclerView: RecyclerView, | ||||||
|  |         viewHolder: RecyclerView.ViewHolder, | ||||||
|  |         targetRecyclerView: RecyclerView, | ||||||
|  |         targetViewHolder: RecyclerView.ViewHolder? | ||||||
|  |     ) { | ||||||
|  |         // Handle post-move logic here | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | #### Step2: Attach `DragDropHelper` to `RecyclerView` | ||||||
|  |  | ||||||
|  | In your Activity or Fragment, attach DragDropHelper to your RecyclerView. | ||||||
|  |  | ||||||
|  | ``` | ||||||
|  | val recyclerView: RecyclerView = findViewById(R.id.recycler_view) | ||||||
|  | val dragDropHelper = DragDropHelper(MyDragDropCallback()) | ||||||
|  | dragDropHelper.attachToRecyclerView(recyclerView) | ||||||
|  | ``` | ||||||
|  |  | ||||||
|  | ## License | ||||||
|  | This project is licensed under the MIT License - see the LICENSE file for details. | ||||||
|  |  | ||||||
|  | ## Contributing | ||||||
|  | Contributions are welcome! Please submit a pull request or open an issue to discuss any changes. | ||||||
		Reference in New Issue
	
	Block a user