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
diff --git a/res/drawable-hdpi/ic_partial_secure.png b/res/drawable-hdpi/ic_partial_secure.png
new file mode 100644
index 0000000..76ba96a
--- /dev/null
+++ b/res/drawable-hdpi/ic_partial_secure.png
Binary files differ
diff --git a/res/drawable-hdpi/ic_secure.png b/res/drawable-hdpi/ic_secure.png
new file mode 100644
index 0000000..4f15fc4
--- /dev/null
+++ b/res/drawable-hdpi/ic_secure.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_partial_secure.png b/res/drawable-mdpi/ic_partial_secure.png
new file mode 100644
index 0000000..b3ca0cc
--- /dev/null
+++ b/res/drawable-mdpi/ic_partial_secure.png
Binary files differ
diff --git a/res/drawable-mdpi/ic_secure.png b/res/drawable-mdpi/ic_secure.png
new file mode 100644
index 0000000..70d7edd
--- /dev/null
+++ b/res/drawable-mdpi/ic_secure.png
Binary files differ
diff --git a/res/layout/url_bar.xml b/res/layout/url_bar.xml
index e85ad83..8b4a3c0 100644
--- a/res/layout/url_bar.xml
+++ b/res/layout/url_bar.xml
@@ -60,7 +60,7 @@
<ImageView
android:id="@+id/lock"
android:layout_width="wrap_content"
- android:layout_height="wrap_content"
+ android:layout_height="match_parent"
style="@style/HoloIcon"
android:visibility="gone" />
<EditText
diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java
index ff9a418..df2d0ea 100644
--- a/src/com/android/browser/BrowserActivity.java
+++ b/src/com/android/browser/BrowserActivity.java
@@ -199,10 +199,8 @@
return;
}
- mSecLockIcon = Resources.getSystem().getDrawable(
- android.R.drawable.ic_secure);
- mMixLockIcon = Resources.getSystem().getDrawable(
- android.R.drawable.ic_partial_secure);
+ mSecLockIcon = getResources().getDrawable(R.drawable.ic_secure);
+ mMixLockIcon = getResources().getDrawable(R.drawable.ic_partial_secure);
// Create the tab control and our initial tab
mTabControl = new TabControl(this);
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 void onSelect(String txt);
+ public void onFilterComplete(int count);
+
}
public SuggestionsAdapter(Context ctx, CompletionListener listener) {
@@ -179,7 +181,7 @@
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 @@
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 @@
class SuggestFilter extends Filter {
- int count;
SuggestionResults results;
@Override
@@ -269,14 +270,13 @@
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 @@
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 @@
}
}
}
-
}
@Override
protected void publishResults(CharSequence constraint, FilterResults fresults) {
mResults = (SuggestionResults) fresults.values;
+ mListener.onFilterComplete(fresults.count);
notifyDataSetChanged();
}
@@ -454,10 +454,10 @@
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 @@
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) {
diff --git a/src/com/android/browser/TitleBarXLarge.java b/src/com/android/browser/TitleBarXLarge.java
index 93a6fb5..7310f75 100644
--- a/src/com/android/browser/TitleBarXLarge.java
+++ b/src/com/android/browser/TitleBarXLarge.java
@@ -105,6 +105,7 @@
mUrlFocused.setUrlInputListener(this);
mUrlUnfocused.setOnFocusChangeListener(this);
mUrlFocused.setContainer(mFocusContainer);
+ mUnfocusContainer.setOnClickListener(this);
}
public void onFocusChange(View v, boolean hasFocus) {
@@ -119,7 +120,9 @@
@Override
public void onClick(View v) {
- if (mBackButton == v) {
+ if (mUnfocusContainer == v) {
+ mUrlUnfocused.requestFocus();
+ } else if (mBackButton == v) {
mBrowserActivity.getTopWindow().goBack();
} else if (mForwardButton == v) {
mBrowserActivity.getTopWindow().goForward();