Git Product home page Git Product logo

dragview's Introduction

DragView

Download
一个类似IOS小圆点的可拖动控件

使用方式

implementation 'com.xiong.widget:dragview:1.0.3'

属性相关

animationTime 动画时间
backgroundColor 背景颜色
foregroundImage 前景图
bounce 是否开启反弹动画
welt 是否贴边
dragWidth 拖动控件的宽
dragHeight 拖动控件的高
marginLeft 控件居左距离
marginRight 控件居右距离(不能同时设置marginLeft,否则该属性无效)
marginTop 控件居顶距离
marginBottom 控件居底距离(不能同时设置marginTop,否则该属性无效)

布局文件

<FrameLayout>

    //可拖动区域的布局
    <LinearLayout...>

    <com.xiong.DragView
        android:id="@+id/drag"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:animationTime="200"
        app:backgroundColor="#f9f035"
        app:bounce="true"
        app:dragHeight="60"
        app:dragWidth="60"
        app:marginRight="100"
        app:marginTop="100"
        app:foregroundImage="@mipmap/ic_launcher"
        app:welt="true" />

</FrameLayout>

Java代码

mDragView = findViewById(R.id.drag);
mDragView.onClickListener(new DragView.OnClickListener() {
    @Override
    public void onClick() {
        Toast.makeText(activity,"Touch",Toast.LENGTH_SHORT).show();
    }
});

效果如图:
贴边 回弹 时间
使用中遇到什么问题请issues反馈
或者QQ联系我:619291607,备注Git

dragview's People

Contributors

xiong955 avatar

Stargazers

 avatar Luis avatar Bazookaa avatar 杨学强 avatar  avatar keven chen avatar  avatar 小豆丁 avatar

Watchers

James Cloos avatar

Forkers

smk524198002

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.