9
I have giving the full code that I have.
The code bellow can drag and drop very smoothly but it is not working like what I need like bellow description.
- Drag Data Is (Apple, Orage, Ball)
- Drop target location is (A for, O for, B for)
So, if drag "Apple" drop to "A for" it will be CORRECT and update text to "A for Apple" and Text "Apple" at drag will be hide... but if we drag "Apple" drop to "O for" or "B for" it will be failed because "O for Orange" and "B for Ball".
Based on the below code, what should I add.
Layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="10dp"
android:paddingLeft="50dp"
android:paddingRight="50dp" >
<TextView
android:id="@+id/option_1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@drawable/option"
android:gravity="center"
android:text="Apple"
android:textStyle="bold" />
<TextView
android:id="@+id/option_2"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_margin="5dp"
android:background="@drawable/option"
android:gravity="center"
android:text="Orange"
android:textStyle="bold" />
<TextView
android:id="@+id/option_3"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_mar