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

Unified Diff: remoting/android/java/src/org/chromium/chromoting/AccountsAdapter.java

Issue 628133003: Use View Holder pattern in AccountsAdapter.getView(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/android/java/src/org/chromium/chromoting/AccountsAdapter.java
diff --git a/remoting/android/java/src/org/chromium/chromoting/AccountsAdapter.java b/remoting/android/java/src/org/chromium/chromoting/AccountsAdapter.java
index 5731205ddf4d1e9a3b3f809d727d0db2962dd6b6..06a686dc748e0f7f503e3e9f3f971642d485f927 100644
--- a/remoting/android/java/src/org/chromium/chromoting/AccountsAdapter.java
+++ b/remoting/android/java/src/org/chromium/chromoting/AccountsAdapter.java
@@ -26,7 +26,10 @@ public class AccountsAdapter extends ArrayAdapter<Account> {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
- View view = mInflater.inflate(R.layout.account_selected, parent, false);
+ View view = convertView;
+ if (view == null) {
+ view = mInflater.inflate(R.layout.account_selected, parent, false);
+ }
Account account = getItem(position);
TextView target = (TextView) view.findViewById(R.id.account_name);
target.setText(account.name);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698