summaryrefslogtreecommitdiffstats
path: root/res/values
diff options
context:
space:
mode:
authorChiao Cheng <chiaocheng@google.com>2012-12-27 17:14:53 -0800
committerChiao Cheng <chiaocheng@google.com>2012-12-28 13:41:06 -0800
commitcae605bed4d43e1925fc8c1803def0ef1d0924a5 (patch)
treefbd24732239cc297e67bca29acb0d5a81ab1b96f /res/values
parent32c1bff720d06296b00ee827e06f69422ed4ae5c (diff)
downloadandroid_packages_apps_ContactsCommon-cae605bed4d43e1925fc8c1803def0ef1d0924a5.tar.gz
android_packages_apps_ContactsCommon-cae605bed4d43e1925fc8c1803def0ef1d0924a5.tar.bz2
android_packages_apps_ContactsCommon-cae605bed4d43e1925fc8c1803def0ef1d0924a5.zip
Find proper snippet in multi-line and large result.
Previous CL removed the use ContactsContract.snippetize(). This method found the proper line in a multi-line results and then snippetized the line if it was too long. This CL adds that functionality back without using snippetize(). This new code is faster because it only does text intensive processing when the text is long. The previous snippetize method did processing for all strings. In addition, the old method iterated over the snippet multiple times (i.e. first with contains, then subsequently tokenizes, etc). This change re-uses the initial search results and remembers the search information so multiple iterations are not necessary. In addition, tokenizing has been optimized based on the match. We only need to chop off excess content rather than tokenizing the whole string. This CL also makes snippet more friend to landscape mode. Previously, the number of snippet tokens shown was hard-coded to 2 on each side. Furthermore, this caused longer tokens to exceed screen real estate. Now the number of tokens shown are determined more accurately by character count versus real estate. In landscape mode, this allows us to show much more of the search result. Finally, fixed a highlight problem when the search query contained punctuation. For example, a search for {.ben.} would not match {ben}. This Cl resolves that issue by cleaning the search query. Bug: 5929143 Change-Id: I5c368e6de8b34ca912f86926f862a02f95199fa7
Diffstat (limited to 'res/values')
-rw-r--r--res/values/integers.xml3
1 files changed, 3 insertions, 0 deletions
diff --git a/res/values/integers.xml b/res/values/integers.xml
index 73e9aee9..f3b54a43 100644
--- a/res/values/integers.xml
+++ b/res/values/integers.xml
@@ -19,4 +19,7 @@
<!-- Determines the number of columns in a ContactTileRow in the favorites tab -->
<integer name="contact_tile_column_count_in_favorites">2</integer>
+
+ <!-- The number of characters in the snippet before we need to tokenize and ellipse. -->
+ <integer name="snippet_length_before_tokenize">30</integer>
</resources>