blob: 45da49e8d85f017d2fd0a286950197c25144c6cf [file] [log] [blame]
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2007 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!-- XML resource file for the *children* of a CallCard used in the Phone app.
The CallCard itself is a subclass of FrameLayout, and its (single)
child is the LinearLayout found here. (In the CallCard constructor,
we inflate this file and add it as a child.)
Note that the CallCard is technically the size of the full screen (since
our parent container is full-screen, and the layout_width and layout_height
here are both "match_parent"), but we manually adjust its bottom margin
in CallCard.updateCallInfoLayout() to make sure it doesn't overlap with
the onscreen buttons from incall_touch_ui.xml. -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/call_info_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<!-- The main content of the CallCard is either one or two "call info"
blocks, depending on whether one or two lines are in use.
The call_info blocks are stacked vertically inside a LinearLayout,
each with layout_weight="1". If only one line is in use (i.e. the
common case) then the 2nd call info will be GONE and thus the 1st one
will expand to fill the full height of the CallCard.
We set a bottom margin on this element dynamically (see
updateCallInfoLayout()) to make sure it doesn't overlap with either
the bottom button cluster or the incoming-call widget. -->
<!-- TODO (XML cleanup): Currently, every View of the entire CallCard
UI is spelled out here in this XML file.
This is because the the in-call visual design is still in
flux, and it's easier to shuffle layouts around this way
rather than having sub-components in separate XML files.
But once the in-call visual design is final, let's
rearrange this XML to be more object-oriented:
- Have the "call banners" (or at least the banner for call
#1) come from separate XML files that get <include>d when
needed. Consider making "CallBanner" an actual widget.
(Note: if we end up including the same XML file multiple
times, like for both call banners, we won't have separate
XML ids for (for example) "name" and "secondaryCallName".
So CallCard.java will need to look up those views
separately by calling findViewById on the specific
container around each banner.)
- Move any remaining hardcoded margin / padding / size
constants (both here and in incall_touch_ui.xml) out to
dimens.xml or styles.xml.
-->
<!-- "Call info" block #1, for the foreground call. -->
<RelativeLayout android:id="@+id/call_info_1"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<!-- Contact photo for call_info_1 -->
<com.android.phone.InCallContactPhoto android:id="@+id/photo"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top|center_horizontal"
android:scaleType="centerCrop"
android:contentDescription="@string/contactPhoto"
/>
<!-- "Call Banner" for call #1, the foregound or ringing call.
The "call banner" is a block of info about a single call,
including the contact name, phone number, call time counter,
and other status info. This info is shown as a "banner"
overlaid across the top of contact photo. -->
<RelativeLayout android:id="@+id/call_banner_1"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="@dimen/call_banner_height"
android:paddingLeft="@dimen/call_banner_side_padding"
android:paddingRight="@dimen/call_banner_side_padding"
android:paddingTop="@dimen/call_banner_top_bottom_padding"
android:paddingBottom="@dimen/call_banner_top_bottom_padding"
android:background="@color/incall_call_banner_background"
>
<!-- Name (or the phone number, if we don't have a name to display). -->
<TextView android:id="@+id/name"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="@dimen/call_banner_name_number_right_padding"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/incall_call_banner_text_color"
android:singleLine="true"
/>
<!-- Label (like "Mobile" or "Work", if present) and phone number, side by side -->
<LinearLayout android:id="@+id/labelAndNumber"
android:layout_below="@id/name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/call_banner_name_number_right_padding"
android:orientation="horizontal"
>
<TextView android:id="@+id/phoneNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/incall_call_banner_text_color"
android:singleLine="true"
/>
<TextView android:id="@+id/label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/incall_call_banner_text_color"
android:textAllCaps="true"
android:singleLine="true"
android:layout_marginLeft="6dip"
/>
</LinearLayout>
<!-- Elapsed time indication for a call in progress. -->
<TextView android:id="@+id/elapsedTime"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/incall_call_banner_text_color"
android:singleLine="true"
/>
<!-- Call type indication: a special label and/or branding
for certain kinds of calls (like "Internet call" for a SIP call.) -->
<TextView android:id="@+id/callTypeLabel"
android:layout_below="@id/labelAndNumber"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/incall_call_banner_text_color"
android:maxLines="1"
android:ellipsize="end"
/>
<!-- Social status (currently unused) -->
<TextView android:id="@+id/socialStatus"
android:layout_below="@id/callTypeLabel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/incall_call_banner_text_color"
android:maxLines="2"
android:ellipsize="end"
/>
</RelativeLayout> <!-- End of call_banner for call_info #1. -->
<!-- "Inset" photo used with "id/photo" above:
When the contact photo is a lo-res thumbnail, id/photo
contains a scaled-up but *blurred* version of the photo, and
*this* ImageView is overlaid on top as a smaller, unblurred
inset. (See InCallContactPhoto.java.)
The top of the inset is vertically aligned with the bottom
of the call banner. (Note that means that in states where the
"call state label" is visible, the label (see below) will overlap
the top of the inset photo.) -->
<ImageView android:id="@+id/insetPhoto"
android:layout_below="@id/call_banner_1"
android:layout_width="@dimen/contact_photo_inset_width"
android:layout_height="@dimen/contact_photo_inset_height"
android:scaleType="centerCrop"
android:layout_marginLeft="@dimen/contact_photo_inset_left_margin"
/>
<!-- The "call state label": In some states, this shows a special
indication like "Dialing" or "Incoming call" or "Call ended".
It's unused for the normal case of an active ongoing call. -->
<!-- This is visually part of the call banner, but it's not actually
part of the "call_banner_1" RelativeLayout since it needs a
different background color. -->
<TextView android:id="@+id/callStateLabel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/call_banner_1"
android:gravity="right"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:paddingRight="@dimen/call_banner_side_padding"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/incall_call_banner_text_color"
android:textAllCaps="true"
android:background="@color/incall_call_state_label_background"
android:visibility="gone"
/>
</RelativeLayout>
<!-- call_info block #2, for the background ("on hold") call.
If only one line is in use, this whole block will have its
visibility set to GONE. -->
<RelativeLayout android:id="@+id/call_info_2"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
>
<!-- Contact photo for call_info #2 -->
<com.android.phone.InCallContactPhoto android:id="@+id/secondaryCallPhoto"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="top|center_horizontal"
android:scaleType="centerCrop"
android:contentDescription="@string/onHold"
/>
<!-- For now, at least, there's no "inset" photo used with
"id/secondaryCallPhoto". (That's the "on hold" call anyway,
so it's fine for it to be entirely blurry...) -->
<!-- call_banner for call_info #2 -->
<!-- Note this is much simpler than the call banner used
for the foreground call. -->
<RelativeLayout android:id="@+id/call_banner_2"
android:layout_alignParentTop="true"
android:layout_width="match_parent"
android:layout_height="@dimen/call_banner_height"
android:paddingLeft="@dimen/call_banner_side_padding"
android:paddingRight="@dimen/call_banner_side_padding"
android:paddingTop="@dimen/call_banner_top_bottom_padding"
android:paddingBottom="@dimen/call_banner_top_bottom_padding"
android:background="@color/incall_call_banner_background"
>
<!-- Name (or the phone number, if we don't have a name to display). -->
<TextView android:id="@+id/secondaryCallName"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textColor="@color/incall_call_banner_text_color"
android:singleLine="true"
/>
<!-- TODO: possibly also add a label + number field below the name? -->
<!-- Call status of the background call, usually the string "On hold". -->
<!-- TODO: figure out where this really belongs! -->
<TextView android:id="@+id/secondaryCallStatus"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/onHold"
android:textAppearance="?android:attr/textAppearanceSmall"
android:textColor="@color/incall_call_banner_text_color"
android:textAllCaps="true"
android:singleLine="true"
/>
</RelativeLayout>
</RelativeLayout>
</LinearLayout>