From 0506f2dd9239e23099244e101f7d32d5fc189668 Mon Sep 17 00:00:00 2001 From: Michael Kolb Date: Thu, 14 Oct 2010 16:20:16 -0700 Subject: Fixed lock icon, url touch area, dropdown visibility Bug 2989058 Bug 3098918 added light colored icons (not final assets) added click handler to generic web icon fixed suggestion adapter result count Change-Id: I1842335be22eab6da2dd4187b2147e535a9ac77c --- src/com/android/browser/SuggestionsAdapter.java | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/com/android/browser/SuggestionsAdapter.java') diff --git a/src/com/android/browser/SuggestionsAdapter.java b/src/com/android/browser/SuggestionsAdapter.java index 30e46fe..903768c 100644 --- a/src/com/android/browser/SuggestionsAdapter.java +++ b/src/com/android/browser/SuggestionsAdapter.java @@ -79,6 +79,8 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli public void onSelect(String txt); + public void onFilterComplete(int count); + } public SuggestionsAdapter(Context ctx, CompletionListener listener) { @@ -179,7 +181,7 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli if (item != null) { bindView(iv, item); } else { - iv.setVisibility((mResults.getLeftCount() == 0) ? View.GONE : + iv.setVisibility((mResults.getLeftCount() == 0) ? View.GONE : View.INVISIBLE); } item = getItem(position + mResults.getLineCount()); @@ -190,7 +192,7 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli if (item != null) { bindView(iv, item); } else { - iv.setVisibility((mResults.getRightCount() == 0) ? View.GONE : + iv.setVisibility((mResults.getRightCount() == 0) ? View.GONE : View.INVISIBLE); } return view; @@ -244,7 +246,6 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli class SuggestFilter extends Filter { - int count; SuggestionResults results; @Override @@ -269,14 +270,13 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli return res; } results = new SuggestionResults(); - count = 0; if (constraint != null) { for (CursorSource sc : mSources) { sc.runQuery(constraint); } mixResults(); } - res.count = count; + res.count = results.getLineCount(); res.values = results; return res; } @@ -284,9 +284,9 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli void mixResults() { for (int i = 0; i < mSources.size(); i++) { CursorSource s = mSources.get(i); - int n = Math.min(s.getCount(), (mLandscapeMode ? mLinesLandscape + int n = Math.min(s.getCount(), (mLandscapeMode ? mLinesLandscape : mLinesPortrait)); - boolean more = true; + boolean more = false; for (int j = 0; j < n; j++) { results.addResult(s.getItem()); more = s.moveToNext(); @@ -305,12 +305,12 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli } } } - } @Override protected void publishResults(CharSequence constraint, FilterResults fresults) { mResults = (SuggestionResults) fresults.values; + mListener.onFilterComplete(fresults.count); notifyDataSetChanged(); } @@ -454,10 +454,10 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli selection = COMBINED_SELECTION; } Uri.Builder ub = BrowserContract.Combined.CONTENT_URI.buildUpon(); - ub.appendQueryParameter(BrowserContract.PARAM_LIMIT, + ub.appendQueryParameter(BrowserContract.PARAM_LIMIT, Integer.toString(mLinesPortrait)); mCursor = - mContext.getContentResolver().query(ub.build(), COMBINED_PROJECTION, + mContext.getContentResolver().query(ub.build(), COMBINED_PROJECTION, selection, (constraint != null) ? args : null, BrowserContract.Combined.VISITS + " DESC, " + @@ -538,10 +538,10 @@ public class SuggestionsAdapter extends BaseAdapter implements Filterable, OnCli String[] args = new String[] {constraint.toString()}; String selection = BrowserContract.Searches.SEARCH + " LIKE ?"; Uri.Builder ub = BrowserContract.Searches.CONTENT_URI.buildUpon(); - ub.appendQueryParameter(BrowserContract.PARAM_LIMIT, + ub.appendQueryParameter(BrowserContract.PARAM_LIMIT, Integer.toString(mLinesPortrait)); mCursor = - mContext.getContentResolver().query(ub.build(), SEARCHES_PROJECTION, + mContext.getContentResolver().query(ub.build(), SEARCHES_PROJECTION, selection, args, BrowserContract.Searches.DATE + " DESC"); if (mCursor != null) { -- cgit v1.1