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 InCallTouchUi (FrameLayout) with 2 children:
     23        (1) inCallControls: the widgets visible while a regular call (or calls) is in progress
     24        (2) incomingCallWidget: the UI displayed while an incoming call is ringing
     25      In usual cases, one of these is visible at any given moment.
     26      One exception is when incomingCallWidget is fading-out. At that moment, we show
     27      inCallControls beneath incomingCallWidget for smoother transition.
     28      -->
     29 <com.android.phone.InCallTouchUi xmlns:android="http://schemas.android.com/apk/res/android"
     30     xmlns:prvandroid="http://schemas.android.com/apk/prv/res/android"
     31     android:layout_width="match_parent"
     32     android:layout_height="match_parent"
     33     >
     34 
     35     <!--
     36         (1) inCallControls: the widgets visible while a regular call
     37         (or calls) is in progress
     38     -->
     39     <RelativeLayout android:id="@+id/inCallControls"
     40                     android:layout_width="match_parent"
     41                     android:layout_height="match_parent"
     42                     android:visibility="gone"
     43                     >
     44         <!-- DTMF dialpad shown in the upper part of the screen
     45              (above the main cluster of buttons.) -->
     46         <ViewStub android:id="@+id/dtmf_twelve_key_dialer_stub"
     47                   android:layout="@layout/dtmf_twelve_key_dialer_view"
     48                   android:layout_width="match_parent"
     49                   android:layout_height="match_parent"
     50                   android:layout_above="@+id/bottomButtons"
     51                   android:layout_marginBottom="@dimen/dialpad_vertical_margin" />
     52 
     53         <!-- Main cluster of onscreen buttons on the lower part of the screen. -->
     54         <LinearLayout android:id="@+id/bottomButtons"
     55                       android:orientation="vertical"
     56                       android:layout_width="match_parent"
     57                       android:layout_height="wrap_content"
     58                       android:layout_alignParentBottom="true">
     59 
     60             <!-- Row 1, the "extra button row": A couple of relatively rare
     61                  buttons used only in certain call states.
     62                  Most of the time this whole row is GONE.
     63                  For now, at least, there's only ever one button visible here
     64                  at a time, so this can be a simple FrameLayout. -->
     65             <ViewStub android:id="@+id/extraButtonRow"
     66                       android:layout="@layout/extra_button_row"
     67                       android:layout_width="match_parent"
     68                       android:layout_height="wrap_content" />
     69 
     70             <!-- Row 2: The "End call" button. -->
     71             <ImageButton android:id="@+id/endButton"
     72                 style="@style/InCallEndButton"
     73                 android:layout_width="match_parent"
     74                 android:src="@drawable/ic_dial_end_call"
     75                 android:background="@drawable/end_call_background"
     76                 android:contentDescription="@string/onscreenEndCallText" />
     77 
     78             <!-- Row 3: The main batch of in-call buttons:
     79                     Dialpad / Audio mode / Mute / Hold / Add call
     80                  Visible in all states except while an incoming call is
     81                  ringing. -->
     82             <LinearLayout
     83                 android:orientation="horizontal"
     84                 android:layout_width="match_parent"
     85                 android:layout_height="wrap_content"
     86                 android:background="@drawable/dialpad_background"
     87                 android:paddingLeft="@dimen/button_cluster_side_padding"
     88                 android:paddingRight="@dimen/button_cluster_side_padding"
     89                 >
     90 
     91                 <!-- This row has either 4 or 5 buttons, depending on
     92                      whether the device supports "Hold" (i.e. 4 buttons on
     93                      CDMA devices, 5 buttons on GSM devices.)  The buttons
     94                      are interspersed with 'layout_weight="1"' placeholder
     95                      views so that they'll be spaced evenly in both cases.
     96 
     97                      But note there are a couple of *pairs* of buttons that share a
     98                      single "slot", namely Hold/Swap and Add/Merge.  For these, the
     99                      code in InCallTouchUi is responsible for making sure that at any
    100                      point exactly one of the pair is VISIBLE and the other is
    101                      GONE. -->
    102 
    103                 <!-- Separator between left padding and 1st button -->
    104                 <View style="@style/VerticalSeparator" />
    105 
    106                 <!-- "Dialpad" -->
    107                 <!-- This is a "compound button": it has checked and unchecked states. -->
    108                 <ToggleButton android:id="@+id/dialpadButton"
    109                     style="@style/InCallCompoundButton"
    110                     android:background="@drawable/btn_compound_dialpad"
    111                     android:contentDescription="@string/onscreenShowDialpadText"
    112                     />
    113 
    114                 <!-- Separator between 1st and 2nd button -->
    115                 <View style="@style/VerticalSeparator" />
    116 
    117                 <!-- "Audio mode" -->
    118                 <!-- This is a multi-mode button that can behave either like a
    119                      simple "compound button" with two states *or* like an
    120                      action button that brings up a popup menu; see
    121                      btn_compound_audio.xml and InCallTouchUi.updateAudioButton()
    122                      for the full details. -->
    123                 <ToggleButton android:id="@+id/audioButton"
    124                     style="@style/InCallCompoundButton"
    125                     android:background="@drawable/btn_compound_audio"
    126                     android:contentDescription="@string/onscreenAudioText"
    127                     />
    128 
    129                 <!-- Separator between 2nd and 3rd button -->
    130                 <View style="@style/VerticalSeparator" />
    131 
    132                 <!-- "Mute" -->
    133                 <!-- This is a "compound button": it has checked and unchecked states. -->
    134                 <ToggleButton android:id="@+id/muteButton"
    135                     style="@style/InCallCompoundButton"
    136                     android:background="@drawable/btn_compound_mute"
    137                     android:contentDescription="@string/onscreenMuteText"
    138                     />
    139 
    140                 <!-- Separator between 3rd and 4th button -->
    141                 <View style="@style/VerticalSeparator" />
    142 
    143                 <!-- This slot is either "Hold" or "Swap", depending on
    144                      the state of the call.   One or the other of these
    145                      must always be set to GONE. -->
    146                 <!-- "Hold" -->
    147                 <!-- This is a "compound button": it has checked and unchecked states. -->
    148                 <ToggleButton android:id="@+id/holdButton"
    149                     style="@style/InCallCompoundButton"
    150                     android:background="@drawable/btn_compound_hold"
    151                     android:contentDescription="@string/onscreenHoldText"
    152                     />
    153                 <!-- "Swap" (or "Manage calls" in some CDMA states) -->
    154                 <ImageButton android:id="@+id/swapButton"
    155                     style="@style/InCallButton"
    156                     android:src="@drawable/ic_incall_switch_holo_dark"
    157                     android:contentDescription="@string/onscreenSwapCallsText"
    158                     />
    159 
    160                 <!-- Separator between 4th and 5th button (if 5th exists) -->
    161                 <View android:id="@+id/holdSwapSpacer"
    162                       style="@style/VerticalSeparator" />
    163 
    164                 <!-- This slot is either "Add" or "Merge", depending on
    165                      the state of the call.  One or the other of these
    166                      must always be set to GONE. -->
    167                 <!-- "Add Call" -->
    168                 <ImageButton android:id="@+id/addButton"
    169                     style="@style/InCallButton"
    170                     android:src="@drawable/ic_add_contact_holo_dark"
    171                     android:contentDescription="@string/onscreenAddCallText"
    172                     />
    173                 <!-- "Merge calls" -->
    174                 <!-- This button is used only on GSM devices, where we know
    175                      that "Add" and "Merge" are never available at the same time.
    176                      The "Merge" button for CDMA devices is "cdmaMergeButton" above. -->
    177                 <ImageButton android:id="@+id/mergeButton"
    178                     style="@style/InCallButton"
    179                     android:src="@drawable/ic_merge_holo_dark"
    180                     android:contentDescription="@string/onscreenMergeCallsText"
    181                     />
    182 
    183                 <!-- Separator between 4th (or 5th) button and right padding -->
    184                 <View style="@style/VerticalSeparator" />
    185 
    186             </LinearLayout>
    187 
    188         </LinearLayout>
    189 
    190     </RelativeLayout>
    191 
    192     <!--
    193         (2) incomingCallWidget: the UI displayed while an incoming call is ringing.
    194             See InCallTouchUi.showIncomingCallWidget().
    195 
    196             Layout notes:
    197             - Use an opaque black background since we need to cover up
    198               a bit of the bottom of the contact photo
    199             - The verticalOffset value gets us a little extra space above
    200               the topmost "Respond by SMS" icon
    201             - The negative layout_marginBottom shifts us slightly downward;
    202               we're already aligned with the bottom of the screen, but we
    203               don't have an icon in the downward direction so the whole
    204               bottom area of this widget is just wasted space.
    205     -->
    206     <com.android.internal.widget.multiwaveview.GlowPadView
    207         android:id="@+id/incomingCallWidget"
    208         android:layout_width="match_parent"
    209         android:layout_height="wrap_content"
    210         android:layout_gravity="center|bottom"
    211         android:layout_marginTop="20dip"
    212         android:layout_marginBottom="-46dp"
    213         android:background="@android:color/black"
    214         android:visibility="gone"
    215         android:gravity="top"
    216 
    217         prvandroid:targetDrawables="@array/incoming_call_widget_3way_targets"
    218         prvandroid:targetDescriptions="@array/incoming_call_widget_3way_target_descriptions"
    219         prvandroid:directionDescriptions="@array/incoming_call_widget_3way_direction_descriptions"
    220         prvandroid:handleDrawable="@drawable/ic_in_call_touch_handle"
    221         prvandroid:innerRadius="@*android:dimen/glowpadview_inner_radius"
    222         prvandroid:outerRadius="@*android:dimen/glowpadview_target_placement_radius"
    223         prvandroid:outerRingDrawable="@*android:drawable/ic_lockscreen_outerring"
    224         prvandroid:snapMargin="@*android:dimen/glowpadview_snap_margin"
    225         prvandroid:vibrationDuration="20"
    226         prvandroid:feedbackCount="1"
    227         prvandroid:glowRadius="@*android:dimen/glowpadview_glow_radius"
    228         prvandroid:pointDrawable="@*android:drawable/ic_lockscreen_glowdot"
    229         />
    230 
    231 </com.android.phone.InCallTouchUi>
    232