This source file includes following definitions.
- getView
- getDropDownView
package org.chromium.chromoting;
import android.accounts.Account;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
public class AccountsAdapter extends ArrayAdapter<Account> {
private LayoutInflater mInflater;
public AccountsAdapter(Context context, Account[] accounts) {
super(context, 0, accounts);
mInflater = (LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View 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);
return view;
}
@Override
public View getDropDownView(int position, View convertView, ViewGroup parent) {
TextView view = (TextView)mInflater.inflate(R.layout.account_dropdown, parent, false);
Account account = getItem(position);
view.setText(account.name);
return view;
}
}