diff options
author | Yorke Lee <yorkelee@google.com> | 2013-01-28 12:10:30 -0800 |
---|---|---|
committer | Yorke Lee <yorkelee@google.com> | 2013-02-12 14:13:31 -0800 |
commit | 55b030a8bbb0323a4823fc34f3167a248a0ff899 (patch) | |
tree | 73b3766312b2f66a19ff2e5241c3c952da63733c /res | |
parent | af11e78aecf0c07ae8960210f6c18377035a2c70 (diff) |
Smart Dialling v2 with phone number support
Behavior:
Use a prefix tree to cache contacts instead of an array list
Perform matches against phone numbers as well
DialpadFragment now ignores results from stale tasks where
queries no longer match
Add ability to not use default phone number for phone number
disambiguation dialog
Contacts are now ranked by the order which they were sorted
by in the ContactsProvider (affinity)
Change remapAccentedChars to always return lowercase characters to avoid
overhead of uppercase character conversion
Resource/Layout changes:
Tweak margins so that the section containing smart dial
suggestions looks cleaner
Use color resource instead of hardcoding color values
Add phone number to SmartDial items
ContentObserver:
Add a contentobserver to be notified on changes in contacts
Refactored cache to allow for forced cache refreshes
Use a single instance of SmartDialCache
Tests:
Added SmartDialTrie tests
Comments:
Comment cleanup
Change-Id: Ica2854e2845d4d75048aa1fd982f139496d21bf3
Diffstat (limited to 'res')
-rw-r--r-- | res/layout/dialpad_fragment.xml | 5 | ||||
-rw-r--r-- | res/layout/dialpad_smartdial_item.xml | 33 | ||||
-rw-r--r-- | res/values/colors.xml | 1 |
3 files changed, 26 insertions, 13 deletions
diff --git a/res/layout/dialpad_fragment.xml b/res/layout/dialpad_fragment.xml index e672551bb..27ba2da46 100644 --- a/res/layout/dialpad_fragment.xml +++ b/res/layout/dialpad_fragment.xml @@ -56,17 +56,16 @@ android:src="@drawable/ic_dial_action_delete" /> </LinearLayout> - <View style="@style/DialpadHorizontalSeparator"/> - <!-- Smard dial suggestion section --> <GridView android:id="@+id/dialpad_smartdial_list" android:layout_width="match_parent" - android:layout_height="42sp" + 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"/> <!-- Keypad section --> diff --git a/res/layout/dialpad_smartdial_item.xml b/res/layout/dialpad_smartdial_item.xml index eed257035..54f2a084e 100644 --- a/res/layout/dialpad_smartdial_item.xml +++ b/res/layout/dialpad_smartdial_item.xml @@ -13,16 +13,29 @@ See the License for the specific language governing permissions and limitations under the License. --> - -<com.android.dialer.dialpad.SmartDialTextView +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" - android:id="@+id/contact_name" + android:orientation="vertical" android:layout_width="match_parent" - android:layout_height="42sp" - android:padding="@dimen/smartdial_suggestions_padding" - android:textColor="#39caff" - android:textSize="16sp" - android:singleLine="true" - android:ellipsize="none" - android:gravity="center" + android:layout_height="46sp"> + + <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:textSize="16sp" + android:singleLine="true" + android:ellipsize="none" + android:gravity="center" + /> + <com.android.dialer.dialpad.SmartDialTextView + android:id="@+id/contact_number" + android:layout_width="match_parent" + android:layout_height="16sp" + android:textColor="@color/dialtacts_secondary_text_color" + android:textSize="13sp" + android:gravity="center" /> +</LinearLayout> diff --git a/res/values/colors.xml b/res/values/colors.xml index ebdc2f60e..288f58b64 100644 --- a/res/values/colors.xml +++ b/res/values/colors.xml @@ -19,6 +19,7 @@ <!-- 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 of the text describing an unconsumed missed call. --> |