diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-08-31 16:17:04 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-08-31 16:17:04 +0000 |
commit | c39ea3c55fac807c0b98aabdf56c70dc8a49036c (patch) | |
tree | e282668a9587cf6c1ec7b604dea860400c75c6c7 /java/com/android/dialer/searchfragment/README.md | |
parent | 68038172793ee0e2ab3e2e56ddfbeb82879d1f58 (diff) | |
parent | 2ca4318cc1ee57dda907ba2069bd61d162b1baef (diff) |
Merge "Update Dialer source to latest internal Google revision."
Diffstat (limited to 'java/com/android/dialer/searchfragment/README.md')
-rw-r--r-- | java/com/android/dialer/searchfragment/README.md | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/java/com/android/dialer/searchfragment/README.md b/java/com/android/dialer/searchfragment/README.md new file mode 100644 index 000000000..b3b9135e5 --- /dev/null +++ b/java/com/android/dialer/searchfragment/README.md @@ -0,0 +1,62 @@ +# Dialer Search Ui + +searchfragment/ contains all code relevant to loading, rendering and filtering +search results in both dialpad search and regular search. + +## Loading + +### On Device Contacts + +On device contacts loading happens in SearchContactsCursorLoader. It is used in +conjunction with NewSearchFragment and Loader Callbacks to return a cursor from +cp2 containing all of the relevant info needed to rendering. + +### Business Search + +// TODO(calderwoodra) + +### Google Directory Search + +// TODO(calderwoodra) + +## Rendering + +NewSearchFragment, SearchAdapter, SearchContactViewHolder and +SearchCursorManager are used to render contact information. The fragment's +recyclerview, adapter and viewholder work as expected like a normal recyclerview +paradigm. + +The are three things to note about rendering: + +* There are three data sources rendered: On device contacts, business search + results and google directory results. +* SearchContactsCursorLoader returns its cursor from cp2 and we filter/wrap it + with SearchContactCursor to render useful results (see below). +* SearchCursorManager is used to coalesce all three data sources to help with + determining row count, row type and returning the correct data source for + each position. + +## Filtering + +On device contacts are filtered using SearchContactCursor. We wrap the cursor +returned from SearchContactsCursorLoader in NewSearchFragment#onLoadFinished in +order to abstract away the filtering logic from the recyclerview adapter and +viewholders. + +SearchContactCursor applies filtering in SearchContactCursor#filter to remove +duplicate phone numbers returned from cp2 and phone numbers that do not match +the given search query. + +Filtering methods used are: + +* T9/dialpad search methods + * Initial match (957 matches [W]illiam [J]ohn [S]mith) + * Number + name match (1800946 matches [1800-Win]-A-Prize) +* Numeric/dialpad search methods + * Simple number match (510333 matches [510-333]-7596) + * Country-code agnostic matching for E164 normalized numbers (9177 matches + +65[9177]6930) + * Country-code agnostic matching (510333 matches 1-[510-333]-7596) + * Area-code agnostic matching (333 matches 510-[333]-7596) +* Name/keyboard search methods: + * Simple name match (564 matches [Joh]n) |