Git Product home page Git Product logo

nezne1k4 / drag-drop-grid Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bq/drag-drop-grid

0.0 1.0 0.0 649 KB

Biblioteca para crear un ViewGroup similar a un GridLayout al que se le pueden añadir objetos ImageViews que se pueden reordenar con un efecto de drag and drop. También se puede establecer una zona de borrado a la que arrastrar los ImageViews para eliminarlos del grid.

Java 100.00%

drag-drop-grid's Introduction

This project provides an Android library for a drag and drop scrolling grid view and a delete zone view if you need it.

This project is mainly inspired in the DraggableGridView of thquinn, and in the PagedDragDropGrid of mrKlar for the animations and the delete zone.

drag-drop-grid

drag-drop-grid is an Android library for creating a drag and drop grid. You can add different types of views and rearrange them. Moreover, you can add a delete zone, that if you drop the view over it, you delete it.

It allows you to:

  • Add ImageViews or TextViews to the grid. It's scrollable so you can add as many as you want.
  • Rearrange the views by doing a click in an item or a long click, but you can change this default behaviour by setting a new OnItemClickListener or OnItemLongClickListener.
  • Set a delete zone view if you want. You can drop the view on the delete zone to delete it.
  • You can add views of different sizes and the grid resizes its items to the biggest one, in order to get the same number of columns and rows. If there is no more space for another view, the items are centered in the grid layout.
  • You can set a fixed number of columns (no more than the available for the limited width of the device).
  • You can center the items in the grid.
  • You can set a fixed width and height for all the views in the grid.
  • Now you can customize your delete zone with other image, background and highlight color or background

There is an example project, ExampleDragDropGrid, where you can see how can the library be used.

Usage

  1. Clone the repository:

    git clone https://github.com/bq/drag-drop-grid.git
    
  2. Install in your local repository:

    • Gradle version equal or lower than 1.10 and drag-drop-grid version equal or lower than 1.6:

      cd drag-drop-grid/drag-drop-grid
      gradle publishToMavenLocal
      
    • Gradle version greater than 1.10 and drag-drop-grid version greater than 1.6:

      cd drag-drop-grid/drag-drop-grid
      gradle install
      
  3. Add your local repository to your root project's build.gradle file:

    repositories {
        mavenLocal()
    }
    
  4. Add the drag-drop-grid dependency to your app's build.gradle file:

    • Gradle version equal or lower than 1.10 and drag-drop-grid version equal or lower than 1.6:

      dependencies {
          compile('com.bq.robotic:drag-drop-grid:+@jar')
      }
      
    • Gradle version greater than 1.10 and drag-drop-grid version greater than 1.6:

      dependencies {
          compile('com.bq.robotic:drag-drop-grid:+@aar')
      }
      

Installation

  1. Install Android Studio and Gradle.

  2. If you use a 64 bits Linux, you will need to install ia32-libs-multiarch:

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install ia32-libs-multiarch
    
  3. Clone the repository:

    git clone https://github.com/bq/drag-drop-grid.git
    
  4. Install the drag-drop-grid library in your local repository:

    • Gradle version equal or lower than 1.10 and drag-drop-grid version equal or lower than 1.6:

      cd drag-drop-grid/drag-drop-grid
      gradle publishToMavenLocal
      
    • Gradle version greater than 1.10 and drag-drop-grid version greater than 1.6:

      cd drag-drop-grid/drag-drop-grid
      gradle install
      
  5. In Android Studio go to File > Open and select the drag-drop-grid gradle project inside the previous cloned project (that with the green robot icon, the drag-drop-grid library folder not the repository one with the example project inside too).

  6. If your are going to use drag-drop-grid for one of your projects, follow the instructions of the Usage section in order to installing it in your local repository and add to it the dependency needed.

Requirements

License

drag-drop-grid is distributed in terms of LGPL license. See http://www.gnu.org/licenses/lgpl.html for more details.

drag-drop-grid's People

Contributors

yamidragut avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.