Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/NearbyUrlsAdapter.java

Issue 1634213002: Append late URLs at the end of the nearby URL list (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: expand ternary operators, rename notifyOnUrlListChanged Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.physicalweb; 5 package org.chromium.chrome.browser.physicalweb;
6 6
7 import android.content.Context; 7 import android.content.Context;
8 import android.graphics.Bitmap; 8 import android.graphics.Bitmap;
9 import android.view.LayoutInflater; 9 import android.view.LayoutInflater;
10 import android.view.View; 10 import android.view.View;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 PwsResult pwsResult = getItem(position); 74 PwsResult pwsResult = getItem(position);
75 Bitmap iconBitmap = mIconUrlToIconMap.get(pwsResult.iconUrl); 75 Bitmap iconBitmap = mIconUrlToIconMap.get(pwsResult.iconUrl);
76 76
77 titleTextView.setText(pwsResult.title); 77 titleTextView.setText(pwsResult.title);
78 urlTextView.setText(pwsResult.siteUrl); 78 urlTextView.setText(pwsResult.siteUrl);
79 descriptionTextView.setText(pwsResult.description); 79 descriptionTextView.setText(pwsResult.description);
80 iconImageView.setImageBitmap(iconBitmap); 80 iconImageView.setImageBitmap(iconBitmap);
81 81
82 return view; 82 return view;
83 } 83 }
84
85 /**
86 * Gets whether the specified site URL is in the list.
87 * @param siteUrl A string containing the site URL.
88 * @return Boolean true if the specified site URL is already in the list.
89 */
90 public boolean hasSiteUrl(String siteUrl) {
91 int itemCount = getCount();
92 for (int position = 0; position < itemCount; ++position) {
93 PwsResult pwsResult = getItem(position);
94 if (siteUrl.equals(pwsResult.siteUrl)) {
95 return true;
96 }
97 }
98
99 return false;
100 }
84 } 101 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698