1 <?xml version="1.0" encoding="utf-8"?> 2 <!-- Copyright (C) 2012 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 <!-- XML resource file for primary call info, which will be used by CallCard. 18 See also call_card.xml. --> 19 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 20 android:layout_width="match_parent" 21 android:layout_height="0dp" 22 android:layout_weight="1"> 23 24 <!-- Contact photo for primary call info --> 25 <ImageView android:id="@+id/photo" 26 android:layout_alignParentLeft="true" 27 android:layout_alignParentTop="true" 28 android:layout_width="match_parent" 29 android:layout_height="match_parent" 30 android:gravity="top|center_horizontal" 31 android:scaleType="centerCrop" 32 android:contentDescription="@string/contactPhoto" /> 33 34 <!-- Used when the phone call is on hold, dimming the primary photo 35 36 Note: Theoretically it is possible to achieve this effect using 37 Drawable#setColorFilter(). 38 39 But watch out: we also use cross fade between primary and 40 secondary photo, which may interfere with the dim effect with 41 setColorFilter(). To try it out, use GSM phones and do multiple 42 calls. 43 44 Detail: during the cross-fade effect we are currently using 45 TransitionDrawable. TransitionDrawable#setColorFilter() will call 46 the equivalent method for *both* drawables which are shared by 47 the two ImageViews. If we set setColorFilter() for "on hold" effect 48 during the cross-fade, *both* primary and secondary photos become 49 dim. 50 51 Theoretically it can be avoided (by copying drawable, or carefully 52 calling setColorFilter() conditionally. But it doesn't bang for the 53 buck for now. 54 55 TODO: try that. It may be smoother with slower devices. 56 --> 57 <View android:id="@+id/dim_effect_for_primary_photo" 58 android:layout_alignParentLeft="true" 59 android:layout_alignParentTop="true" 60 android:layout_width="match_parent" 61 android:layout_height="match_parent" 62 android:background="@color/on_hold_dim_effect" 63 android:visibility="gone" /> 64 65 <!-- "Call Banner" for primary call, the foregound or ringing call. 66 The "call banner" is a block of info about a single call, 67 including the contact name, phone number, call time counter, 68 and other status info. This info is shown as a "banner" 69 overlaid across the top of contact photo. --> 70 <RelativeLayout android:id="@+id/primary_call_banner" 71 android:layout_alignParentTop="true" 72 android:layout_width="match_parent" 73 android:layout_height="wrap_content" 74 android:minHeight="@dimen/call_banner_height" 75 android:paddingLeft="@dimen/call_banner_side_padding" 76 android:paddingRight="@dimen/call_banner_side_padding" 77 android:paddingTop="@dimen/call_banner_top_bottom_padding" 78 android:paddingBottom="@dimen/call_banner_top_bottom_padding" 79 android:background="@color/incall_call_banner_background"> 80 81 <!-- Name (or the phone number, if we don't have a name to display). --> 82 <TextView android:id="@+id/name" 83 android:layout_alignParentTop="true" 84 android:layout_alignParentLeft="true" 85 android:layout_width="match_parent" 86 android:layout_height="wrap_content" 87 android:paddingRight="@dimen/call_banner_name_number_right_padding" 88 android:textAppearance="?android:attr/textAppearanceMedium" 89 android:textColor="@color/incall_call_banner_text_color" 90 android:singleLine="true" /> 91 92 <!-- Label (like "Mobile" or "Work", if present) and phone number, side by side --> 93 <LinearLayout android:id="@+id/labelAndNumber" 94 android:layout_below="@id/name" 95 android:layout_width="wrap_content" 96 android:layout_height="wrap_content" 97 android:paddingRight="@dimen/call_banner_name_number_right_padding" 98 android:orientation="horizontal"> 99 <TextView android:id="@+id/phoneNumber" 100 android:layout_width="wrap_content" 101 android:layout_height="wrap_content" 102 android:textAppearance="?android:attr/textAppearanceSmall" 103 android:textColor="@color/incall_call_banner_text_color" 104 android:singleLine="true" /> 105 <TextView android:id="@+id/label" 106 android:layout_width="wrap_content" 107 android:layout_height="wrap_content" 108 android:textAppearance="?android:attr/textAppearanceSmall" 109 android:textColor="@color/incall_call_banner_text_color" 110 android:textAllCaps="true" 111 android:singleLine="true" 112 android:layout_marginLeft="6dp" /> 113 </LinearLayout> 114 115 <!-- Elapsed time indication for a call in progress. --> 116 <TextView android:id="@+id/elapsedTime" 117 android:layout_alignParentRight="true" 118 android:layout_centerVertical="true" 119 android:layout_width="wrap_content" 120 android:layout_height="wrap_content" 121 android:textAppearance="?android:attr/textAppearanceMedium" 122 android:textColor="@color/incall_call_banner_text_color" 123 android:singleLine="true" 124 android:visibility="invisible" /> 125 126 <!-- Call type indication: a special label and/or branding 127 for certain kinds of calls (like "Internet call" for a SIP call.) --> 128 <TextView android:id="@+id/callTypeLabel" 129 android:layout_below="@id/labelAndNumber" 130 android:layout_width="wrap_content" 131 android:layout_height="wrap_content" 132 android:textAppearance="?android:attr/textAppearanceSmall" 133 android:textColor="@color/incall_call_banner_text_color" 134 android:maxLines="1" 135 android:ellipsize="end" /> 136 137 </RelativeLayout> <!-- End of call_banner --> 138 139 <LinearLayout android:id="@+id/secondary_info_container" 140 android:layout_below="@id/primary_call_banner" 141 android:layout_width="match_parent" 142 android:layout_height="wrap_content" 143 android:layout_gravity="center_vertical|right" 144 android:orientation="vertical" 145 android:background="@color/incall_secondary_info_background" 146 android:animateLayoutChanges="true"> 147 148 <!-- Shown when a gateway provider is used during any outgoing call. --> 149 <LinearLayout android:id="@+id/providerInfo" 150 android:layout_width="match_parent" 151 android:layout_height="wrap_content" 152 android:paddingTop="@dimen/provider_info_top_bottom_padding" 153 android:paddingBottom="@dimen/provider_info_top_bottom_padding" 154 android:paddingLeft="@dimen/call_banner_side_padding" 155 android:paddingRight="@dimen/call_banner_side_padding" 156 android:gravity="right" 157 android:orientation="horizontal" 158 android:background="@android:color/transparent"> 159 <TextView android:id="@+id/providerLabel" 160 android:layout_width="0px" 161 android:layout_height="wrap_content" 162 android:layout_weight="6" 163 android:textAppearance="?android:attr/textAppearanceSmall" 164 android:textAllCaps="true" 165 android:textColor="@color/incall_call_banner_text_color" 166 android:singleLine="true" 167 android:ellipsize="marquee" /> 168 <TextView android:id="@+id/providerAddress" 169 android:layout_width="0px" 170 android:layout_height="wrap_content" 171 android:layout_weight="4" 172 android:gravity="right" 173 android:paddingLeft="8dp" 174 android:textAppearance="?android:attr/textAppearanceSmall" 175 android:textAllCaps="true" 176 android:textColor="@color/incall_call_banner_text_color" 177 android:singleLine="true" 178 android:ellipsize="middle" /> 179 </LinearLayout> 180 181 <!-- The "call state label": In some states, this shows a special 182 indication like "Dialing" or "Incoming call" or "Call ended". 183 It's unused for the normal case of an active ongoing call. --> 184 <TextView android:id="@+id/callStateLabel" 185 android:layout_width="match_parent" 186 android:layout_height="wrap_content" 187 android:paddingTop="@dimen/provider_info_top_bottom_padding" 188 android:paddingBottom="@dimen/provider_info_top_bottom_padding" 189 android:paddingLeft="@dimen/call_banner_side_padding" 190 android:paddingRight="@dimen/call_banner_side_padding" 191 android:gravity="right" 192 android:textAppearance="?android:attr/textAppearanceSmall" 193 android:textColor="@color/incall_call_banner_text_color" 194 android:textAllCaps="true" 195 android:background="@android:color/transparent" 196 android:singleLine="true" 197 android:ellipsize="end" /> 198 </LinearLayout> 199 200 <!-- Social status (currently unused) --> 201 <!-- <TextView android:id="@+id/socialStatus" 202 android:layout_below="@id/callTypeLabel" 203 android:layout_width="wrap_content" 204 android:layout_height="wrap_content" 205 android:textAppearance="?android:attr/textAppearanceSmall" 206 android:textColor="@color/incall_call_banner_text_color" 207 android:maxLines="2" 208 android:ellipsize="end" 209 /> --> 210 </RelativeLayout> 211