diff options
author | Yorke Lee <yorkelee@google.com> | 2014-03-28 17:43:03 -0700 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2014-05-02 16:35:45 -0700 |
commit | ec9a6feb3110fde5805f999a9666a18be82089c1 (patch) | |
tree | e201f8532d423d34d70892eb087b836e96caed66 /res | |
parent | 37a53ad46134f9eaf3647c12f130c55652bbd624 (diff) |
Refactor dialpad into its own view
Initial work needed to make the dialpad shareable within Dialer
and InCallUI. This CL refactors the code that controls the appearance
of the dialpad into a new custom view called DialpadView.
The parent activity/fragment is still responsible for assigning listeners
and handling event callbacks from the DialpadView.
Change-Id: I11ab8159619413caf1c3d8fa16fff475b822633b
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/dialpad_fragment.xml | 41 | ||||
-rw-r--r-- | res/layout/dialpad_view.xml | 89 |
2 files changed, 93 insertions, 37 deletions
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml index 9d3c62043..33324d1e0 100644 --- a/res/layout/dialpad_fragment.xml +++ b/res/layout/dialpad_fragment.xml @@ -30,47 +30,14 @@ android:layout_width="match_parent" android:layout_height="3dp" android:background="@drawable/shadow_fade_up" /> - <view class="com.android.dialer.dialpad.DialpadFragment$HoverIgnoringLinearLayout" - android:id="@+id/top" - android:layout_height="wrap_content" - android:layout_width="match_parent" - android:layout_gravity="bottom" - android:orientation="vertical" - android:layoutDirection="ltr" - android:background="@color/background_dialpad" - android:clickable="true"> - - <Space - android:layout_width="match_parent" - android:layout_height="2dp" - android:background="@color/dialpad_separator_line_color" /> - - <Space - android:layout_width="match_parent" - android:layout_height="5dp" /> - - <include layout="@layout/dialpad_digits" /> - - <Space - android:layout_width="match_parent" - android:layout_height="4dp" /> - - <include layout="@layout/dialpad" /> - - <Space - android:layout_width="match_parent" - android:layout_height="2dp" - android:background="@color/dialpad_separator_line_color" /> - - <!-- "Dialpad chooser" UI, shown only when the user brings up the + <include layout="@layout/dialpad_view" /> + <!-- "Dialpad chooser" UI, shown only when the user brings up the Dialer while a call is already in progress. When this UI is visible, the other Dialer elements (the textfield/button and the dialpad) are hidden. --> - <ListView android:id="@+id/dialpadChooser" + <ListView android:id="@+id/dialpadChooser" android:layout_width="match_parent" android:layout_height="wrap_content" - android:layout_weight="1" + android:background="@color/background_dialer_light" android:visibility="gone" /> - - </view> </view> diff --git a/res/layout/dialpad_view.xml b/res/layout/dialpad_view.xml new file mode 100644 index 000000000..148e5ac4c --- /dev/null +++ b/res/layout/dialpad_view.xml @@ -0,0 +1,89 @@ +<?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. +--> +<view class="com.android.dialer.dialpad.DialpadView" + xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/dialpad_view" + android:layout_height="wrap_content" + android:layout_width="match_parent" + android:layout_gravity="bottom" + android:orientation="vertical" + android:layoutDirection="ltr" + android:background="@color/background_dialpad"> + + <Space + android:layout_width="match_parent" + android:layout_height="2dp" + android:background="@color/dialpad_separator_line_color" /> + + <Space + android:layout_width="match_parent" + android:layout_height="10dp" /> + + <!-- Text field and possibly soft menu button above the keypad where + the digits are displayed. --> + <LinearLayout + android:id="@+id/digits_container" + android:layout_width="match_parent" + android:layout_height="@dimen/dialpad_digits_height" + android:orientation="horizontal"> + + <view class="com.android.dialer.dialpad.DigitsEditText" + android:id="@+id/digits" + android:layout_width="0dp" + android:layout_height="match_parent" + android:paddingLeft="@dimen/dialpad_digits_padding" + android:scrollHorizontally="true" + android:singleLine="true" + android:layout_weight="1" + android:gravity="center" + android:background="@android:color/transparent" + android:maxLines="1" + android:textSize="@dimen/dialpad_digits_text_size" + android:freezesText="true" + android:focusableInTouchMode="true" + android:cursorVisible="false" + android:textColor="@color/dialpad_digits_text_color" + android:textCursorDrawable="@null" + android:fontFamily="sans-serif-light" + android:textStyle="normal" /> + + <ImageButton + android:id="@+id/deleteButton" + android:paddingLeft="@dimen/dialpad_digits_padding" + android:paddingRight="@dimen/dialpad_digits_padding" + android:layout_width="wrap_content" + android:layout_height="match_parent" + android:state_enabled="false" + android:background="@drawable/dialpad_key_colors" + android:contentDescription="@string/description_delete_button" + android:src="@drawable/ic_dial_action_delete" /> + </LinearLayout> + + <Space + android:layout_width="match_parent" + android:layout_height="8dp" /> + + <include layout="@layout/dialpad" /> + + <Space + android:layout_width="match_parent" + android:layout_height="8dp" /> + + <Space + android:layout_width="match_parent" + android:layout_height="2dp" + android:background="@color/dialpad_separator_line_color" /> +</view> |