Coder Social home page Coder Social logo

draglistview's Introduction

DragListView

A dragable ListView for Android, used for reorder your datas.

image

Download

Download via Gradle:

compile 'com.lunger.draglistview:draglistview:2.2.0'

or Maven:

<dependency>
  <groupId>com.lunger.draglistview</groupId>
  <artifactId>draglistview</artifactId>
  <version>2.2.0</version>
  <type>pom</type>
</dependency>

Usage

mDragListView.setDragListAdapter(new MyAdapter(this, mDatas));
//设置点击item哪个部位可触发拖拽(可不设置,默认是item任意位置长按可拖拽)
mDragListView.setDragger(R.id.iv_move);
//设置item悬浮背景色
mDragListView.setItemFloatColor("#A35151");
//设置item悬浮透明度
mDragListView.setItemFloatAlpha(0.65f);
//设置拖拽响应回调
mDragListView.setMyDragListener(new DragListView.MyDragListener() {
    @Override
    public void onDragFinish(int srcPositon, int finalPosition) {
          Toast.makeText(MainActivity.this, "beginPosition : " + srcPositon + "...endPosition : " + finalPosition, Toast.LENGTH_LONG).show();
    }
});

ProGuard

If you are using ProGuard you might need to add the following option:

-dontwarn com.lunger.draglistview.**

License

Copyright 2016 Lunger Personal

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

draglistview's People

Contributors

lungerwang avatar

Watchers

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