<?xml version="1.0" encoding="utf-8"?>
<!--
     Copyright (C) 2013 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.
-->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center_horizontal"
        android:orientation="vertical" >

        <!-- Current device -->

        <TextView
            android:id="@+id/connected_device"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="fill"
            android:gravity="center"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textIsSelectable="false" />

        <View style="@style/Separator" />

        <!-- Current media information -->

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

            <ImageView
                android:id="@+id/media_art"
                android:layout_width="90dp"
                android:layout_height="135dp"
                android:layout_marginLeft="5dp"
                android:background="@android:color/black"
                android:contentDescription="@string/media_art_description"
                android:padding="1dp"
                android:scaleType="centerInside" />

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="5dp"
                android:layout_marginRight="5dp"
                android:layout_weight="1"
                android:gravity="center_horizontal"
                android:orientation="vertical" >

                <TextView
                    android:id="@+id/media_title"
                    android:layout_width="match_parent"
                    android:layout_height="0dp"
                    android:layout_gravity="fill"
                    android:layout_marginBottom="5dp"
                    android:layout_weight="1"
                    android:gravity="center_horizontal"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textIsSelectable="false" />

                <TextView
                    android:id="@+id/media_artist"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center_horizontal"
                    android:textAppearance="?android:attr/textAppearanceSmall"
                    android:textIsSelectable="false" />
            </LinearLayout>
        </LinearLayout>

        <View style="@style/Separator" />

        <!-- App controls -->

        <LinearLayout
            android:id="@+id/app_controls"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical" >

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

                <Button
                    android:id="@+id/launch_app"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="fill"
                    android:layout_weight="1"
                    android:enabled="false"
                    android:text="@string/launch_app" />

                <Button
                    android:id="@+id/join_app"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="fill"
                    android:layout_weight="1"
                    android:enabled="false"
                    android:text="@string/join_app" />
            </LinearLayout>

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

                <Button
                    android:id="@+id/leave_app"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="fill"
                    android:layout_weight="1"
                    android:enabled="false"
                    android:text="@string/leave_app" />

                <Button
                    android:id="@+id/stop_app"
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_gravity="fill"
                    android:layout_weight="1"
                    android:enabled="false"
                    android:text="@string/stop_app" />
            </LinearLayout>
        </LinearLayout>

        <TextView
            android:id="@+id/app_status"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="fill"
            android:gravity="center"
            android:textAppearance="?android:attr/textAppearanceMedium"
            android:textIsSelectable="false" />

        <!-- Session controls -->

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

            <Button
                android:id="@+id/start_session"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="fill"
                android:layout_weight="1"
                android:enabled="false"
                android:text="@string/start_session" />

            <Button
                android:id="@+id/end_session"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="fill"
                android:layout_weight="1"
                android:enabled="false"
                android:text="@string/end_session" />
        </LinearLayout>

        <View
            android:id="@+id/app_controls_separator"
            style="@style/Separator" />

        <!-- Media controls -->

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginBottom="10dp"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:gravity="center"
            android:orientation="horizontal" >

            <Button
                android:id="@+id/play_media_button"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="fill"
                android:layout_weight="1"
                android:enabled="false"
                android:text="@string/play_media" />

            <Button
                android:id="@+id/pause_play"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="fill"
                android:layout_weight="1"
                android:enabled="false"
                android:text="@string/pause" />

            <Button
                android:id="@+id/stop"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="fill"
                android:layout_weight="1"
                android:enabled="false"
                android:text="@string/stop" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/seek_behavior_controls"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp"
            android:gravity="center_horizontal" >

            <CheckBox
                android:id="@+id/autoplay_checkbox"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:checked="true"
                android:enabled="false"
                android:text="@string/autoplay"
                android:textAppearance="?android:attr/textAppearanceSmall" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="15dp"
                android:layout_marginRight="10dp"
                android:text="@string/after_seek"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textIsSelectable="false" />

            <Spinner
                android:id="@+id/seek_behavior_spinner"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:entries="@array/seek_behaviors" />
        </LinearLayout>

        <!-- seek bar and time indicators -->

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

            <TextView
                android:id="@+id/stream_position"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginLeft="15dp"
                android:layout_weight="1"
                android:gravity="left"
                android:text="@string/no_time"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textIsSelectable="false" />

            <TextView
                android:id="@+id/stream_duration"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_marginRight="15dp"
                android:layout_weight="1"
                android:gravity="right"
                android:text="@string/no_time"
                android:textAppearance="?android:attr/textAppearanceMedium"
                android:textIsSelectable="false" />
        </LinearLayout>

        <SeekBar
            android:id="@+id/seek_bar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="center"
            android:layout_marginLeft="5dp"
            android:layout_marginRight="5dp" />

        <View
            android:id="@+id/seek_controls_separator"
            style="@style/Separator" />

        <!-- device volume controls -->

        <LinearLayout
            android:id="@+id/device_volume_controls"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:layout_marginTop="15dp"
            android:gravity="center_horizontal"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="15dp"
                android:layout_marginRight="10dp"
                android:layout_weight="0"
                android:text="@string/device_volume"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textIsSelectable="false" />

            <SeekBar
                android:id="@+id/device_volume_bar"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="0dp"
                android:layout_marginRight="0dp"
                android:layout_weight="1" />

            <CheckBox
                android:id="@+id/device_mute_checkbox"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="15dp"
                android:layout_weight="0"
                android:text="@string/mute" />
        </LinearLayout>

        <!-- stream volume controls -->

        <LinearLayout
            android:id="@+id/stream_volume_controls"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="5dp"
            android:layout_marginTop="15dp"
            android:gravity="center_horizontal"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="15dp"
                android:layout_marginRight="10dp"
                android:layout_weight="0"
                android:text="@string/stream_volume"
                android:textAppearance="?android:attr/textAppearanceSmall"
                android:textIsSelectable="false" />

            <SeekBar
                android:id="@+id/stream_volume_bar"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="0dp"
                android:layout_marginRight="0dp"
                android:layout_weight="1" />

            <CheckBox
                android:id="@+id/stream_mute_checkbox"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="15dp"
                android:layout_weight="0"
                android:text="@string/mute" />
        </LinearLayout>

    </LinearLayout>

</ScrollView>