Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!-- Copyright (C) 2009 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 <!-- In-call onscreen touch UI elements, used on some platforms.
     18 
     19      This layout is a fullscreen overlay, drawn on top of the
     20      non-touch-sensitive parts of the in-call UI (i.e. the call card).
     21 
     22      The top-level View here is a FrameLayout with 2 children:
     23        (1) incomingCallWidget: the UI displayed while an incoming call is ringing
     24        (2) inCallControls: the widgets visible while a regular call (or calls) is in progress
     25      Exactly one of these is visible at any given moment.
     26      -->
     27 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     28     xmlns:prvandroid="http://schemas.android.com/apk/prv/res/android"
     29     android:layout_width="match_parent"
     30     android:layout_height="match_parent"
     31     >
     32 
     33     <!--
     34         (1) incomingCallWidget: the UI displayed while an incoming call is ringing.
     35             See InCallTouchUi.showIncomingCallWidget().
     36 
     37             Layout notes:
     38             - Use an opaque black background since we need to cover up
     39               a bit of the bottom of the contact photo
     40             - The verticalOffset value gets us a little extra space above
     41               the topmost "Respond by SMS" icon
     42             - The negative layout_marginBottom shifts us slightly downward;
     43               we're already aligned with the bottom of the screen, but we
     44               don't have an icon in the downward direction so the whole
     45               bottom area of this widget is just wasted space.
     46     -->
     47     <com.android.internal.widget.multiwaveview.MultiWaveView
     48         android:id="@+id/incomingCallWidget"
     49         android:layout_width="match_parent"
     50         android:layout_height="wrap_content"
     51         android:layout_alignParentBottom="true"
     52         android:layout_marginBottom="-46dp"
     53         android:background="@android:color/black"
     54         android:visibility="gone"
     55 
     56         prvandroid:targetDrawables="@array/incoming_call_widget_3way_targets"
     57         prvandroid:targetDescriptions="@array/incoming_call_widget_3way_target_descriptions"
     58         prvandroid:directionDescriptions="@array/incoming_call_widget_3way_direction_descriptions"
     59         prvandroid:handleDrawable="@drawable/ic_in_call_touch_handle"
     60         prvandroid:waveDrawable="@*android:drawable/ic_lockscreen_outerring"
     61         prvandroid:outerRadius="@*android:dimen/multiwaveview_target_placement_radius"
     62         prvandroid:snapMargin="@*android:dimen/multiwaveview_snap_margin"
     63         prvandroid:hitRadius="@*android:dimen/multiwaveview_hit_radius"
     64         prvandroid:vibrationDuration="20"
     65         prvandroid:leftChevronDrawable="@*android:drawable/ic_lockscreen_chevron_left"
     66         prvandroid:rightChevronDrawable="@*android:drawable/ic_lockscreen_chevron_right"
     67         prvandroid:feedbackCount="3"
     68         prvandroid:horizontalOffset="0dip"
     69         prvandroid:verticalOffset="20dip"
     70         />
     71 
     72     <!--
     73         (2) inCallControls: the widgets visible while a regular call
     74         (or calls) is in progress
     75     -->
     76     <RelativeLayout android:id="@+id/inCallControls"
     77                     android:layout_width="match_parent"
     78                     android:layout_height="match_parent"
     79                     android:layout_alignParentTop="true"
     80                     android:visibility="gone"
     81                     >
     82         <!-- DTMF dialpad shown in the upper part of the screen
     83              (above the main cluster of buttons.) -->
     84         <ViewStub android:id="@+id/dtmf_twelve_key_dialer_stub"
     85                   android:layout="@layout/dtmf_twelve_key_dialer_view"
     86                   android:layout_width="match_parent"
     87                   android:layout_height="match_parent"
     88                   android:layout_above="@+id/bottomButtons"
     89                   android:layout_marginBottom="@dimen/dialpad_vertical_margin" />
     90 
     91         <!-- Main cluster of onscreen buttons on the lower part of the screen. -->
     92         <LinearLayout android:id="@+id/bottomButtons"
     93                       android:orientation="vertical"
     94                       android:layout_width="match_parent"
     95                       android:layout_height="wrap_content"
     96                       android:layout_alignParentBottom="true"
     97                       >
     98 
     99             <!-- Row 1, the "extra button row": A couple of relatively rare
    100                  buttons used only in certain call states.
    101                  Most of the time this whole row is GONE.
    102                  For now, at least, there's only ever one button visible here
    103                  at a time, so this can be a simple FrameLayout. -->
    104             <FrameLayout android:id="@+id/extraButtonRow"
    105                 android:layout_width="match_parent"
    106                 android:layout_height="wrap_content"
    107                 android:background="@drawable/dialpad_background_opaque"
    108                 android:paddingLeft="@dimen/button_cluster_side_padding"
    109                 android:paddingRight="@dimen/button_cluster_side_padding"
    110                 >
    111                 <!-- The buttons here have a text label floating off to the side
    112                      (which is necessary because these buttons are used only in
    113                      a few rare states, and the meaning of the icon might not be
    114                      obvious.)  The entire row (button + text) is clickable. -->
    115 
    116                 <!-- "Manage conference" -->
    117                 <!-- This button is used only on GSM devices, during a conference call. -->
    118                 <LinearLayout android:id="@+id/manageConferenceButton"
    119                     android:orientation="horizontal"
    120                     android:layout_width="match_parent"
    121                     android:layout_height="wrap_content"
    122                     android:background="?android:attr/selectableItemBackground"
    123                     >
    124                     <!-- The entire LinearLayout here is clickable, so we don't
    125                          care about clicks on the ImageButton itself. -->
    126                     <ImageButton android:id="@+id/manageConferenceButtonImage"
    127                         android:clickable="false"
    128                         style="@style/InCallButton"
    129                         android:src="@drawable/ic_groups_holo_dark"
    130                         android:contentDescription="@string/onscreenManageConferenceText"
    131                         />
    132                     <TextView android:id="@+id/manageConferenceButtonLabel"
    133                         style="@style/InCallExtraRowButtonLabel"
    134                         android:text="@string/onscreenManageConferenceText"
    135                         />
    136                 </LinearLayout>
    137 
    138                 <!-- CDMA-specific "Merge" -->
    139                 <!-- This button is used only on CDMA devices, where we can't use
    140                      the Merge button in the main button row (because the "Add Call"
    141                      button might need to be enabled at the same time.) -->
    142                 <LinearLayout android:id="@+id/cdmaMergeButton"
    143                     android:orientation="horizontal"
    144                     android:layout_width="match_parent"
    145                     android:layout_height="wrap_content"
    146                     android:background="?android:attr/selectableItemBackground"
    147                     >
    148                     <!-- The entire LinearLayout here is clickable, so we don't
    149                          care about clicks on the ImageButton itself. -->
    150                     <ImageButton android:id="@+id/cdmaMergeButtonImage"
    151                         android:clickable="false"
    152                         style="@style/InCallButton"
    153                         android:src="@drawable/ic_merge_holo_dark"
    154                         android:contentDescription="@string/onscreenMergeCallsText"
    155                         />
    156                     <TextView android:id="@+id/cdmaMergeButtonLabel"
    157                         style="@style/InCallExtraRowButtonLabel"
    158                         android:text="@string/onscreenMergeCallsText"
    159                         />
    160                 </LinearLayout>
    161 
    162             </FrameLayout>
    163 
    164 
    165             <!-- Row 2: The "End call" button. -->
    166             <!-- This is in its own LinearLayout purely so that the whole row
    167                  can have a background drawable distinct from the image itself. -->
    168             <LinearLayout
    169                 android:orientation="horizontal"
    170                 android:layout_width="match_parent"
    171                 android:layout_height="wrap_content"
    172                 android:background="@drawable/end_call_background"
    173                 >
    174                 <ImageButton android:id="@+id/endButton"
    175                     style="@style/InCallEndButton"
    176                     android:layout_width="match_parent"
    177                     android:src="@drawable/ic_end_call"
    178                     android:contentDescription="@string/onscreenEndCallText"
    179                     />
    180             </LinearLayout>
    181 
    182             <!-- Row 3: The main batch of in-call buttons:
    183                     Dialpad / Audio mode / Mute / Hold / Add call
    184                  Visible in all states except while an incoming call is
    185                  ringing. -->
    186             <LinearLayout
    187                 android:orientation="horizontal"
    188                 android:layout_width="match_parent"
    189                 android:layout_height="wrap_content"
    190                 android:background="@drawable/dialpad_background"
    191                 android:paddingLeft="@dimen/button_cluster_side_padding"
    192                 android:paddingRight="@dimen/button_cluster_side_padding"
    193                 >
    194 
    195                 <!-- This row has either 4 or 5 buttons, depending on
    196                      whether the device supports "Hold" (i.e. 4 buttons on
    197                      CDMA devices, 5 buttons on GSM devices.)  The buttons
    198                      are interspersed with 'layout_weight="1"' placeholder
    199                      views so that they'll be spaced evenly in both cases.
    200 
    201                      But note there are a couple of *pairs* of buttons that share a
    202                      single "slot", namely Hold/Swap and Add/Merge.  For these, the
    203                      code in InCallTouchUi is responsible for making sure that at any
    204                      point exactly one of the pair is VISIBLE and the other is
    205                      GONE. -->
    206 
    207                 <View
    208                     android:layout_width="0dp"
    209                     android:layout_weight="1"
    210                     android:layout_height="match_parent" />
    211 
    212                 <!-- "Dialpad" -->
    213                 <!-- This is a "compound button": it has checked and unchecked states. -->
    214                 <ToggleButton android:id="@+id/dialpadButton"
    215                     style="@style/InCallCompoundButton"
    216                     android:background="@drawable/btn_compound_dialpad"
    217                     android:contentDescription="@string/onscreenShowDialpadText"
    218                     />
    219 
    220                 <View
    221                     android:layout_width="0dp"
    222                     android:layout_weight="1"
    223                     android:layout_height="match_parent" />
    224 
    225 
    226                 <!-- "Audio mode" -->
    227                 <!-- This is a multi-mode button that can behave either like a
    228                      simple "compound button" with two states *or* like an
    229                      action button that brings up a popup menu; see
    230                      btn_compound_audio.xml and InCallTouchUi.updateAudioButton()
    231                      for the full details. -->
    232                 <ToggleButton android:id="@+id/audioButton"
    233                     style="@style/InCallCompoundButton"
    234                     android:background="@drawable/btn_compound_audio"
    235                     android:contentDescription="@string/onscreenAudioText"
    236                     />
    237 
    238                 <View
    239                     android:layout_width="0dp"
    240                     android:layout_weight="1"
    241                     android:layout_height="match_parent" />
    242 
    243                 <!-- "Mute" -->
    244                 <!-- This is a "compound button": it has checked and unchecked states. -->
    245                 <ToggleButton android:id="@+id/muteButton"
    246                     style="@style/InCallCompoundButton"
    247                     android:background="@drawable/btn_compound_mute"
    248                     android:contentDescription="@string/onscreenMuteText"
    249                     />
    250 
    251                 <View
    252                     android:layout_width="0dp"
    253                     android:layout_weight="1"
    254                     android:layout_height="match_parent" />
    255 
    256                 <!-- This slot is either "Hold" or "Swap", depending on
    257                      the state of the call.   One or the other of these
    258                      must always be set to GONE. -->
    259                 <!-- "Hold" -->
    260                 <!-- This is a "compound button": it has checked and unchecked states. -->
    261                 <ToggleButton android:id="@+id/holdButton"
    262                     style="@style/InCallCompoundButton"
    263                     android:background="@drawable/btn_compound_hold"
    264                     android:contentDescription="@string/onscreenHoldText"
    265                     />
    266                 <!-- "Swap" (or "Manage calls" in some CDMA states) -->
    267                 <ImageButton android:id="@+id/swapButton"
    268                     style="@style/InCallButton"
    269                     android:src="@drawable/ic_incall_switch_holo_dark"
    270                     android:contentDescription="@string/onscreenSwapCallsText"
    271                     />
    272 
    273                 <View android:id="@+id/holdSwapSpacer"
    274                     android:layout_width="0dp"
    275                     android:layout_weight="1"
    276                     android:layout_height="match_parent" />
    277 
    278                 <!-- This slot is either "Add" or "Merge", depending on
    279                      the state of the call.  One or the other of these
    280                      must always be set to GONE. -->
    281                 <!-- "Add Call" -->
    282                 <ImageButton android:id="@+id/addButton"
    283                     style="@style/InCallButton"
    284                     android:src="@drawable/ic_add_contact_holo_dark"
    285                     android:contentDescription="@string/onscreenAddCallText"
    286                     />
    287                 <!-- "Merge calls" -->
    288                 <!-- This button is used only on GSM devices, where we know
    289                      that "Add" and "Merge" are never available at the same time.
    290                      The "Merge" button for CDMA devices is "cdmaMergeButton" above. -->
    291                 <ImageButton android:id="@+id/mergeButton"
    292                     style="@style/InCallButton"
    293                     android:src="@drawable/ic_merge_holo_dark"
    294                     android:contentDescription="@string/onscreenMergeCallsText"
    295                     />
    296 
    297                 <View
    298                     android:layout_width="0dp"
    299                     android:layout_weight="1"
    300                     android:layout_height="match_parent" />
    301 
    302             </LinearLayout>
    303 
    304         </LinearLayout>
    305 
    306     </RelativeLayout>
    307 
    308 </RelativeLayout>
    309