summaryrefslogtreecommitdiff
path: root/res
diff options
context:
space:
mode:
authorYorke Lee <yorkelee@google.com>2013-05-07 11:59:36 -0700
committerYorke Lee <yorkelee@google.com>2013-05-14 13:55:21 -0700
commit3a18654bf87df4f17880551b6cfa45c871917960 (patch)
tree55a360b02c7e799def416e9b672c52a4028b97e6 /res
parentdbb6c6fc024bbacf3b495a44bdddccf8502793ae (diff)
Animation for smart dialing suggestions
Suggestions now appear with a fade in and slide up animation. Suggestions vanish with a fade out and slide down animation. If a suggestion is moved into the middle, it slides to the left/right as appropriate. Change the layout containing suggestions to a LinearLayout, in order to better support animations. Renamed SmartDialAdapter to SmartDialController, and also refactored it to handle entries for a LinearLayout instead of a GridView, as well as adding animation support and view management. Use null object pattern in SmartDialEntry to better handle null entries. Start displaying suggestions on the first digit entered. Bug 8840240 Change-Id: If4e16006c0b36d2244434e0b2d8f3d3b997b0ad2
Diffstat (limited to 'res')
-rw-r--r--res/layout/dialpad_fragment.xml30
-rw-r--r--res/layout/dialpad_smartdial_item.xml12
-rw-r--r--res/values/colors.xml7
3 files changed, 33 insertions, 16 deletions
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml
index 13d91bd27..f3bd2a213 100644
--- a/res/layout/dialpad_fragment.xml
+++ b/res/layout/dialpad_fragment.xml
@@ -57,17 +57,29 @@
android:src="@drawable/ic_dial_action_delete" />
</LinearLayout>
- <!-- Smard dial suggestion section -->
- <GridView
- android:id="@+id/dialpad_smartdial_list"
+ <!-- Smart dial suggestion section.
+ sp is used here for this layout instead of dp in order for it to resize as
+ appropriate when the font size increases. This is a one-time exception that is
+ ok in this case because there is space for the suggestion strip to expand. -->
+ <RelativeLayout
+ android:id="@+id/dialpad_smartdial_container"
android:layout_width="match_parent"
android:layout_height="50sp"
- android:columnWidth="0dp"
- android:numColumns="3"
- android:stretchMode="columnWidth"
- android:gravity="center"
- android:layout_marginTop="@dimen/dialpad_vertical_margin"
- android:background="@drawable/dialpad_background"/>
+ android:layout_marginTop="@dimen/dialpad_vertical_margin">
+ <View
+ android:id="@+id/dialpad_smartdial_list_background"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:background="@drawable/dialpad_background">
+ </View>
+ <LinearLayout
+ android:id="@+id/dialpad_smartdial_list"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ android:orientation="horizontal"
+ android:gravity="center">
+ </LinearLayout>
+ </RelativeLayout>
<!-- Keypad section -->
<include layout="@layout/dialpad" />
diff --git a/res/layout/dialpad_smartdial_item.xml b/res/layout/dialpad_smartdial_item.xml
index 54f2a084e..32d801e80 100644
--- a/res/layout/dialpad_smartdial_item.xml
+++ b/res/layout/dialpad_smartdial_item.xml
@@ -16,15 +16,19 @@
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
- android:layout_width="match_parent"
- android:layout_height="46sp">
+ android:layout_width="0dp"
+ android:layout_weight="1"
+ android:layout_height="match_parent"
+ android:layout_marginTop="2dp"
+ android:layout_marginBottom="2dp"
+ android:background="?android:attr/selectableItemBackground">
<com.android.dialer.dialpad.SmartDialTextView
android:id="@+id/contact_name"
android:layout_width="match_parent"
android:layout_height="28sp"
android:padding="@dimen/smartdial_suggestions_padding"
- android:textColor="@color/smartdial_primary_text_color"
+ android:textColor="@color/smartdial_name_primary_text_color"
android:textSize="16sp"
android:singleLine="true"
android:ellipsize="none"
@@ -34,7 +38,7 @@
android:id="@+id/contact_number"
android:layout_width="match_parent"
android:layout_height="16sp"
- android:textColor="@color/dialtacts_secondary_text_color"
+ android:textColor="@color/smartdial_number_primary_text_color"
android:textSize="13sp"
android:gravity="center"
/>
diff --git a/res/values/colors.xml b/res/values/colors.xml
index 288f58b64..1aa217fe8 100644
--- a/res/values/colors.xml
+++ b/res/values/colors.xml
@@ -18,9 +18,10 @@
<!-- Secondary text color in the Phone app -->
<color name="dialtacts_secondary_text_color">#888888</color>
- <color name="smartdial_confidence_drawable_color">#39caff</color>
- <color name="smartdial_primary_text_color">#39caff</color>
- <color name="smartdial_highlighted_text_color">#ffffff</color>
+ <color name="smartdial_name_primary_text_color">#0099cc</color>
+ <color name="smartdial_name_highlighted_text_color">#39c9ff</color>
+ <color name="smartdial_number_primary_text_color">#bbbbbb</color>
+ <color name="smartdial_number_highlighted_text_color">#ffffff</color>
<!-- Color of the text describing an unconsumed missed call. -->
<color name="call_log_missed_call_highlight_color">#FF0000</color>