DragPointView

Build Status License 作者

This is a handy developer to quickly implement drag and drop unread messages, widget, which you can use as you do with TextView, and customize detail effects with extra attributes and method.

Dependency

Add this in your project build.gradle file:

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

Then, add the library to your module build.gradle

dependencies {
    compile 'com.github.javonleee:DragPointView:latest.release'
}

Features

Usage

There is a sample provided which shows how to use the library in a more advanced way, but for completeness, here is all that is required to get DragPointView working:

<com.javonlee.dragpointview.view.DragPointView
    android:id="@+id/drag_point_view"
    android:layout_width="wrap_content"
        android:layout_height="wrap_content"
    android:background="@drawable/shape_drag_point_red"
    android:gravity="center"
    android:text="66"
    android:textColor="#fff"
    android:textSize="16sp"
    app:centerMinRatio="0.5"
    app:clearSign="test"
    app:colorStretching="#f00"
    app:dragCircleRadius="100dp"
    app:maxDragLength="100dp"
    app:recoveryAnimBounce="0.25" />
DragPointView dragPointView = (DragPointView) findViewById(R.id.drag_point_view);
pointView.setRemoveAnim(animationDrawable);
pointView.setOnPointDragListener(listener);

That's it!

Attribute

You can customize the desired effect by setting the following properties in the layout file.

Caution

When the DragPointView that sets the clearSign property is removed, be sure to update the relevant object information in the onRemoveStart or onRemoveEnd callback.For example, set all chat sessions to read.

@Override
public void onRemoveStart(AbsDragPointView view) {
    for (ConversationEntity entity : conversationEntities) {
        entity.setRead(true);
        entity.setMessageNum(0);
        }
}

Author

[email protected]

[email protected]

License

Copyright 2017 javonlee

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.