百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

DragPointView

> 编程语言
开源

一个可拖动的 Android PointView。

400 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个可拖动的 Android PointView。

DragPointView

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:

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

Then, add the library to your module build.gradle

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

Features

  • Inherited from TextView, easy to use.
  • Bessel curve is used to achieve tensile effect.
  • Provide you with rich attributes to customize various effects, such as maximum length of drag and drop, front and rear round radius, curve part color, radius scaling coefficient, etc.
  • Drag and drop actions are not restricted by the parent container, and the screen is free to drag and drop.
  • Allows settings to release animation, Animator or AnimationDrawable.
  • External development status monitoring, monitoring the status of the widget.
  • Convenient to clear the widget of the same sign.

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:

xml
java
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.

  • maxDragLength:Within this range, the Bessel rendering section will be shown, with the default value of Math.min (w, h)*3.
  • centerCircleRadius:The initial radius of the center circle.
  • dragCircleRadius:The initial radius of the drag circle.
  • centerMinRatio:When dragging, the center circle becomes smaller and smaller with distance, and the property controls its minimum coefficient range: 0.5f~1.0f.
  • recoveryAnimDuration:If the stretch length is not up to the threshold, the animation will be recovery, specifying the length of the animation.
  • recoveryAnimBounce:recovery animation bounce factor, range 0.0f~1.0f.
  • colorStretching:Bessel painted some colors, recommended consistent with the widget background.
  • sign:Mark the category of this control and use it with clearSign.
  • clearSign:The clearSign specified widgets are removed at the same time as they are removed.
  • canDrag:Controls whether or not to allow drag and drop.

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.

java
@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.

Issues· 3 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaandroidbadgeviewdragpointviewunreadpointview

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言