drag_layout.xml

← Back

The file containing the source code shown below is located in the corresponding directory in <sdk>/samples/android-<version>/...

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2010 The Android Open Source Project
     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at
          http://www.apache.org/licenses/LICENSE-2.0
     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->
<!-- Layout description of the DragAndDrop sample's main activity -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:dot="http://schemas.android.com/apk/res/com.example.android.apis"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    >
    <TextView android:id="@+id/drag_explanation"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/drag_explanation"
        />
    <com.example.android.apis.view.DraggableDot
        android:id="@+id/drag_dot_1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        dot:radius="64dp"
        android:padding="15dp"
        android:layout_below="@id/drag_explanation"
        />
    <com.example.android.apis.view.DraggableDot
        android:id="@+id/drag_dot_2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        dot:radius="64dp"
        android:padding="15dp"
        android:layout_below="@id/drag_explanation"
        android:layout_toRightOf="@id/drag_dot_1"
        dot:legend="Drag ANR"
        dot:anr="thumbnail"
        />
    <com.example.android.apis.view.DraggableDot
        android:id="@+id/drag_dot_3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        dot:radius="64dp"
        android:padding="15dp"
        android:layout_below="@id/drag_dot_1"
        android:layout_alignLeft="@id/drag_dot_1"
        dot:legend="Drop ANR"
        dot:anr="drop"
        />
    <com.example.android.apis.view.DraggableDot
        android:id="@+id/drag_dot_hidden"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        dot:radius="64dp"
        android:padding="15dp"
        android:layout_toRightOf="@id/drag_dot_3"
        android:layout_alignTop="@id/drag_dot_3"
        android:visibility="invisible"
        dot:legend="Surprise!"
        />
    <TextView android:id="@+id/drag_result_text"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_below="@id/drag_explanation"
        android:layout_alignRight="@id/drag_explanation"
        android:layout_toRightOf="@id/drag_dot_2"
        />
    <TextView android:id="@+id/drag_text"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1"
        android:layout_below="@id/drag_dot_3"
        android:layout_alignLeft="@id/drag_dot_3"
        />
</RelativeLayout>