| |
---|
| | import android.view.View; |
---|
| | import android.view.ViewGroup; |
---|
| | import android.widget.ArrayAdapter; |
---|
| | import android.widget.TextView; |
---|
| | |
---|
| | import org.ntlab.irisclient.models.Member; |
---|
| | |
---|
| | import java.util.List; |
---|
| | |
---|
| | public class MemberListAdapter extends ArrayAdapter<String> { |
---|
| |
---|
| | } |
---|
| | private LayoutInflater inflater; |
---|
| | private final int itemLayoutId; |
---|
| | private final List<String> memberList; |
---|
| | private final List<Member> dcList; |
---|
| | |
---|
| | final int redColor = Color.rgb(172, 32,32); |
---|
| | final int blueColor = Color.rgb(32, 32, 172); |
---|
| | final int grayColor = Color.rgb(172, 172, 172); |
---|
| | |
---|
| | public MemberListAdapter(Context context, int itemLayoutId, |
---|
| | List<String> members) { |
---|
| | List<String> members, List<Member> mn) { |
---|
| | super(context, 0); |
---|
| | this.inflater = (LayoutInflater) context.getSystemService( |
---|
| | Context.LAYOUT_INFLATER_SERVICE); |
---|
| | this.itemLayoutId = itemLayoutId; |
---|
| | this.memberList = members; |
---|
| | this.dcList = mn; |
---|
| | |
---|
| | } |
---|
| | |
---|
| | @Override |
---|
| | public View getView(int position, View convertView, ViewGroup parent) { |
---|
| |
---|
| | |
---|
| | convertView.setTag(holder); |
---|
| | |
---|
| | convertView.setBackgroundColor(grayColor); |
---|
| | |
---|
| | /*for(int i = 0 ; i < dcList.size();i++){ |
---|
| | if(dcList.get(i).getBelongs().equals("r")) { |
---|
| | convertView.setBackgroundColor(redColor); |
---|
| | } |
---|
| | }*/ |
---|
| | |
---|
| | |
---|
| | /*if (position == 0) { |
---|
| | // 背景色を変える |
---|
| | convertView.setBackgroundColor(Color.rgb(255, 127, 255)); |
---|
| | }else{ |
---|
| |
---|
| | |