Skip to content

DraggableView 0.3.0

Compare
Choose a tag to compare
@hyuwah hyuwah released this 28 Oct 04:45
· 11 commits to master since this release

Make extensions function callable in java to apply draggable behaviour to any View on java class via DraggableUtils class

Usage

Here's some example using Button:

on XML:

<Button
            android:id="@+id/tv_test_draggable"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="DRAGGABLE BUTTON!" />

on Java class:

Button button = findViewById(R.id.tv_test_draggable);

DraggableUtils.makeDraggable(button, Draggable.STICKY.AXIS_X, true); // default is STICKY.NONE & animated true

// First param is the view

// Second param is the axis:
// - Draggable.STICKY.AXIS_X
// - Draggable.STICKY.AXIS_Y
// - Draggable.STICKY.AXIS_XY
// - Draggable.STICKY.NONE

// Third param is animation toggle
// - true or false