Home | History | Annotate | Download | only in layout
      1 <?xml version="1.0" encoding="utf-8"?>
      2 <!--
      3   ~ Copyright (C) 2013 The Android Open Source Project
      4   ~
      5   ~ Licensed under the Apache License, Version 2.0 (the "License");
      6   ~ you may not use this file except in compliance with the License.
      7   ~ You may obtain a copy of the License at
      8   ~
      9   ~      http://www.apache.org/licenses/LICENSE-2.0
     10   ~
     11   ~ Unless required by applicable law or agreed to in writing, software
     12   ~ distributed under the License is distributed on an "AS IS" BASIS,
     13   ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14   ~ See the License for the specific language governing permissions and
     15   ~ limitations under the License
     16   -->
     17 
     18 <!-- In-call onscreen touch UI elements, used on some platforms.
     19 
     20      This layout is a fullscreen overlay, drawn on top of the
     21      non-touch-sensitive parts of the in-call UI (i.e. the call card).
     22 
     23      The top-level View here is a InCallTouchUi (FrameLayout) with 2 children:
     24        (1) inCallControls: the widgets visible while a regular call (or calls) is in progress
     25        (2) incomingCallWidget: the UI displayed while an incoming call is ringing
     26      In usual cases, one of these is visible at any given moment.
     27      One exception is when incomingCallWidget is fading-out. At that moment, we show
     28      inCallControls beneath incomingCallWidget for smoother transition.
     29      -->
     30 
     31 <!-- Main cluster of onscreen buttons on the lower part of the screen. -->
     32 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     33               android:id="@+id/bottomButtons"
     34               android:orientation="vertical"
     35               android:layout_width="match_parent"
     36               android:layout_height="wrap_content"
     37               android:layout_alignParentBottom="true"
     38               android:visibility="invisible">
     39 
     40     <!-- Row 1, the "extra button row": A couple of relatively rare
     41          buttons used only in certain call states.
     42          Most of the time this whole row is GONE.
     43          For now, at least, there's only ever one button visible here
     44          at a time, so this can be a simple FrameLayout. -->
     45     <include android:id="@+id/extraButtonRow"
     46           layout="@layout/extra_button_row"
     47           android:layout_width="match_parent"
     48           android:layout_height="wrap_content"/>
     49 
     50     <!-- Row 2: The "End call" button. -->
     51     <ImageButton android:id="@+id/endButton"
     52                  style="@style/InCallEndButton"
     53                  android:layout_width="match_parent"
     54                  android:layout_marginTop="2dp"
     55                  android:src="@drawable/ic_in_call_phone_hangup"
     56                  android:background="@drawable/end_call_background"
     57                  android:contentDescription="@string/onscreenEndCallText"/>
     58 
     59     <!-- Row 3: The main batch of in-call buttons:
     60          Dialpad / Audio mode / Mute / Hold / Add call
     61          Visible in all states except while an incoming call is
     62          ringing. -->
     63     <LinearLayout
     64             android:orientation="horizontal"
     65             android:layout_width="match_parent"
     66             android:layout_height="wrap_content"
     67             android:paddingStart="@dimen/button_cluster_side_padding"
     68             android:paddingEnd="@dimen/button_cluster_side_padding"
     69             android:background="@color/button_background"
     70             >
     71 
     72         <!-- This row has either 4 or 5 buttons, depending on
     73        whether the device supports "Hold" (i.e. 4 buttons on
     74        CDMA devices, 5 buttons on GSM devices.)  The buttons
     75        are interspersed with 'layout_weight="1"' placeholder
     76        views so that they'll be spaced evenly in both cases.
     77 
     78        But note there are a couple of *pairs* of buttons that share a
     79        single "slot", namely Hold/Swap and Add/Merge.  For these, the
     80        code in InCallTouchUi is responsible for making sure that at any
     81        point exactly one of the pair is VISIBLE and the other is
     82        GONE. -->
     83 
     84         <!-- Separator between left padding and 1st button -->
     85         <View style="@style/VerticalSeparator"/>
     86 
     87         <!-- "Dialpad" -->
     88         <!-- This is a "compound button": it has checked and unchecked states. -->
     89         <ToggleButton android:id="@+id/dialpadButton"
     90                       style="@style/InCallCompoundButton"
     91                       android:background="@drawable/btn_compound_dialpad"
     92                       android:contentDescription="@string/onscreenShowDialpadText"
     93                 />
     94 
     95         <!-- Separator between 1st and 2nd button -->
     96         <View style="@style/VerticalSeparator"/>
     97 
     98         <!-- "Audio mode" -->
     99         <!-- This is a multi-mode button that can behave either like a
    100              simple "compound button" with two states *or* like an
    101              action button that brings up a popup menu; see
    102              btn_compound_audio.xml and InCallTouchUi.updateAudioButton()
    103              for the full details. -->
    104         <ImageButton android:id="@+id/audioButton"
    105                       style="@style/InCallButton"
    106                       android:background="@drawable/btn_compound_audio"
    107                       android:contentDescription="@string/onscreenAudioText"
    108                 />
    109 
    110         <!-- Separator between 2nd and 3rd button -->
    111         <View style="@style/VerticalSeparator"/>
    112 
    113         <!-- "Mute" -->
    114         <!-- This is a "compound button": it has checked and unchecked states. -->
    115         <ImageButton android:id="@+id/muteButton"
    116                       style="@style/InCallButton"
    117                       android:background="@drawable/btn_fake_compound_mute"
    118                       android:contentDescription="@string/onscreenMuteText"
    119                 />
    120 
    121         <!-- Separator between 3rd and 4th button -->
    122         <View style="@style/VerticalSeparator"/>
    123 
    124         <!-- This slot is either "Hold" or "Swap", depending on
    125              the state of the call.   One or the other of these
    126              must always be set to GONE. -->
    127         <!-- "Hold" -->
    128         <!-- This is a "compound button": it has checked and unchecked states. -->
    129         <ImageButton android:id="@+id/holdButton"
    130                       style="@style/InCallButton"
    131                       android:background="@drawable/btn_fake_compound_hold"
    132                       android:contentDescription="@string/onscreenHoldText"
    133                 />
    134         <!-- "Swap" (or "Manage calls" in some CDMA states) -->
    135         <ImageButton android:id="@+id/swapButton"
    136                      style="@style/InCallButton"
    137                      android:src="@drawable/ic_incall_switch_holo_dark"
    138                      android:contentDescription="@string/onscreenSwapCallsText"
    139                      android:visibility="gone"
    140                 />
    141 
    142         <!-- Separator between 4th and 5th button (if 5th exists) -->
    143         <View android:id="@+id/holdSwapSpacer"
    144               style="@style/VerticalSeparator"/>
    145 
    146         <!-- This slot is either "Add" or "Merge", depending on
    147              the state of the call.  One or the other of these
    148              must always be set to GONE. -->
    149         <!-- "Add Call" -->
    150         <ImageButton android:id="@+id/addButton"
    151                      style="@style/InCallButton"
    152                      android:src="@drawable/ic_add_contact_holo_dark"
    153                      android:contentDescription="@string/onscreenAddCallText"
    154                      android:visibility="gone"
    155                 />
    156         <!-- "Merge calls" -->
    157         <!-- This button is used only on GSM devices, where we know
    158              that "Add" and "Merge" are never available at the same time.
    159              The "Merge" button for CDMA devices is "cdmaMergeButton" above. -->
    160         <ImageButton android:id="@+id/mergeButton"
    161                      style="@style/InCallButton"
    162                      android:src="@drawable/ic_merge_holo_dark"
    163                      android:contentDescription="@string/onscreenMergeCallsText"
    164                      android:visibility="gone"
    165                 />
    166 
    167         <!-- Separator between 4th (or 5th) button and right padding -->
    168         <View style="@style/VerticalSeparator"/>
    169 
    170     </LinearLayout>
    171 
    172 </LinearLayout>
    173