diff options
author | Ihab Awad <ihab@google.com> | 2014-03-21 14:55:48 -0700 |
---|---|---|
committer | Ihab Awad <ihab@google.com> | 2014-03-21 15:58:18 -0700 |
commit | c079b57fc3b5e6687d3889fcef7fba862ff64fcf (patch) | |
tree | 2de281b8d8d9756fba28d1ebc9ccb4572e0d8c18 | |
parent | 192bd89408f3ef6b8cb3db71e978a928456d9a04 (diff) |
DO NOT MERGE. Rearrange dialpad layout for better esthetics.
b/13551615
Change-Id: I79380c1919b0d457e5c151812146b35deb61396e
Conflicts:
res/layout/dialpad_incall.xml
-rw-r--r-- | InCallUI/res/layout/call_button_fragment.xml | 4 | ||||
-rw-r--r-- | InCallUI/res/layout/dialpad_incall.xml (renamed from InCallUI/res/layout/dialpad.xml) | 47 | ||||
-rw-r--r-- | InCallUI/res/layout/dialpad_key_incall.xml (renamed from InCallUI/res/layout/dialpad_key.xml) | 8 | ||||
-rw-r--r-- | InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml | 17 | ||||
-rw-r--r-- | InCallUI/res/values/dimens.xml | 5 | ||||
-rw-r--r-- | InCallUI/res/values/styles.xml | 18 | ||||
-rw-r--r-- | InCallUI/src/com/android/incallui/DialpadFragment.java | 23 |
7 files changed, 51 insertions, 71 deletions
diff --git a/InCallUI/res/layout/call_button_fragment.xml b/InCallUI/res/layout/call_button_fragment.xml index 013d1b22a..a182fc127 100644 --- a/InCallUI/res/layout/call_button_fragment.xml +++ b/InCallUI/res/layout/call_button_fragment.xml @@ -33,6 +33,9 @@ android:id="@+id/bottomButtons" android:orientation="vertical" android:layout_width="match_parent" + android:background="#0000ff" + android:layout_margin="0dp" + android:padding="0dp" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:visibility="invisible"> @@ -51,7 +54,6 @@ <ImageButton android:id="@+id/endButton" style="@style/InCallEndButton" android:layout_width="match_parent" - android:layout_marginTop="2dp" android:src="@drawable/ic_in_call_phone_hangup" android:background="@drawable/end_call_background" android:contentDescription="@string/onscreenEndCallText"/> diff --git a/InCallUI/res/layout/dialpad.xml b/InCallUI/res/layout/dialpad_incall.xml index 2b5644b11..d74b9f4a3 100644 --- a/InCallUI/res/layout/dialpad.xml +++ b/InCallUI/res/layout/dialpad_incall.xml @@ -18,7 +18,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/dialpad" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="0dp" + android:layout_weight="4" android:layout_gravity="center_horizontal" android:paddingLeft="@dimen/dialpad_horizontal_padding" android:paddingRight="@dimen/dialpad_horizontal_padding" @@ -26,47 +27,49 @@ android:stretchColumns="*" android:layoutDirection="ltr" > - <TableRow> - <include layout="@layout/dialpad_key" android:id="@+id/one"/> - <include layout="@layout/dialpad_key" android:id="@+id/two"/> - <include layout="@layout/dialpad_key" android:id="@+id/three"/> + <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> - <include layout="@layout/dialpad_key" android:id="@+id/four"/> - <include layout="@layout/dialpad_key" android:id="@+id/five"/> - <include layout="@layout/dialpad_key" android:id="@+id/six"/> + <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> - <include layout="@layout/dialpad_key" android:id="@+id/seven"/> - <include layout="@layout/dialpad_key" android:id="@+id/eight"/> - <include layout="@layout/dialpad_key" android:id="@+id/nine"/> + <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> + <TableRow style="@style/InCallDialpadTableRowStyle"> <com.android.dialer.dialpad.DialpadKeyButton android:id="@+id/star" - style="@style/DialpadKeyButtonStyle"> + style="@style/InCallDialpadKeyButtonStyle"> <LinearLayout - style="@style/DialpadKeyInternalLayoutStyle"> + style="@style/InCallDialpadKeyInternalLayoutStyle"> <TextView - android:id="@+id/dialpad_key_number" - style="@style/DialpadKeyStarPoundStyle" /> + 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.dialer.dialpad.DialpadKeyButton> - <include layout="@layout/dialpad_key" android:id="@+id/zero"/> + <include layout="@layout/dialpad_key_incall" android:id="@+id/zero"/> <com.android.dialer.dialpad.DialpadKeyButton android:id="@+id/pound" - style="@style/DialpadKeyButtonStyle"> + style="@style/InCallDialpadKeyButtonStyle"> <LinearLayout - style="@style/DialpadKeyInternalLayoutStyle"> + style="@style/InCallDialpadKeyInternalLayoutStyle"> <TextView android:id="@id/dialpad_key_number" - style="@style/DialpadKeyStarPoundStyle" /> + style="@style/InCallDialpadKeyStarPoundStyle" + android:textSize="@dimen/dialpad_key_pound_size" /> <View android:layout_height="match_parent" android:layout_width="@dimen/dialpad_key_letters_width" /> diff --git a/InCallUI/res/layout/dialpad_key.xml b/InCallUI/res/layout/dialpad_key_incall.xml index 180074dec..8ce4b5135 100644 --- a/InCallUI/res/layout/dialpad_key.xml +++ b/InCallUI/res/layout/dialpad_key_incall.xml @@ -16,19 +16,19 @@ <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" - style="@style/DialpadKeyButtonStyle"> + style="@style/InCallDialpadKeyButtonStyle"> - <LinearLayout style="@style/DialpadKeyInternalLayoutStyle"> + <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/DialpadKeyNumberStyle" /> + style="@style/InCallDialpadKeyNumberStyle" /> <TextView android:id="@+id/dialpad_key_letters" - style="@style/DialpadKeyLettersStyle" /> + 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 7240cb119..d921ca34a 100644 --- a/InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml +++ b/InCallUI/res/layout/dtmf_twelve_key_dialer_view.xml @@ -22,22 +22,12 @@ android:orientation="vertical" android:layout_marginTop="1dip" > - <View - android:id="@+id/dialpad_spacer" - android:layout_width="match_parent" - android:layout_height="0dp" - android:layout_weight="1"/> - <view class="com.android.incallui.DialpadFragment$HoverIgnoringLinearLayout" android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="wrap_content" + android:layout_height="match_parent" android:background="@color/background_dialpad"> - <View - android:layout_height="@dimen/translucent_shadow_height" - android:layout_width="match_parent" - android:background="@color/translucent_shadow" /> <!-- Display of the digits you've typed so far. This widget appears completely non-interactive to the user: you @@ -48,7 +38,8 @@ <EditText android:id="@+id/dtmfDialerField" android:layout_width="match_parent" - android:layout_height="@dimen/dialpad_digits_height" + android:layout_height="0dp" + android:layout_weight="1" android:layout_marginTop="10dp" android:layout_marginBottom="5dp" android:layout_marginStart="32dp" @@ -66,6 +57,6 @@ android:focusableInTouchMode="false" android:clickable="false"/> - <include layout="@layout/dialpad"/> + <include layout="@layout/dialpad_incall"/> </view> </view> diff --git a/InCallUI/res/values/dimens.xml b/InCallUI/res/values/dimens.xml index 9bde442e6..92e55d60c 100644 --- a/InCallUI/res/values/dimens.xml +++ b/InCallUI/res/values/dimens.xml @@ -45,7 +45,7 @@ <dimen name="in_call_button_height">76dp</dimen> <!-- Height of the in-call "End" button. Match with Contact's dimens/call_button_height --> - <dimen name="in_call_end_button_height">74dp</dimen> + <dimen name="in_call_end_button_height">60dp</dimen> <!-- Width of buttons in the extra button row. --> <dimen name="extra_row_button_width">56dp</dimen> @@ -120,7 +120,8 @@ <!-- 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_pound_size">26sp</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> diff --git a/InCallUI/res/values/styles.xml b/InCallUI/res/values/styles.xml index 1b15d2937..3fb2bb28a 100644 --- a/InCallUI/res/values/styles.xml +++ b/InCallUI/res/values/styles.xml @@ -131,7 +131,13 @@ <item name="android:windowAnimationStyle">@style/InCallAnimationStyle</item> </style> - <style name="DialpadKeyNumberStyle"> + <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> @@ -140,16 +146,15 @@ <item name="android:gravity">center</item> </style> - <style name="DialpadKeyStarPoundStyle"> + <style name="InCallDialpadKeyStarPoundStyle"> <item name="android:textColor">@color/dialpad_secondary_text_color</item> - <item name="android:textSize">@dimen/dialpad_key_star_pound_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="DialpadKeyLettersStyle"> + <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> @@ -158,7 +163,7 @@ <item name="android:paddingLeft">@dimen/dialpad_number_to_letters_padding</item> </style> - <style name="DialpadKeyButtonStyle"> + <style name="InCallDialpadKeyButtonStyle"> <item name="android:soundEffectsEnabled">false</item> <item name="android:clickable">true</item> <item name="android:layout_width">match_parent</item> @@ -167,10 +172,11 @@ <item name="android:focusable">true</item> </style> - <style name="DialpadKeyInternalLayoutStyle"> + <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"> diff --git a/InCallUI/src/com/android/incallui/DialpadFragment.java b/InCallUI/src/com/android/incallui/DialpadFragment.java index e9cabd2c4..1c22c3d80 100644 --- a/InCallUI/src/com/android/incallui/DialpadFragment.java +++ b/InCallUI/src/com/android/incallui/DialpadFragment.java @@ -98,24 +98,6 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese } } - private class DismissListener implements View.OnClickListener, View.OnLongClickListener { - - @Override - public void onClick(View view) { - dismiss(); - } - - @Override - public boolean onLongClick(View view) { - dismiss(); - return true; - } - - private void dismiss() { - ((InCallActivity) getActivity()).getCallButtonFragment().displayDialpad(false); - } - } - private EditText mDtmfDialerField; /** Hash Map to map a view id to a character*/ @@ -461,11 +443,6 @@ public class DialpadFragment extends BaseFragment<DialpadPresenter, DialpadPrese setupKeypad(parent); } - final DismissListener dl = new DismissListener(); - final View spacer = parent.findViewById(R.id.dialpad_spacer); - spacer.setOnClickListener(dl); - spacer.setOnLongClickListener(dl); - final ViewTreeObserver vto = parent.getViewTreeObserver(); // Adjust the translation of the DialpadFragment in a preDrawListener instead of in // DialtactsActivity, because at the point in time when the DialpadFragment is added, |