From 1be0178a11b1cc3b06867b14446e1e041e97a82c Mon Sep 17 00:00:00 2001 From: Yorke Lee Date: Wed, 7 Nov 2012 15:11:44 -0800 Subject: Add smart dialling capabilities to dialer Layout changes to dialpad fragment to make space for smart dial suggestions. This feature does not appear in landscape mode. SmartDialTextView automatically resizes text to fit within the bounds of the view. SmartDialAdapter highlights certain portions of the matching name based on match positions provided by SmartDialNameMatcher. SmartDialLoaderTask is an AsyncTask that caches all contacts with a phone number into memory, or matches all contact names against a provided query to return a list of matches (maximum of 3). SmartDialNameMatcher contains utility functions to remove accents from accented characters and normalize a phone number. It also contains the matching logic that determines if a contact's display name matches a numeric query. Added some tests for SmartDialNameMatcher Bug: 6977981 Change-Id: I43e1a70d8d0d46e02fc67fe1caaec9a1769124f5 --- res/layout/dialpad_fragment.xml | 18 ++++++++++++++---- res/layout/dialpad_smartdial_item.xml | 28 ++++++++++++++++++++++++++++ res/values/colors.xml | 2 ++ res/values/dimens.xml | 5 +++++ res/values/styles.xml | 6 ++++++ 5 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 res/layout/dialpad_smartdial_item.xml (limited to 'res') diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml index 6423638a3..e672551bb 100644 --- a/res/layout/dialpad_fragment.xml +++ b/res/layout/dialpad_fragment.xml @@ -56,13 +56,23 @@ android:src="@drawable/ic_dial_action_delete" /> + + + + + - + + + + diff --git a/res/values/colors.xml b/res/values/colors.xml index 9f3e3a2b0..2828725ac 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -18,5 +18,7 @@ #888888 + #39caff + #ffffff diff --git a/res/values/dimens.xml b/res/values/dimens.xml index 2c8d59662..4034f7303 100644 --- a/res/values/dimens.xml +++ b/res/values/dimens.xml @@ -50,4 +50,9 @@ 56dip + + + 4dp + 2dp + 27dp diff --git a/res/values/styles.xml b/res/values/styles.xml index 6f36bf1d8..4f64cb37a 100644 --- a/res/values/styles.xml +++ b/res/values/styles.xml @@ -104,6 +104,12 @@ false + +