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_margin="0dp"
     37     android:padding="0dp"
     38     android:background="@color/button_background_color"
     39     android:layout_height="wrap_content"
     40     android:layout_alignParentBottom="true"
     41     android:animateLayoutChanges="true" >
     42 
     43     <LinearLayout
     44         android:orientation="horizontal"
     45         android:layout_width="match_parent"
     46         android:layout_height="wrap_content"
     47         android:gravity="bottom|center_horizontal"
     48         android:baselineAligned="false">
     49 
     50         <!-- This row only ever shows either 4 or 5 buttons. This may depend on whether the device
     51              supports "Hold" (i.e. 4 buttons on CDMA devices, 5 buttons on GSM devices.) or whether
     52              it is in a video call.
     53 
     54              There are a couple of *pairs* of buttons that share a single "slot", namely Hold/Swap
     55              and Add/Merge.  For these, the code in InCallTouchUi is responsible for making sure
     56              that at any point exactly one of the pair is VISIBLE and the other is GONE.
     57 
     58              If there are more than 5 buttons eligible to be shown, the presenter is responsible for
     59              collapsing those options into an overflow menu, which appears as one of the buttons
     60              in the row instead. -->
     61 
     62         <!-- FAR LEFT SLOT ===================================================================== -->
     63 
     64         <!-- "Audio mode". this is a multi-mode button that can behave either like a simple
     65              "compound button" with two states *or* like an action button that brings up a popup
     66              menu; see btn_compound_audio.xml and CallButtonFragment.updateAudioButtons(). -->
     67         <ToggleButton android:id="@+id/audioButton"
     68             style="@style/InCallCompoundButton"
     69             android:background="@drawable/btn_compound_audio"
     70             android:contentDescription="@string/audio_mode_speaker" />
     71 
     72         <!-- MIDDLE LEFT SLOT ================================================================== -->
     73 
     74         <!-- "Mute" -->
     75         <ToggleButton android:id="@+id/muteButton"
     76             style="@style/InCallCompoundButton"
     77             android:background="@drawable/btn_compound_mute"
     78             android:contentDescription="@string/onscreenMuteText_unselected" />
     79 
     80         <!-- CENTER SLOT ======================================================================= -->
     81 
     82         <!-- "Dialpad" -->
     83         <ToggleButton android:id="@+id/dialpadButton"
     84             style="@style/InCallCompoundButton"
     85             android:background="@drawable/btn_compound_dialpad"
     86             android:contentDescription="@string/onscreenShowDialpadText_unselected" />
     87 
     88         <!-- MIDDLE RIGHT SLOT ================================================================= -->
     89 
     90         <!-- This slot is either "Hold" or "Swap", depending on the state of the call. One or the
     91              other of these must always be set to GONE. -->
     92 
     93         <!-- "Hold" -->
     94         <ToggleButton android:id="@+id/holdButton"
     95             style="@style/InCallCompoundButton"
     96             android:background="@drawable/btn_compound_hold"
     97             android:contentDescription="@string/onscreenHoldText_unselected" />
     98 
     99         <!-- "Swap" (or "Manage calls" in some CDMA states) -->
    100         <ImageButton android:id="@+id/swapButton"
    101             style="@style/InCallButton"
    102             android:background="@drawable/btn_swap"
    103             android:contentDescription="@string/onscreenSwapCallsText"
    104             android:visibility="gone" />
    105 
    106         <!-- "Change to video call" -->
    107         <ImageButton android:id="@+id/changeToVideoButton"
    108             style="@style/InCallButton"
    109             android:background="@drawable/btn_change_to_video"
    110             android:contentDescription="@string/onscreenVideoCallText"
    111             android:visibility="gone" />
    112 
    113         <!-- "Switch camera" for video calls. -->
    114         <ToggleButton android:id="@+id/switchCameraButton"
    115             style="@style/InCallCompoundButton"
    116             android:background="@drawable/btn_compound_video_switch"
    117             android:contentDescription="@string/onscreenSwitchCameraText"
    118             android:visibility="gone" />
    119 
    120         <!-- FAR RIGHT SLOT ==================================================================== -->
    121 
    122         <!-- This slot is either "Add" or "Merge", depending on the state of the call.  One or the
    123              other of these must always be set to GONE. -->
    124 
    125         <!-- "Turn off camera" for video calls. -->
    126         <ToggleButton android:id="@+id/pauseVideoButton"
    127             style="@style/InCallCompoundButton"
    128             android:background="@drawable/btn_compound_video_off"
    129             android:contentDescription="@string/onscreenTurnOffCameraText"
    130             android:visibility="gone" />
    131 
    132         <!-- "Change to audio call" for video calls. -->
    133         <ImageButton android:id="@+id/changeToVoiceButton"
    134                      style="@style/InCallButton"
    135                      android:background="@drawable/btn_change_to_voice"
    136                      android:contentDescription="@string/onscreenChangeToVoiceText"
    137                      android:visibility="gone" />
    138 
    139         <!-- "Add Call" -->
    140         <ImageButton android:id="@+id/addButton"
    141             style="@style/InCallButton"
    142             android:background="@drawable/btn_add"
    143             android:contentDescription="@string/onscreenAddCallText"
    144             android:visibility="gone" />
    145 
    146         <!-- "Merge calls". This button is used only on GSM devices, where we know that "Add" and
    147              "Merge" are never available at the same time. The "Merge" button for CDMA devices is
    148              "cdmaMergeButton" above. -->
    149         <ImageButton android:id="@+id/mergeButton"
    150             style="@style/InCallButton"
    151             android:background="@drawable/btn_merge"
    152             android:contentDescription="@string/onscreenMergeCallsText"
    153             android:visibility="gone" />
    154 
    155         <!-- "Overflow" -->
    156         <ImageButton android:id="@+id/overflowButton"
    157             style="@style/InCallButton"
    158             android:background="@drawable/btn_overflow"
    159             android:contentDescription="@string/onscreenOverflowText"
    160             android:visibility="gone" />
    161 
    162         <!-- "Manage conference button (Video Call) " -->
    163         <ImageButton android:id="@+id/manageVideoCallConferenceButton"
    164             style="@style/InCallButton"
    165             android:background="@drawable/ic_group_white_24dp"
    166             android:contentDescription="@string/onscreenManageConferenceText"
    167             android:visibility="gone" />
    168 
    169     </LinearLayout>
    170 
    171 </LinearLayout>
    172