<?xml version="1.0" encoding="utf-8"?>
<!--
/*
 * Copyright (c) 2013, The Linux Foundation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *        * Redistributions of source code must retain the above copyright
 *            notice, this list of conditions and the following disclaimer.
 *        * Redistributions in binary form must reproduce the above copyright
 *            notice, this list of conditions and the following disclaimer in the
 *            documentation and/or other materials provided with the distribution.
 *        * Neither the name of The Linux Foundation nor
 *            the names of its contributors may be used to endorse or promote
 *            products derived from this software without specific prior written
 *            permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NON-INFRINGEMENT ARE DISCLAIMED.    IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-->
<ViewFlipper xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/pbap_test_viewflipper"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" >

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/label_download_phonebook_prompt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:text="@string/phonebook_prompt" />

            <Spinner
                android:id="@+id/pbap_download_spinner"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:entries="@array/phonebook_arrays"
                android:prompt="@string/phonebook_prompt"
                android:layout_alignParentLeft="true"
                android:layout_below="@+id/label_download_phonebook_prompt"/>

            <TextView
                android:id="@+id/label_download_format_prompt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pbap_download_spinner"
                android:layout_marginTop="5dp"
                android:text="@string/vcard_format_prompt" />

            <RadioGroup
                android:id="@+id/pbap_download_formats"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/label_download_format_prompt"
                android:orientation="horizontal" >

                <RadioButton
                    android:id="@+id/pbap_download_vcard21"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/vcard21"
                    android:checked="true" />

                <RadioButton
                    android:id="@+id/pbap_download_vcard30"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/vcard30" />
            </RadioGroup>

            <LinearLayout
                android:id="@+id/pbap_layout_1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pbap_download_formats"
                android:layout_marginTop="5dp" >
                <TextView
                    android:id="@+id/label_download_list_count_prompt"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/max_list_count_prompt"
                    android:layout_weight="1.0" />
                <TextView
                    android:id="@+id/label_download_offset_prompt"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/offset_prompt"
                    android:layout_weight="1.0" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/pbap_layout_2"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pbap_layout_1"
                android:layout_marginTop="5dp" >
                <EditText
                    android:id="@+id/pbap_download_max_list_count"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:inputType="number"
                    android:layout_weight="1.0" />
                <EditText
                    android:id="@+id/pbap_download_offset_value"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:inputType="number"
                    android:layout_weight="1.0" />
            </LinearLayout>

            <Button
                android:id="@+id/pbap_download_filter_button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/filter_button"
                android:layout_below="@+id/pbap_layout_2"
                android:layout_marginTop="5dp" />

            <Button
                android:id="@+id/pbap_download_search"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentRight="true"
                android:text="@string/search"
                android:layout_marginBottom="15dp"
                android:layout_marginRight="15dp" />

            <Button
                android:id="@+id/pbap_download_abort"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_toLeftOf="@id/pbap_download_search"
                android:text="@string/abort"
                android:layout_marginBottom="15dp"
                android:layout_marginRight="15dp"
                android:onClick="onClick_abort" />

            <Button
                android:id="@+id/pbap_download_getsize"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_toLeftOf="@id/pbap_download_abort"
                android:text="@string/getsize"
                android:layout_marginBottom="15dp"
                android:layout_marginRight="15dp"
                android:onClick="onClick_download_getsize" />

        </RelativeLayout>

        <LinearLayout
            android:id="@+id/pbap_download_layout_listview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:orientation="vertical" >
            <ListView android:id="@+id/pbap_download_listview_contacts_list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <ProgressBar
                android:id="@+id/pbap_download_progress_bar"
                style="?android:attr/progressBarStyleLarge"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|center_horizontal" />

            <TextView
                android:id="@+id/pbap_download_test_list_empty"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:text="@string/list_empty" />
        </LinearLayout>
    </LinearLayout>
</RelativeLayout>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" >

        <RelativeLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:orientation="vertical" >

            <TextView
                android:id="@+id/label_browse_phonebook_prompt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentLeft="true"
                android:layout_alignParentTop="true"
                android:text="@string/phonebook_prompt" />

             <LinearLayout
                android:id="@+id/pbap_browse_pb_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:layout_below="@+id/label_browse_phonebook_prompt" >

                 <Spinner
                     android:id="@+id/pbap_browse_spinner"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:entries="@array/phonebook_arrays"
                     android:prompt="@string/phonebook_prompt" />

                 <Button
                     android:id="@+id/pbap_browse_set_phonebook"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:text="@string/set_phonebook"
                     android:layout_marginRight="15dp"
                     android:tag="pbap_browse_spinner"
                     android:onClick="onClick_setPhonebook" />
             </LinearLayout>


            <TextView
                android:id="@+id/label_search_attribute_prompt"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pbap_browse_pb_group"
                android:layout_marginTop="5dp"
                android:text="@string/search_attribute_prompt" />

            <RadioGroup
                android:id="@+id/search_attributes"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/label_search_attribute_prompt"
                android:orientation="horizontal" >

                <RadioButton
                    android:id="@+id/pbap_browse_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/search_attribute_name"
                    android:checked="true" />

                <RadioButton
                    android:id="@+id/pbap_browse_number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/search_attribute_number" />

                <RadioButton
                    android:id="@+id/pbap_browse_sound"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/search_attribute_sound" />
            </RadioGroup>

            <TextView
                android:id="@+id/label_search_value"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/search_attributes"
                android:layout_marginTop="5dp"
                android:text="@string/search_value_prompt" />

            <EditText
                android:id="@+id/pbap_browse_search_value"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/label_search_value"
                android:ems="10" />

            <LinearLayout
                android:id="@+id/pbap_layout_3"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pbap_browse_search_value"
                android:layout_marginTop="5dp" >
                <TextView
                    android:id="@+id/label_browse_list_count_prompt"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/max_list_count_prompt"
                    android:layout_weight="1.0" />
                <TextView
                    android:id="@+id/label_browse_offset_prompt"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/offset_prompt"
                    android:layout_weight="1.0" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/pbap_layout_4"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pbap_layout_3"
                android:layout_marginTop="5dp" >
                <EditText
                    android:id="@+id/pbap_browse_max_list_count"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:inputType="number"
                    android:layout_weight="1.0" />
                <EditText
                    android:id="@+id/pbap_browse_offset_value"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:ems="10"
                    android:inputType="number"
                    android:layout_weight="1.0" />
            </LinearLayout>

            <RadioGroup
                android:id="@+id/order_attribute"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/pbap_layout_4"
                android:orientation="horizontal" >

                <RadioButton
                    android:id="@+id/pbap_browse_unordered"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/order_attribute_unordered"
                    android:checked="true" />

                <RadioButton
                    android:id="@+id/pbap_browse_alphabetical"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/order_attribute_alphabetical" />

                <RadioButton
                    android:id="@+id/pbap_browse_indexed"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/order_attribute_indexed" />

                <RadioButton
                    android:id="@+id/pbap_browse_phonetic"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/order_attribute_phonetic" />
            </RadioGroup>

            <Button
                android:id="@+id/pbap_browse_search"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentRight="true"
                android:text="@string/search"
                android:layout_marginBottom="15dp"
                android:layout_marginRight="15dp" />


            <Button
                android:id="@+id/pbap_browse_abort"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_toLeftOf="@id/pbap_browse_search"
                android:text="@string/abort"
                android:layout_marginBottom="15dp"
                android:layout_marginRight="15dp"
                android:onClick="onClick_abort" />

            <Button
                android:id="@+id/pbap_browse_getsize"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_toLeftOf="@id/pbap_browse_abort"
                android:text="@string/getsize"
                android:layout_marginBottom="15dp"
                android:layout_marginRight="15dp"
                android:onClick="onClick_browse_getsize" />

        </RelativeLayout>

        <LinearLayout
            android:id="@+id/pbap_browse_layout_listview"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_weight="1"
            android:orientation="vertical" >
            <ListView android:id="@+id/pbap_browse_listview_contacts_list"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <ProgressBar
                android:id="@+id/pbap_browse_progress_bar"
                style="?android:attr/progressBarStyleLarge"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|center_horizontal" />

            <TextView
                android:id="@+id/pbap_browse_test_list_empty"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:text="@string/list_empty" />
        </LinearLayout>
    </LinearLayout>
</RelativeLayout>

<RelativeLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_weight="1" >

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="@string/phonebook_prompt" />

             <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal" >

                 <Spinner
                     android:id="@+id/pbap_vcard_spinner"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:entries="@array/phonebook_arrays"
                     android:prompt="@string/phonebook_prompt" />

                 <Button
                     android:id="@+id/pbap_vcard_set_phonebook"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_weight="1"
                     android:text="@string/set_phonebook"
                     android:layout_marginRight="15dp"
                     android:tag="pbap_vcard_spinner"
                     android:onClick="onClick_setPhonebook" />
             </LinearLayout>

             <TextView
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:text="@string/vcard_header_prompt" />

             <EditText
                 android:id="@+id/pbap_vcard_header"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:ems="10"
                 android:inputType="text" />

             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:layout_marginTop="5dp"
                 android:text="@string/vcard_format_prompt" />

             <RadioGroup
                 android:id="@+id/pbab_vcard_formats"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:orientation="horizontal" >

                 <RadioButton
                     android:id="@+id/pbap_vcard_vcard21"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:text="@string/vcard21"
                     android:checked="true"
                     android:onClick="onClickRadioButtonVcardType21" />

                 <RadioButton
                     android:id="@+id/pbap_vcard_vcard30"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:text="@string/vcard30"
                     android:onClick="onClickRadioButtonVcardType30" />
             </RadioGroup>

             <Button
                 android:id="@+id/pbap_vcard_filter_button"
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:text="@string/filter_button"
                 android:layout_marginTop="5dp"
                 android:onClick="onClickVcardFilterAttributes"/>

             <Button
                 android:id="@+id/pbap_vcard_get_vcard"
                 android:layout_width="wrap_content"
                 android:layout_height="wrap_content"
                 android:layout_gravity="right"
                 android:layout_marginTop="50dp"
                 android:text="@string/get_vcard"
                 android:onClick="onClickVcardButtonGet" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1" >

            <org.codeaurora.bluetooth.bttestapp.VcardView
                android:id="@+id/pbap_vcard_vcardview"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

        </LinearLayout>
    </LinearLayout>
</RelativeLayout>
</ViewFlipper>
