diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2017-09-19 21:55:42 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-09-19 21:55:42 +0000 |
commit | 15c5ccfc3a76c89b047722b398e63889d900ec5e (patch) | |
tree | ccc4ba1be4af03ced6f837b0dc86bb9800ce9370 /java/com/android/dialer/searchfragment/list/SearchAdapter.java | |
parent | 06d4df10f100b9bbfcf119aef376770eeb6eb82c (diff) | |
parent | 791f820f5108b3ea914690145ef261d6c01bf41a (diff) |
Merge changes I3f26d915,I59500877,Ia08ce56f
* changes:
Perform remote reachability query if caller is not in contacts
Only enable voicemail transcription on android O and later
Removed zero suggest from dialpad search in new search fragment.
Diffstat (limited to 'java/com/android/dialer/searchfragment/list/SearchAdapter.java')
-rw-r--r-- | java/com/android/dialer/searchfragment/list/SearchAdapter.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/java/com/android/dialer/searchfragment/list/SearchAdapter.java b/java/com/android/dialer/searchfragment/list/SearchAdapter.java index 3bfdd98f3..d4b5cf29d 100644 --- a/java/com/android/dialer/searchfragment/list/SearchAdapter.java +++ b/java/com/android/dialer/searchfragment/list/SearchAdapter.java @@ -21,6 +21,7 @@ import android.content.Intent; import android.support.annotation.VisibleForTesting; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.RecyclerView.ViewHolder; +import android.text.TextUtils; import android.view.LayoutInflater; import android.view.ViewGroup; import com.android.dialer.callcomposer.CallComposerActivity; @@ -50,6 +51,7 @@ public final class SearchAdapter extends RecyclerView.Adapter<ViewHolder> private final SearchCursorManager searchCursorManager; private final Activity activity; + private boolean showZeroSuggest; private String query; private CallInitiationType.Type callInitiationType = CallInitiationType.Type.UNKNOWN_INITIATION; @@ -124,9 +126,21 @@ public final class SearchAdapter extends RecyclerView.Adapter<ViewHolder> @Override public int getItemCount() { + if (TextUtils.isEmpty(query) && !showZeroSuggest) { + return 0; + } return searchCursorManager.getCount(); } + /** + * @param visible If true and query is empty, the adapter won't show any list elements. + * @see #setQuery(String) + * @see #getItemCount() + */ + public void setZeroSuggestVisible(boolean visible) { + showZeroSuggest = visible; + } + public void setQuery(String query) { this.query = query; if (searchCursorManager.setQuery(query)) { |