Drag and Drop
Drag and Drop:
Android development, Drag and Drop refers to a feature of user interface interaction where a user can pick icons, pictures or some other objects, move it using fingers and place it on a panel or screen or a different location.
It is mostly employed to offer a more natural and friendly approach to the users and can be employed in applications.
Example:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity"
android:transitionGroup="true"
android:padding="16dp"
android:layout_gravity="center"
android:gravity="center">
<TextView
android:id="@+id/drag_drop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Drag and Drop Image Anywhere"
android:textSize="22dp"
android:textStyle="bold"
android:textColor="#000000"
android:gravity="center"
android:layout_centerHorizontal="true"
android:layout_marginTop="20dp"/>
<ImageView
android:id="@+id/drag_image"
android:layout_width="70dp"
android:layout_height="70dp"
android:src="@drawable/ic_microphone"
android:layout_below="@id/drag_drop"
android:layout_centerHorizontal="true"
android:layout_marginTop="50dp"/>
</RelativeLayout>