summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/SuggestionsAdapter.java
diff options
context:
space:
mode:
authorMichael Kolb <kolby@google.com>2010-10-14 16:20:16 -0700
committerMichael Kolb <kolby@google.com>2010-10-14 17:22:13 -0700
commit0506f2dd9239e23099244e101f7d32d5fc189668 (patch)
tree1839f65a5de2c459cd994ae69e25b4f06c666309 /src/com/android/browser/SuggestionsAdapter.java
parent7b20ddd4f03d59cca8fdd4aee790784421570aab (diff)
downloadpackages_apps_Browser-0506f2dd9239e23099244e101f7d32d5fc189668.zip
packages_apps_Browser-0506f2dd9239e23099244e101f7d32d5fc189668.tar.gz
packages_apps_Browser-0506f2dd9239e23099244e101f7d32d5fc189668.tar.bz2
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
Diffstat (limited to 'src/com/android/browser/SuggestionsAdapter.java')
-rw-r--r--src/com/android/browser/SuggestionsAdapter.java24
1 files changed, 12 insertions, 12 deletions
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) {