Code Monkey home page Code Monkey logo

draggableview's Introduction

DraggableView

DraggableView is an Android library to make floating draggable view easy, currently it only extends from ImageView.

Setup

On root / project build.gradle file add maven { url 'https://jitpack.io' }

Example:

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

On app build.gradle add implementation 'com.github.hyuwah:DraggableView:LatestVersion'

Example:

dependencies {
            ...
	        implementation 'com.github.hyuwah:DraggableView:LatestVersion'
	        ...
	}

Note: check the number on jitpack badge above for latest version

Usage

Customizable Attributes

DraggableImageView

Attribute Value (Default) XML Code
Animate true, false (false) animate setAnimate(boolean isAnimate)
Sticky Axis NON_STICKY, STICKY_AXIS_X, STICKY_AXIS_Y, STICKY_AXIS_XY (NON_STICKY) sticky setStickyAxis(int axis)

Basic sample

On Layout XML file

<io.github.hyuwah.draggableviewlib.DraggableImageView
            android:src="@mipmap/ic_launcher_round"
            android:id="@+id/draggableView"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
    />

On Activity / Fragment file

var dv = findViewById<DraggableImageView>(R.id.draggableView)
dv.setOnClickListener {
    // TODO on click
}

Check example module for actual implementation

License

DraggableView is available under the MIT license. See the LICENSE file for more info.

draggableview's People

Contributors

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