Santos Cordon | 7d4ddf6 | 2013-07-10 11:58:08 -0700 | [diff] [blame] | 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_alignParentStart="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_alignParentStart="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 | style="@style/PrimaryCallInfoPrimaryCallBanner" |
| 72 | android:layout_width="match_parent" |
| 73 | android:layout_height="wrap_content" |
| 74 | android:minHeight="@dimen/call_banner_height" |
| 75 | android:paddingStart="@dimen/call_banner_side_padding" |
| 76 | android:paddingEnd="@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_alignParentStart="true" |
| 85 | android:layout_width="match_parent" |
| 86 | android:layout_height="wrap_content" |
| 87 | android:paddingEnd="@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 | android:textAlignment="viewStart"/> |
| 92 | |
| 93 | <!-- Label (like "Mobile" or "Work", if present) and phone number, side by side --> |
| 94 | <LinearLayout android:id="@+id/labelAndNumber" |
| 95 | android:layout_below="@id/name" |
| 96 | android:layout_width="wrap_content" |
| 97 | android:layout_height="wrap_content" |
| 98 | android:paddingEnd="@dimen/call_banner_name_number_right_padding" |
| 99 | android:orientation="horizontal"> |
| 100 | <TextView android:id="@+id/phoneNumber" |
| 101 | android:layout_width="wrap_content" |
| 102 | android:layout_height="wrap_content" |
| 103 | android:textAppearance="?android:attr/textAppearanceSmall" |
| 104 | android:textColor="@color/incall_call_banner_text_color" |
| 105 | android:singleLine="true" |
| 106 | android:textDirection="ltr" /> |
| 107 | <TextView android:id="@+id/label" |
| 108 | android:layout_width="wrap_content" |
| 109 | android:layout_height="wrap_content" |
| 110 | android:textAppearance="?android:attr/textAppearanceSmall" |
| 111 | android:textColor="@color/incall_call_banner_text_color" |
| 112 | android:textAllCaps="true" |
| 113 | android:singleLine="true" |
| 114 | android:layout_marginStart="6dp" /> |
| 115 | </LinearLayout> |
| 116 | |
| 117 | <!-- Elapsed time indication for a call in progress. --> |
| 118 | <TextView android:id="@+id/elapsedTime" |
| 119 | android:layout_alignParentEnd="true" |
| 120 | android:layout_centerVertical="true" |
| 121 | android:layout_width="wrap_content" |
| 122 | android:layout_height="wrap_content" |
| 123 | android:textAppearance="?android:attr/textAppearanceMedium" |
| 124 | android:textColor="@color/incall_call_banner_text_color" |
| 125 | android:singleLine="true" |
| 126 | android:visibility="invisible" /> |
| 127 | |
| 128 | <!-- Call type indication: a special label and/or branding |
| 129 | for certain kinds of calls (like "Internet call" for a SIP call.) --> |
| 130 | <TextView android:id="@+id/callTypeLabel" |
| 131 | android:layout_below="@id/labelAndNumber" |
| 132 | android:layout_width="wrap_content" |
| 133 | android:layout_height="wrap_content" |
| 134 | android:textAppearance="?android:attr/textAppearanceSmall" |
| 135 | android:textColor="@color/incall_call_banner_text_color" |
| 136 | android:maxLines="1" |
| 137 | android:ellipsize="end" /> |
| 138 | |
| 139 | </RelativeLayout> <!-- End of call_banner --> |
| 140 | |
| 141 | <LinearLayout android:id="@+id/secondary_info_container" |
| 142 | style="@style/PrimaryCallInfoSecondaryInfoContainer" |
| 143 | android:layout_width="match_parent" |
| 144 | android:layout_height="wrap_content" |
| 145 | android:layout_gravity="center_vertical|right" |
| 146 | android:orientation="vertical" |
| 147 | android:background="@color/incall_secondary_info_background" |
| 148 | android:animateLayoutChanges="true"> |
| 149 | |
| 150 | <!-- Shown when a gateway provider is used during any outgoing call. --> |
| 151 | <LinearLayout android:id="@+id/providerInfo" |
| 152 | android:layout_width="match_parent" |
| 153 | android:layout_height="wrap_content" |
| 154 | android:paddingTop="@dimen/provider_info_top_bottom_padding" |
| 155 | android:paddingBottom="@dimen/provider_info_top_bottom_padding" |
| 156 | android:paddingStart="@dimen/call_banner_side_padding" |
| 157 | android:paddingEnd="@dimen/call_banner_side_padding" |
| 158 | android:gravity="end" |
| 159 | android:orientation="horizontal" |
| 160 | android:background="@android:color/transparent"> |
| 161 | <TextView android:id="@+id/providerLabel" |
| 162 | android:layout_width="0px" |
| 163 | android:layout_height="wrap_content" |
| 164 | android:layout_weight="6" |
| 165 | android:textAppearance="?android:attr/textAppearanceSmall" |
| 166 | android:textAllCaps="true" |
| 167 | android:textColor="@color/incall_call_banner_text_color" |
| 168 | android:singleLine="true" |
| 169 | android:ellipsize="marquee" /> |
| 170 | <TextView android:id="@+id/providerAddress" |
| 171 | android:layout_width="0px" |
| 172 | android:layout_height="wrap_content" |
| 173 | android:layout_weight="4" |
| 174 | android:gravity="end" |
| 175 | android:paddingStart="8dp" |
| 176 | android:textAppearance="?android:attr/textAppearanceSmall" |
| 177 | android:textAllCaps="true" |
| 178 | android:textColor="@color/incall_call_banner_text_color" |
| 179 | android:singleLine="true" |
| 180 | android:ellipsize="middle" /> |
| 181 | </LinearLayout> |
| 182 | |
| 183 | <!-- The "call state label": In some states, this shows a special |
| 184 | indication like "Dialing" or "Incoming call" or "Call ended". |
| 185 | It's unused for the normal case of an active ongoing call. --> |
| 186 | <TextView android:id="@+id/callStateLabel" |
| 187 | android:layout_width="match_parent" |
| 188 | android:layout_height="wrap_content" |
| 189 | android:paddingTop="@dimen/provider_info_top_bottom_padding" |
| 190 | android:paddingBottom="@dimen/provider_info_top_bottom_padding" |
| 191 | android:paddingStart="@dimen/call_banner_side_padding" |
| 192 | android:paddingEnd="@dimen/call_banner_side_padding" |
| 193 | android:gravity="end" |
| 194 | android:textAppearance="?android:attr/textAppearanceSmall" |
| 195 | android:textColor="@color/incall_call_banner_text_color" |
| 196 | android:textAllCaps="true" |
| 197 | android:background="@android:color/transparent" |
| 198 | android:singleLine="true" |
| 199 | android:ellipsize="end" /> |
| 200 | </LinearLayout> |
| 201 | |
| 202 | <!-- Social status (currently unused) --> |
| 203 | <!-- <TextView android:id="@+id/socialStatus" |
| 204 | android:layout_below="@id/callTypeLabel" |
| 205 | android:layout_width="wrap_content" |
| 206 | android:layout_height="wrap_content" |
| 207 | android:textAppearance="?android:attr/textAppearanceSmall" |
| 208 | android:textColor="@color/incall_call_banner_text_color" |
| 209 | android:maxLines="2" |
| 210 | android:ellipsize="end" |
| 211 | /> --> |
| 212 | </RelativeLayout> |