diff options
-rw-r--r-- | InCallUI/res/drawable-xxhdpi/ic_in_call_wifi.png | bin | 3065 -> 0 bytes | |||
-rw-r--r-- | InCallUI/res/layout/call_button_fragment.xml | 30 | ||||
-rw-r--r-- | InCallUI/res/layout/dialpad_incall.xml | 79 | ||||
-rw-r--r-- | InCallUI/res/layout/dialpad_key_incall.xml | 34 | ||||
-rw-r--r-- | InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml | 35 | ||||
-rw-r--r-- | InCallUI/res/layout/extra_button_row.xml | 8 | ||||
-rw-r--r-- | InCallUI/res/layout/primary_call_info.xml | 88 | ||||
-rw-r--r-- | InCallUI/res/values/colors.xml | 6 | ||||
-rw-r--r-- | InCallUI/res/values/dimens.xml | 39 | ||||
-rw-r--r-- | InCallUI/res/values/styles.xml | 58 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallButtonFragment.java | 3 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/CallCardFragment.java | 89 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/DialpadFragment.java | 74 |
13 files changed, 73 insertions, 470 deletions
diff --git a/InCallUI/res/drawable-xxhdpi/ic_in_call_wifi.png b/InCallUI/res/drawable-xxhdpi/ic_in_call_wifi.png Binary files differdeleted file mode 100644 index 4fd5f333c..000000000 --- a/InCallUI/res/drawable-xxhdpi/ic_in_call_wifi.png +++ /dev/null diff --git a/InCallUI/res/layout/call_button_fragment.xml b/InCallUI/res/layout/call_button_fragment.xml index 139bdd00d..19ada9020 100644 --- a/InCallUI/res/layout/call_button_fragment.xml +++ b/InCallUI/res/layout/call_button_fragment.xml @@ -58,8 +58,10 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="@dimen/button_cluster_side_padding" - android:paddingEnd="@dimen/button_cluster_side_padding" + android:paddingStart="@dimen/button_cluster_horizontal_padding" + android:paddingEnd="@dimen/button_cluster_horizontal_padding" + android:paddingTop="@dimen/button_cluster_vertical_padding" + android:paddingBottom="@dimen/button_cluster_vertical_padding" android:background="@color/button_background_color" > <!-- This row has either 4 or 5 buttons, depending on @@ -74,9 +76,6 @@ point exactly one of the pair is VISIBLE and the other is GONE. --> - <!-- Separator between left padding and 1st button --> - <View style="@style/VerticalSeparator"/> - <!-- "Dialpad" --> <!-- This is a "compound button": it has checked and unchecked states. --> <ImageButton android:id="@+id/dialpadButton" @@ -84,9 +83,6 @@ android:background="@drawable/btn_compound_dialpad" android:contentDescription="@string/onscreenShowDialpadText" /> - <!-- Separator between 1st and 2nd button --> - <View style="@style/VerticalSeparator" /> - <!-- "Audio mode" --> <!-- This is a multi-mode button that can behave either like a simple "compound button" with two states *or* like an @@ -98,9 +94,6 @@ android:background="@drawable/btn_compound_audio" android:contentDescription="@string/onscreenAudioText" /> - <!-- Separator between 2nd and 3rd button --> - <View style="@style/VerticalSeparator"/> - <!-- "Mute" --> <!-- This is a "compound button": it has checked and unchecked states. --> <ImageButton android:id="@+id/muteButton" @@ -108,9 +101,6 @@ android:background="@drawable/btn_compound_mute" android:contentDescription="@string/onscreenMuteText" /> - <!-- Separator between 3rd and 4th button --> - <View style="@style/VerticalSeparator" /> - <!-- This slot is either "Hold" or "Swap", depending on the state of the call. One or the other of these must always be set to GONE. --> @@ -128,10 +118,6 @@ android:contentDescription="@string/onscreenSwapCallsText" android:visibility="gone" /> - <!-- Separator between 4th and 5th button (if 5th exists) --> - <View android:id="@+id/holdSwapSpacer" - style="@style/VerticalSeparator"/> - <!-- This slot is either "Add" or "Merge", depending on the state of the call. One or the other of these must always be set to GONE. --> @@ -152,18 +138,10 @@ android:contentDescription="@string/onscreenMergeCallsText" android:visibility="gone" /> - <!-- Separator between 5th and 6th button --> - <View android:id="@+id/auxiliaryActionSpacer" - style="@style/VerticalSeparator" - android:visibility="gone" /> - <ImageButton android:id="@+id/auxiliaryActionButton" style="@style/InCallButton" android:visibility="gone" /> - <!-- Separator between last button and right padding --> - <View style="@style/VerticalSeparator" /> - </LinearLayout> </LinearLayout> diff --git a/InCallUI/res/layout/dialpad_incall.xml b/InCallUI/res/layout/dialpad_incall.xml deleted file mode 100644 index 96240004a..000000000 --- a/InCallUI/res/layout/dialpad_incall.xml +++ /dev/null @@ -1,79 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 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. ---> - -<TableLayout - xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/dialpad" - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="4" - android:layout_gravity="center_horizontal" - android:paddingBottom="@dimen/dialpad_bottom_padding" - android:paddingLeft="@dimen/dialpad_horizontal_padding" - android:paddingRight="@dimen/dialpad_horizontal_padding" - android:stretchColumns="*" - android:layoutDirection="ltr" > - - <TableRow style="@style/InCallDialpadTableRowStyle"> - <include layout="@layout/dialpad_key_incall" android:id="@+id/one"/> - <include layout="@layout/dialpad_key_incall" android:id="@+id/two"/> - <include layout="@layout/dialpad_key_incall" android:id="@+id/three"/> - </TableRow> - - <TableRow style="@style/InCallDialpadTableRowStyle"> - <include layout="@layout/dialpad_key_incall" android:id="@+id/four"/> - <include layout="@layout/dialpad_key_incall" android:id="@+id/five"/> - <include layout="@layout/dialpad_key_incall" android:id="@+id/six"/> - </TableRow> - - <TableRow style="@style/InCallDialpadTableRowStyle"> - <include layout="@layout/dialpad_key_incall" android:id="@+id/seven"/> - <include layout="@layout/dialpad_key_incall" android:id="@+id/eight"/> - <include layout="@layout/dialpad_key_incall" android:id="@+id/nine"/> - </TableRow> - - <TableRow style="@style/InCallDialpadTableRowStyle"> - <com.android.contacts.common.dialpad.DialpadKeyButton - android:id="@+id/star" - style="@style/InCallDialpadKeyButtonStyle"> - <LinearLayout - style="@style/InCallDialpadKeyInternalLayoutStyle"> - <TextView - android:id="@+id/dialpad_key_number" - style="@style/InCallDialpadKeyStarPoundStyle" - android:textSize="@dimen/dialpad_key_star_size" /> - <View - android:layout_height="match_parent" - android:layout_width="@dimen/dialpad_key_letters_width" /> - </LinearLayout> - </com.android.contacts.common.dialpad.DialpadKeyButton> - <include layout="@layout/dialpad_key_incall" android:id="@+id/zero"/> - <com.android.contacts.common.dialpad.DialpadKeyButton - android:id="@+id/pound" - style="@style/InCallDialpadKeyButtonStyle"> - <LinearLayout - style="@style/InCallDialpadKeyInternalLayoutStyle"> - <TextView - android:id="@+id/dialpad_key_number" - style="@style/InCallDialpadKeyStarPoundStyle" - android:textSize="@dimen/dialpad_key_pound_size" /> - <View - android:layout_height="match_parent" - android:layout_width="@dimen/dialpad_key_letters_width" /> - </LinearLayout> - </com.android.contacts.common.dialpad.DialpadKeyButton> - </TableRow> -</TableLayout> diff --git a/InCallUI/res/layout/dialpad_key_incall.xml b/InCallUI/res/layout/dialpad_key_incall.xml deleted file mode 100644 index 8ce4b5135..000000000 --- a/InCallUI/res/layout/dialpad_key_incall.xml +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<!-- Copyright (C) 2014 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. ---> - -<FrameLayout - xmlns:android="http://schemas.android.com/apk/res/android" - style="@style/InCallDialpadKeyButtonStyle"> - - <LinearLayout style="@style/InCallDialpadKeyInternalLayoutStyle"> - - <!-- Note in the referenced styles that we assign hard widths to these components - because we want them to line up vertically when we arrange them in an MxN grid --> - - <TextView - android:id="@+id/dialpad_key_number" - style="@style/InCallDialpadKeyNumberStyle" /> - - <TextView - android:id="@+id/dialpad_key_letters" - style="@style/InCallDialpadKeyLettersStyle" /> - </LinearLayout> -</FrameLayout>
\ No newline at end of file diff --git a/InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml b/InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml index fb3b66e99..cd9977eeb 100644 --- a/InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml +++ b/InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml @@ -20,43 +20,12 @@ android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" - android:layout_marginTop="1dip" - android:background="@color/incall_dialpad_background" > + android:layout_marginTop="1dip" > <view class="com.android.incallui.DialpadFragment$HoverIgnoringLinearLayout" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" > - - <!-- Display of the digits you've typed so far. - This widget appears completely non-interactive to the user: you - can't edit or "hit backspace" since these are DTMF tones you've - already sent over the network. But it's still an EditText rather - than a TextView because it needs to receive key events from a - hard keyboard, if present (see mDialerKeyListener). --> - <!-- Edit text background is fully transparent to get rid of its underline. --> - <EditText - android:id="@+id/dtmfDialerField" - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1" - android:layout_marginTop="10dp" - android:layout_marginBottom="5dp" - android:layout_marginStart="32dp" - android:layout_marginEnd="32dp" - android:background="@null" - android:paddingEnd="12dp" - android:paddingStart="12dp" - android:singleLine="true" - android:scrollHorizontally="true" - android:gravity="center" - android:freezesText="true" - android:fontFamily="sans-serif-light" - android:textSize="@dimen/dialpad_digits_text_size" - android:textColor="@color/dialpad_digits_text_color" - android:focusableInTouchMode="false" - android:clickable="false"/> - - <include layout="@layout/dialpad_incall"/> + <include layout="@layout/dialpad_view"/> </view> </view> diff --git a/InCallUI/res/layout/extra_button_row.xml b/InCallUI/res/layout/extra_button_row.xml index 35dcf0713..690186e68 100644 --- a/InCallUI/res/layout/extra_button_row.xml +++ b/InCallUI/res/layout/extra_button_row.xml @@ -30,8 +30,8 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="@dimen/button_cluster_side_padding" - android:paddingEnd="@dimen/button_cluster_side_padding" + android:paddingStart="@dimen/button_cluster_horizontal_padding" + android:paddingEnd="@dimen/button_cluster_horizontal_padding" android:background="?android:attr/selectableItemBackground" android:visibility="gone"> <!-- The entire LinearLayout here is clickable, so we don't @@ -54,8 +54,8 @@ android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingStart="@dimen/button_cluster_side_padding" - android:paddingEnd="@dimen/button_cluster_side_padding" + android:paddingStart="@dimen/button_cluster_horizontal_padding" + android:paddingEnd="@dimen/button_cluster_horizontal_padding" android:background="?android:attr/selectableItemBackground" android:visibility="gone"> <!-- The entire LinearLayout here is clickable, so we don't diff --git a/InCallUI/res/layout/primary_call_info.xml b/InCallUI/res/layout/primary_call_info.xml index 2ac9715eb..4072920be 100644 --- a/InCallUI/res/layout/primary_call_info.xml +++ b/InCallUI/res/layout/primary_call_info.xml @@ -25,7 +25,7 @@ android:layout_height="wrap_content" android:orientation="vertical"> - <!-- "Call Banner" for primary call, the foregound or ringing call. + <!-- "Call Banner" for primary call, the foregound or ringing call.Di 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" @@ -37,11 +37,11 @@ android:minHeight="@dimen/call_banner_height" android:paddingStart="@dimen/call_banner_side_padding" android:paddingEnd="@dimen/call_banner_side_padding" - android:paddingTop="@dimen/call_banner_top_bottom_padding" + android:paddingTop="@dimen/call_banner_primary_call_top_padding" android:paddingBottom="@dimen/call_banner_top_bottom_padding" - android:background="@color/incall_call_banner_background_color"> + android:background="@color/incall_call_banner_background_color" > - <!-- Name (or the phone number, if we don't have a name to display). --> + <!-- Name (or the phone number, if we don't have a name to display). --> <LinearLayout android:id="@+id/stateAndName" android:layout_width="match_parent" android:layout_height="wrap_content" @@ -56,7 +56,7 @@ android:ellipsize="end" /> - <LinearLayout + <LinearLayout android:id="@+id/stateAndName" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal" > @@ -86,26 +86,30 @@ <!-- 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_below="@id/stateAndName" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingEnd="@dimen/call_banner_name_number_right_padding" - android:orientation="horizontal"> + 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:textColor="@color/incall_call_banner_secondary_text_color" + android:textSize="@dimen/call_label_text_size" android:singleLine="true" android:textDirection="ltr" /> + <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:textColor="@color/incall_call_banner_secondary_text_color" + android:textSize="@dimen/call_label_text_size" android:singleLine="true" android:layout_marginStart="6dp" /> + </LinearLayout> <!-- Call type indication: a special label and/or branding for certain kinds of calls (like "Internet call" for a SIP call.) --> @@ -120,70 +124,6 @@ </RelativeLayout> <!-- End of call_banner --> - - <FrameLayout android:id="@+id/supplementary_info_container" - style="@style/PrimaryCallInfoSupplementaryInfoContainer" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:layout_gravity="center_vertical|right" - android:orientation="horizontal" - android:background="@color/incall_call_banner_background_color" - android:animateLayoutChanges="true"> - - <LinearLayout - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_gravity="start|center_vertical" - android:gravity="center_vertical" - android:paddingTop="@dimen/provider_info_top_bottom_padding" - android:paddingBottom="@dimen/provider_info_top_bottom_padding" - android:paddingStart="@dimen/call_banner_side_padding" - android:paddingEnd="@dimen/call_banner_side_padding"> - <ImageView android:id="@+id/callServiceIcon" - android:layout_width="wrap_content" - android:layout_height="wrap_content"/> - <TextView android:id="@+id/callServiceLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingStart="5dp" - android:gravity="center" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/incall_call_banner_text_color" - android:singleLine="true" - android:ellipsize="end" /> - </LinearLayout> - - <LinearLayout - android:layout_gravity="end|center_vertical" - android:layout_width="wrap_content" - android:layout_height="wrap_content"> - - <!-- 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. --> - <TextView android:id="@+id/callStateLabel" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:paddingTop="@dimen/provider_info_top_bottom_padding" - android:paddingBottom="@dimen/provider_info_top_bottom_padding" - android:paddingStart="@dimen/call_banner_side_padding" - android:paddingEnd="@dimen/call_banner_side_padding" - android:textAppearance="?android:attr/textAppearanceSmall" - android:textColor="@color/incall_call_banner_text_color" - android:textAllCaps="true" - android:singleLine="true" - android:ellipsize="end" /> - - <Button android:id="@+id/connectionHandoffButton" - android:text="@string/connection_handoff_text" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:visibility="gone" /> - - </LinearLayout> - - </FrameLayout> - </LinearLayout> </FrameLayout> diff --git a/InCallUI/res/values/colors.xml b/InCallUI/res/values/colors.xml index 58e36dc11..a5bcadf64 100644 --- a/InCallUI/res/values/colors.xml +++ b/InCallUI/res/values/colors.xml @@ -26,6 +26,8 @@ <color name="incall_call_banner_background_color">@color/incall_background_color</color> <!-- white --> <color name="incall_call_banner_text_color">#FFFFFF</color> + <!-- White, with 80% opacity. --> + <color name="incall_call_banner_secondary_text_color">#99ffffff</color> <!-- Color of the theme of the People app --> <color name="people_app_theme_color">#33B5E5</color> @@ -49,12 +51,12 @@ <color name="dialpad_digits_text_color">#000000</color> <color name="incall_dialpad_background">#ccffffff</color> - <color name="incall_dialpad_background_pressed">#33ffffff</color> + <color name="incall_dialpad_background_pressed">#ccaaaaaa</color> <!-- Button background color. --> <color name="button_background_color">@color/incall_background_color</color> + <color name="button_selected_color">#00acc1</color> - <color name="wifi_connected_background">#8099cc00</color> <!-- Background color of action bars --> <color name="actionbar_background_color">#3B77E7</color> diff --git a/InCallUI/res/values/dimens.xml b/InCallUI/res/values/dimens.xml index ae5f5a1dd..763751c6e 100644 --- a/InCallUI/res/values/dimens.xml +++ b/InCallUI/res/values/dimens.xml @@ -48,7 +48,7 @@ <dimen name="call_banner_name_number_right_padding">50sp</dimen> <!-- Height of the main row of in-call buttons. --> - <dimen name="in_call_button_height">76dp</dimen> + <dimen name="in_call_button_height">48dp</dimen> <!-- Width of buttons in the extra button row. --> <dimen name="extra_row_button_width">56dp</dimen> @@ -65,33 +65,15 @@ risk of false touches (from your finger wrapping around while holding the phone, *before* moving it up to your face and having the prox sensor kick in.) --> - <dimen name="button_cluster_side_padding">20dp</dimen> + <dimen name="button_cluster_horizontal_padding">20dp</dimen> + <dimen name="button_cluster_vertical_padding">4dp</dimen> + <dimen name="call_button_margin">4dp</dimen> <!-- Dimensions for OTA Call Card --> <dimen name="otaactivate_layout_marginTop">10dp</dimen> <dimen name="otalistenprogress_layout_marginTop">5dp</dimen> <dimen name="otasuccessfail_layout_marginTop">10dp</dimen> - - <!-- Dimensions for Emergency Dialer and dialpad inside the in-call screen --> - <dimen name="dialpad_horizontal_margin">4dp</dimen> - <dimen name="dialpad_vertical_margin">2dp</dimen> - <dimen name="dialpad_digits_text_size">36sp</dimen> - <dimen name="dialpad_digits_height">47dp</dimen> - - <!-- Just used in landscape mode --> - <dimen name="emergency_dialer_digits_height">0px</dimen> - <dimen name="dialpad_center_margin">3dp</dimen> - <dimen name="dialpad_button_margin">3dp</dimen> - - - <!-- Layout weight values for dialpad screen. These layouts will be used in one - LinearLayout (dialpad_fragment.xml), configuring dialpad screen's vertical - ratio. --> - <integer name="dialpad_layout_weight_digits">20</integer> - <integer name="dialpad_layout_weight_dialpad">65</integer> - <integer name="dialpad_layout_weight_additional_buttons">15</integer> - <!-- Dimension used to possibly down-scale high-res photo into what is suitable for notification's large icon. --> <dimen name="notification_icon_size">64dp</dimen> @@ -122,19 +104,6 @@ <dimen name="glowpadview_margin_bottom">-48dip</dimen> <dimen name="glowpadview_margin_right">0dip</dimen> - <!-- Text dimensions for dialpad keys --> - <dimen name="dialpad_key_numbers_size">40sp</dimen> - <dimen name="dialpad_key_letters_size">13sp</dimen> - <dimen name="dialpad_key_star_size">26sp</dimen> - <dimen name="dialpad_key_pound_size">26sp</dimen> - <dimen name="dialpad_key_numbers_width">30dp</dimen> - <dimen name="dialpad_key_letters_width">50dp</dimen> - <dimen name="dialpad_key_height">56dp</dimen> - <dimen name="dialpad_key_plus_size">18sp</dimen> - <dimen name="dialpad_number_to_letters_padding">11dp</dimen> - <dimen name="dialpad_bottom_padding">90dp</dimen> - <dimen name="dialpad_horizontal_padding">5dp</dimen> - <!-- Height of translucent shadow effect --> <dimen name="translucent_shadow_height">2dp</dimen> diff --git a/InCallUI/res/values/styles.xml b/InCallUI/res/values/styles.xml index 1af591963..f77cb24df 100644 --- a/InCallUI/res/values/styles.xml +++ b/InCallUI/res/values/styles.xml @@ -54,6 +54,7 @@ <style name="InCallButton"> <item name="android:layout_width">0px</item> <item name="android:layout_height">@dimen/in_call_button_height</item> + <item name="android:layout_margin">@dimen/call_button_margin</item> <item name="android:layout_weight">1</item> <item name="android:background">?android:attr/selectableItemBackground</item> </style> @@ -68,12 +69,6 @@ <item name="android:textOff">@null</item> </style> - <style name="VerticalSeparator"> - <item name="android:layout_width">2dp</item> - <item name="android:layout_height">match_parent</item> - <item name="android:background">@color/button_background_color</item> - </style> - <!-- Buttons in extra button row. --> <style name="InCallExtraRowButton"> <item name="android:layout_width">@dimen/extra_row_button_width</item> @@ -124,60 +119,9 @@ <item name="android:windowAnimationStyle">@style/InCallAnimationStyle</item> </style> - <style name="InCallDialpadTableRowStyle"> - <item name="android:layout_height">0dp</item> - <item name="android:layout_weight">1</item> - <item name="android:layout_width">match_parent</item> - </style> - - <style name="InCallDialpadKeyNumberStyle"> - <item name="android:textColor">@color/actionbar_background_color</item> - <item name="android:textSize">@dimen/dialpad_key_numbers_size</item> - <item name="android:fontFamily">sans-serif-light</item> - <item name="android:layout_width">@dimen/dialpad_key_numbers_width</item> - <item name="android:layout_height">wrap_content</item> - <item name="android:gravity">center</item> - </style> - - <style name="InCallDialpadKeyStarPoundStyle"> - <item name="android:textColor">@color/dialpad_secondary_text_color</item> - <item name="android:fontFamily">sans-serif-light</item> - <item name="android:layout_width">@dimen/dialpad_key_numbers_width</item> - <item name="android:layout_height">wrap_content</item> - <item name="android:gravity">center</item> - </style> - - <style name="InCallDialpadKeyLettersStyle"> - <item name="android:textColor">@color/dialpad_secondary_text_color</item> - <item name="android:textSize">@dimen/dialpad_key_letters_size</item> - <item name="android:fontFamily">sans-serif-light</item> - <item name="android:layout_width">@dimen/dialpad_key_letters_width</item> - <item name="android:layout_height">wrap_content</item> - <item name="android:paddingLeft">@dimen/dialpad_number_to_letters_padding</item> - </style> - - <style name="InCallDialpadKeyButtonStyle"> - <item name="android:soundEffectsEnabled">false</item> - <item name="android:clickable">true</item> - <item name="android:layout_width">match_parent</item> - <item name="android:layout_height">@dimen/dialpad_key_height</item> - <item name="android:background">@drawable/incall_dialpad_key_colors</item> - <item name="android:focusable">true</item> - </style> - - <style name="InCallDialpadKeyInternalLayoutStyle"> - <item name="android:layout_width">wrap_content</item> - <item name="android:layout_height">wrap_content</item> - <item name="android:layout_gravity">center</item> - <item name="android:gravity">center</item> - </style> - <style name="PrimaryCallInfoPrimaryCallBanner"> <item name="android:layout_alignParentTop">true</item> </style> - <style name="PrimaryCallInfoSupplementaryInfoContainer"> - <item name="android:layout_below">@id/primary_call_banner</item> - </style> <style name="SecondaryCallInfoSecondaryCallName"> <item name="android:layout_gravity">top|left</item> diff --git a/InCallUI/src/com/android/incallui/CallButtonFragment.java b/InCallUI/src/com/android/incallui/CallButtonFragment.java index 2912ecefe..aa2dca784 100644 --- a/InCallUI/src/com/android/incallui/CallButtonFragment.java +++ b/InCallUI/src/com/android/incallui/CallButtonFragment.java @@ -50,7 +50,6 @@ public class CallButtonFragment private ImageButton mAddCallButton; private ImageButton mSwapButton; private ImageButton mAuxiliaryActionButton; - private View mAuxiliaryActionSpacer; private PopupMenu mAudioModePopup; private boolean mAudioModePopupVisible; @@ -133,7 +132,6 @@ public class CallButtonFragment mSwapButton.setOnClickListener(this); mAuxiliaryActionButton = (ImageButton) parent.findViewById(R.id.auxiliaryActionButton); mAuxiliaryActionButton.setOnClickListener(this); - mAuxiliaryActionSpacer = parent.findViewById(R.id.auxiliaryActionSpacer); return parent; } @@ -522,7 +520,6 @@ public class CallButtonFragment @Override public void updateAuxiliaryActionButton(boolean show, String description, Drawable drawable) { mAuxiliaryActionButton.setVisibility(show ? View.VISIBLE : View.GONE); - mAuxiliaryActionSpacer.setVisibility(show ? View.VISIBLE : View.GONE); if (show) { mAuxiliaryActionButton.setContentDescription(description); mAuxiliaryActionButton.setImageDrawable(drawable); diff --git a/InCallUI/src/com/android/incallui/CallCardFragment.java b/InCallUI/src/com/android/incallui/CallCardFragment.java index 29ec687ac..e21a9b14e 100644 --- a/InCallUI/src/com/android/incallui/CallCardFragment.java +++ b/InCallUI/src/com/android/incallui/CallCardFragment.java @@ -16,20 +16,17 @@ package com.android.incallui; -import android.animation.LayoutTransition; import android.content.Context; import android.graphics.drawable.Drawable; import android.os.Bundle; import android.telephony.DisconnectCause; import android.text.TextUtils; -import android.view.Gravity; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; import android.view.ViewStub; import android.view.accessibility.AccessibilityEvent; -import android.widget.Button; import android.widget.ImageView; import android.widget.TextView; @@ -47,14 +44,10 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr private TextView mPhoneNumber; private TextView mNumberLabel; private TextView mPrimaryName; - private TextView mCallServiceLabel; - private ImageView mCallServiceIcon; private TextView mCallStateLabel; private TextView mCallTypeLabel; private ImageView mPhoto; private TextView mElapsedTime; - private ViewGroup mSupplementaryInfoContainer; - private Button mConnectionHandoffButton; // Secondary caller info private ViewStub mSecondaryCallInfo; @@ -111,21 +104,9 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr mNumberLabel = (TextView) view.findViewById(R.id.label); mSecondaryCallInfo = (ViewStub) view.findViewById(R.id.secondary_call_info); mPhoto = (ImageView) view.findViewById(R.id.photo); - mCallServiceLabel = (TextView) view.findViewById(R.id.callServiceLabel); - mCallServiceIcon = (ImageView) view.findViewById(R.id.callServiceIcon); mCallStateLabel = (TextView) view.findViewById(R.id.callStateLabel); mCallTypeLabel = (TextView) view.findViewById(R.id.callTypeLabel); mElapsedTime = (TextView) view.findViewById(R.id.elapsedTime); - mSupplementaryInfoContainer = - (ViewGroup) view.findViewById(R.id.supplementary_info_container); - - mConnectionHandoffButton = (Button) view.findViewById(R.id.connectionHandoffButton); - mConnectionHandoffButton.setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - getPresenter().connectionHandoffClicked(); - } - }); mEndCallButton = view.findViewById(R.id.endButton); mEndCallButton.setOnClickListener(new View.OnClickListener() { @@ -254,82 +235,22 @@ public class CallCardFragment extends BaseFragment<CallCardPresenter, CallCardPr public void setCallState(int state, int cause, boolean bluetoothOn, String gatewayLabel, String gatewayNumber, boolean isWiFi, boolean isHandoffCapable, boolean isHandoffPending) { - String callStateText = null; + String callStateLabel = null; if (Call.State.isDialing(state) && !TextUtils.isEmpty(gatewayLabel)) { // Provider info: (e.g. "Calling via <gatewayLabel>") - callStateText = gatewayLabel; + callStateLabel = gatewayLabel; } else { - callStateText = getCallStateLabelFromState(state, cause); - } - - // Only show call service related text if call state is not being displayed. - String callServiceText = null; - if (TextUtils.isEmpty(callStateText)) { - if (isHandoffPending) { - callServiceText = getResources().getString(R.string.handoff_status_pending); - } else if (isWiFi) { - callServiceText = getResources().getString(R.string.in_call_wifi_connected); - } + callStateLabel = getCallStateLabelFromState(state, cause); } - Log.v(this, "setCallState " + callStateText); + Log.v(this, "setCallState " + callStateLabel); Log.v(this, "DisconnectCause " + DisconnectCause.toString(cause)); Log.v(this, "bluetooth on " + bluetoothOn); Log.v(this, "gateway " + gatewayLabel + gatewayNumber); - // There are cases where we totally skip the animation, in which case remove the transition - // animation here and restore it afterwards. - final boolean skipAnimation = (Call.State.isDialing(state) - || state == Call.State.DISCONNECTED || state == Call.State.DISCONNECTING); - LayoutTransition transition = null; - if (skipAnimation) { - transition = mSupplementaryInfoContainer.getLayoutTransition(); - mSupplementaryInfoContainer.setLayoutTransition(null); - } - - updateCallServiceLabel(isWiFi, callServiceText); - updateCallStateLabel(state, bluetoothOn, callStateText); - - // Only show the handoff button if call state is not being displayed. - boolean showHandoffButton = isHandoffCapable && TextUtils.isEmpty(callStateText); - mConnectionHandoffButton.setVisibility(showHandoffButton ? View.VISIBLE : View.GONE); - mConnectionHandoffButton.setEnabled(!isHandoffPending); - - // Background color. - if (isWiFi) { - mSupplementaryInfoContainer.setBackgroundResource(R.color.wifi_connected_background); - } else { - mSupplementaryInfoContainer.setBackgroundResource( - R.color.incall_call_banner_background_color); - } - - // Restore the animation. - if (skipAnimation) { - mSupplementaryInfoContainer.setLayoutTransition(transition); - } - } - - private void updateCallServiceLabel(boolean isWiFi, String text) { - if (!TextUtils.isEmpty(text)) { - mCallServiceLabel.setText(text); - if (isWiFi) { - mCallServiceIcon.setImageResource(R.drawable.ic_in_call_wifi); - mCallServiceIcon.setVisibility(View.VISIBLE); - } else { - mCallServiceIcon.setVisibility(View.GONE); - } - mCallServiceLabel.setVisibility(View.VISIBLE); - } else { - mCallServiceLabel.setText(""); - mCallServiceIcon.setVisibility(View.GONE); - mCallServiceLabel.setVisibility(View.GONE); - } - } - - private void updateCallStateLabel(int state, boolean bluetoothOn, String text) { // Update the call state label. - mCallStateLabel.setText(text); + mCallStateLabel.setText(callStateLabel); if (Call.State.INCOMING == state) { setBluetoothOn(bluetoothOn); diff --git a/InCallUI/src/com/android/incallui/DialpadFragment.java b/InCallUI/src/com/android/incallui/DialpadFragment.java index e67fbc594..2f3b04bc1 100644 --- a/InCallUI/src/com/android/incallui/DialpadFragment.java +++ b/InCallUI/src/com/android/incallui/DialpadFragment.java @@ -17,7 +17,6 @@ package com.android.incallui; import android.content.Context; -import android.content.res.Resources; import android.os.Bundle; import android.text.Editable; import android.text.method.DialerKeyListener; @@ -31,9 +30,11 @@ import android.view.ViewTreeObserver; import android.view.accessibility.AccessibilityManager; import android.widget.EditText; import android.widget.LinearLayout; -import android.widget.TableRow; import android.widget.TextView; +import com.android.contacts.common.dialpad.DialpadKeyButton; +import com.android.contacts.common.dialpad.DialpadView; + import java.util.HashMap; /** @@ -41,7 +42,7 @@ import java.util.HashMap; */ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPresenter.DialpadUi> implements DialpadPresenter.DialpadUi, View.OnTouchListener, View.OnKeyListener, - View.OnHoverListener { + View.OnHoverListener, View.OnClickListener { private static final float DIALPAD_SLIDE_FRACTION = 1.0f; @@ -124,6 +125,8 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese // KeyListener used with the "dialpad digits" EditText widget. private DTMFKeyListener mDialerKeyListener; + private DialpadView mDialpadView; + /** * Our own key listener, specialized for dealing with DTMF codes. * 1. Ignore the backspace since it is irrelevant. @@ -314,6 +317,21 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese } @Override + public void onClick(View v) { + final AccessibilityManager accessibilityManager = (AccessibilityManager) + v.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE); + // When accessibility is on, simulate press and release to preserve the + // semantic meaning of performClick(). Required for Braille support. + if (accessibilityManager.isEnabled()) { + final int id = v.getId(); + // Checking the press state prevents double activation. + if (!v.isPressed() && mDisplayMap.containsKey(id)) { + getPresenter().processDtmf(mDisplayMap.get(id)); + } + } + } + + @Override public boolean onHover(View v, MotionEvent event) { // When touch exploration is turned on, lifting a finger while inside // the button's hover target bounds should perform a click action. @@ -417,15 +435,18 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese Bundle savedInstanceState) { final View parent = inflater.inflate( com.android.incallui.R.layout.dtmf_twelve_key_dialer_view, container, false); - mDtmfDialerField = (EditText) parent.findViewById(R.id.dtmfDialerField); + mDialpadView = (DialpadView) parent.findViewById(R.id.dialpad_view); + mDialpadView.setCanDigitsBeEdited(false); + mDialpadView.setBackgroundResource(R.color.incall_dialpad_background); + mDtmfDialerField = (EditText) parent.findViewById(R.id.digits); if (mDtmfDialerField != null) { mDialerKeyListener = new DTMFKeyListener(); mDtmfDialerField.setKeyListener(mDialerKeyListener); // remove the long-press context menus that support // the edit (copy / paste / select) functions. mDtmfDialerField.setLongClickable(false); - - setupKeypad(parent); + mDtmfDialerField.setElegantTextHeight(false); + configureKeypadListeners(mDialpadView); } final ViewTreeObserver vto = parent.getViewTreeObserver(); @@ -508,42 +529,17 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese } } - private void setupKeypad(View fragmentView) { + private void configureKeypadListeners(View fragmentView) { final int[] buttonIds = new int[] {R.id.zero, R.id.one, R.id.two, R.id.three, R.id.four, R.id.five, R.id.six, R.id.seven, R.id.eight, R.id.nine, R.id.star, R.id.pound}; - - final int[] numberIds = new int[] {R.string.dialpad_0_number, R.string.dialpad_1_number, - R.string.dialpad_2_number, R.string.dialpad_3_number, R.string.dialpad_4_number, - R.string.dialpad_5_number, R.string.dialpad_6_number, R.string.dialpad_7_number, - R.string.dialpad_8_number, R.string.dialpad_9_number, R.string.dialpad_star_number, - R.string.dialpad_pound_number}; - - final int[] letterIds = new int[] {R.string.dialpad_0_letters, R.string.dialpad_1_letters, - R.string.dialpad_2_letters, R.string.dialpad_3_letters, R.string.dialpad_4_letters, - R.string.dialpad_5_letters, R.string.dialpad_6_letters, R.string.dialpad_7_letters, - R.string.dialpad_8_letters, R.string.dialpad_9_letters, - R.string.dialpad_star_letters, R.string.dialpad_pound_letters}; - - final Resources resources = getResources(); - - View button; - TextView numberView; - TextView lettersView; - + DialpadKeyButton dialpadKey; for (int i = 0; i < buttonIds.length; i++) { - button = fragmentView.findViewById(buttonIds[i]); - button.setOnTouchListener(this); - button.setClickable(true); - button.setOnKeyListener(this); - button.setOnHoverListener(this); - numberView = (TextView) button.findViewById(R.id.dialpad_key_number); - lettersView = (TextView) button.findViewById(R.id.dialpad_key_letters); - final String numberString = resources.getString(numberIds[i]); - numberView.setText(numberString); - button.setContentDescription(numberString); - if (lettersView != null) { - lettersView.setText(resources.getString(letterIds[i])); - } + dialpadKey = (DialpadKeyButton) fragmentView.findViewById(buttonIds[i]); + dialpadKey.setBackgroundResource(R.drawable.incall_dialpad_key_colors); + dialpadKey.setOnTouchListener(this); + dialpadKey.setOnKeyListener(this); + dialpadKey.setOnHoverListener(this); + dialpadKey.setOnClickListener(this); } } } |