01.
public
View getView(
int
position, View view, ViewGroup parent) {
02.
03.
LayoutInflater mInflater = (LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
04.
view = mInflater.inflate(R.layout.layout_shipment, parent,
false
);
05.
06.
HashMap<String, String> hm = (HashMap<String, String>) MebmerList.get(position);
07.
08.
((TextView) view.findViewById(R.id.text_Do_Number)).setText(String.valueOf(hm.get(
"Do_No"
)));
09.
((TextView) view.findViewById(R.id.text_time_day)).setText(String.valueOf(hm.get(
"Req_Date"
)));
10.
((TextView) view.findViewById(R.id.text_LoadItem)).setText(String.valueOf(hm.get(
"Plant_Name"
)));
11.
((TextView) view.findViewById(R.id.text_Address)).setText(String.valueOf(hm.get(
"Ship_Address"
)));
12.
13.
TextView text_Status = (TextView)view.findViewById(R.id.text_Status);
14.
switch
(Integer.parseInt(hm.get(
"Do_Status"
).toString())) {
15.
case
1
:
16.
text_Status.setText(
"ยีงไม่ได้รับใบงาน"
);
17.
text_Status.setBackgroundColor(Color.RED);
18.
break
;
19.
case
2
:
20.
text_Status.setText(
"รับงาน"
);
21.
text_Status.setBackgroundColor(Color.BLUE);
22.
break
;
23.
case
3
:
24.
text_Status.setText(
"เสร็จสิ้น"
);
25.
text_Status.setBackgroundColor(Color.GREEN);
26.
break
;
27.
case
4
:
28.
text_Status.setText(
"รอส่ง"
);
29.
text_Status.setBackgroundColor(Color.YELLOW);
30.
break
;
31.
}
32.
return
view;
33.
34.
}