Draggable reminder view


License

License

GroupId

GroupId

com.github.tablebird
ArtifactId

ArtifactId

draggable-view
Last Version

Last Version

0.1.0
Release Date

Release Date

Type

Type

aar
Description

Description

Draggable reminder view
Draggable reminder view
Project URL

Project URL

https://github.com/tablebird/DraggableView/
Source Code Management

Source Code Management

https://github.com/tablebird/DraggableView/

Download draggable-view

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.tablebird/draggable-view/ -->
<dependency>
    <groupId>com.github.tablebird</groupId>
    <artifactId>draggable-view</artifactId>
    <version>0.1.0</version>
    <type>aar</type>
</dependency>
// https://jarcasting.com/artifacts/com.github.tablebird/draggable-view/
implementation 'com.github.tablebird:draggable-view:0.1.0'
// https://jarcasting.com/artifacts/com.github.tablebird/draggable-view/
implementation ("com.github.tablebird:draggable-view:0.1.0")
'com.github.tablebird:draggable-view:aar:0.1.0'
<dependency org="com.github.tablebird" name="draggable-view" rev="0.1.0">
  <artifact name="draggable-view" type="aar" />
</dependency>
@Grapes(
@Grab(group='com.github.tablebird', module='draggable-view', version='0.1.0')
)
libraryDependencies += "com.github.tablebird" % "draggable-view" % "0.1.0"
[com.github.tablebird/draggable-view "0.1.0"]

Dependencies

compile (2)

Group / Artifact Type Version
androidx.appcompat » appcompat jar 1.0.2
androidx.annotation » annotation jar 1.0.0

Project Modules

There are no modules declared in this project.

Draggable View

这是一个支持拖拽销毁的通知视图

  • 支持拖拽过程中的粘连效果
  • 拖拽有效后的爆炸动画
  • 拖拽无效后的减震回弹动画
  • 设置拖拽视图的跟随者与跟随模式

具体效果: demo

开始使用

安装

在模块的build.gradle添加:

dependencies {
    implementation 'com.github.tablebird:draggable-view:0.1.0'
}

示例代码

在视图资源文件中使用
            <com.tablebird.drag.DraggableView
                android:id="@+id/tip_summary"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:followDisappearMode="trailing" //设置更随模式
                app:draggableEnable="true" //是否启用拖拽
                ...
                android:gravity="center"/>

设置拖拽监听

	DraggableView draggableView = findViewById(R.id.tip_summary);
	draggableView.setOnDragCompeteListener(new DraggableView.OnDragListener() {
            @Override
            public void onDragComplete(DraggableView draggableView) {
                //拖拽效果有效回调
            }

            @Override
            public void onDisappearComplete(DraggableView draggableView) {
                //拖拽完成后销毁动画播放结束回调
            }
        });

License

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.

Versions

Version
0.1.0