Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2013 The Android Open Source Project
      3 
      4      Licensed under the Apache License, Version 2.0 (the "License");
      5      you may not use this file except in compliance with the License.
      6      You may obtain a copy of the License at
      7 
      8           http://www.apache.org/licenses/LICENSE-2.0
      9 
     10      Unless required by applicable law or agreed to in writing, software
     11      distributed under the License is distributed on an "AS IS" BASIS,
     12      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13      See the License for the specific language governing permissions and
     14      limitations under the License.
     15 -->
     16 
     17 <!-- See corresponding Java code MainActivity.java. -->
     18 
     19 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     20         android:layout_width="match_parent"
     21         android:layout_height="match_parent"
     22         android:orientation="vertical">
     23     <LinearLayout
     24         android:layout_width="match_parent"
     25         android:layout_height="0dp"
     26         android:layout_weight="1"
     27         android:orientation="vertical">
     28         <!-- Tabs for media library, playlist and statistics -->
     29         <TabHost android:id="@+id/tabHost"
     30             android:layout_width="fill_parent"
     31             android:layout_height="fill_parent"
     32             android:layout_weight="1">
     33             <LinearLayout
     34                 android:orientation="vertical"
     35                 android:layout_width="fill_parent"
     36                 android:layout_height="fill_parent">
     37                 <TabWidget android:id="@android:id/tabs"
     38                     android:layout_width="fill_parent"
     39                     android:layout_height="wrap_content" />
     40 
     41                 <FrameLayout android:id="@android:id/tabcontent"
     42                     android:layout_width="fill_parent"
     43                     android:layout_height="wrap_content">
     44                     <LinearLayout android:id="@+id/tab1"
     45                         android:layout_width="fill_parent"
     46                         android:layout_height="wrap_content"
     47                         android:orientation="vertical">
     48                         <ListView android:id="@+id/media"
     49                                   android:listSelector="@drawable/list_background"
     50                             android:layout_width="match_parent"
     51                             android:layout_height="wrap_content"
     52                             android:layout_weight="1" />
     53                     </LinearLayout>
     54 
     55                     <LinearLayout android:id="@+id/tab2"
     56                         android:layout_width="fill_parent"
     57                         android:layout_height="fill_parent"
     58                         android:orientation="vertical">
     59                         <ListView android:id="@+id/playlist"
     60                             android:layout_width="match_parent"
     61                             android:layout_height="wrap_content"
     62                             android:layout_weight="1"/>
     63                     </LinearLayout>
     64 
     65                     <LinearLayout android:id="@+id/tab3"
     66                         android:layout_width="fill_parent"
     67                         android:layout_height="fill_parent"
     68                         android:orientation="vertical">
     69                         <TextView android:id="@+id/info"
     70                             android:layout_width="match_parent"
     71                             android:layout_height="wrap_content"
     72                             android:layout_weight="1"
     73                             android:textAppearance="?android:attr/textAppearanceMedium"/>
     74                     </LinearLayout>
     75                 </FrameLayout>
     76             </LinearLayout>
     77         </TabHost>
     78 
     79         <!-- Control buttons for the currently selected route. -->
     80         <LinearLayout
     81             android:layout_width="match_parent"
     82             android:layout_height="wrap_content"
     83             android:layout_weight="0">
     84 
     85             <SeekBar android:id="@+id/seekbar"
     86                  android:layout_width="fill_parent"
     87                  android:layout_height="wrap_content"
     88                  style="?android:attr/progressBarStyleHorizontal"
     89                  android:max="100"
     90                  android:progress="0"
     91                  android:layout_gravity="center"
     92                  android:layout_weight="1"/>
     93 
     94             <ImageButton android:id="@+id/pause_resume_button"
     95                 android:layout_width="wrap_content"
     96                 android:layout_height="wrap_content"
     97                 android:layout_weight="0"
     98                 android:layout_gravity="right"
     99                 android:minWidth="48dp"
    100                 android:minHeight="48dp"
    101                 android:background="@null"
    102                 android:src="@drawable/ic_action_pause" />
    103 
    104             <ImageButton android:id="@+id/stop_button"
    105                 android:layout_width="wrap_content"
    106                 android:layout_height="wrap_content"
    107                 android:layout_weight="0"
    108                 android:layout_gravity="right"
    109                 android:minWidth="48dp"
    110                 android:minHeight="48dp"
    111                 android:background="@null"
    112                 android:src="@drawable/ic_action_stop" />
    113         </LinearLayout>
    114 
    115     </LinearLayout>
    116 
    117     <!-- Some content for visual interest in the case where no presentation is showing. -->
    118     <FrameLayout android:id="@+id/player"
    119         android:background="#ff000000"
    120         android:layout_width="match_parent"
    121         android:layout_height="0dp"
    122         android:layout_weight="1">
    123         <LinearLayout
    124             android:layout_width="match_parent"
    125             android:layout_height="match_parent"
    126             android:gravity="center">
    127             <SurfaceView android:id="@+id/surface_view"
    128                 android:layout_width="match_parent"
    129                 android:layout_height="match_parent"/>
    130         </LinearLayout>
    131         <TextView
    132             android:textColor="#ffaaaaaa"
    133             android:text="@string/sample_media_route_activity_local"
    134             android:layout_width="wrap_content"
    135             android:layout_height="wrap_content"
    136             android:layout_gravity="top|center_horizontal" />
    137     </FrameLayout>
    138 </LinearLayout>
    139