public
View getView(
int
position, View convertView, ViewGroup parent) {
final
ViewHolder vh;
final
int
pos = position;
int
point, cash, temp3, totalCost;
boolean
[] tld_val =
new
boolean
[
7
];
double
temp;
String temp2;
Intent intent = ((Activity) mContext).getIntent();
tld = intent.getExtras().getString(
"Value"
);
if
(convertView ==
null
) {
LayoutInflater Inflater = (LayoutInflater) mContext
.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
convertView = Inflater.inflate(R.layout.point_item_layout, parent,
false
);
vh =
new
ViewHolder();
vh.mTextView = (TextView) convertView
.findViewById(R.id.coupon_text);
vh.mCheckBox = (CheckBox) convertView
.findViewById(R.id.coupon_checkbtn);
vh.mCheckBox.setId(position);
convertView.setTag(vh);
}
else
{
vh = (ViewHolder) convertView.getTag();
}
if
(!mDataArr.get(pos).mName.contains(
"."
)) {
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
if
(tld.contains(
"com"
)){
if
(mDataArr.get(pos).mName.contains(
"com"
)){
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
}
if
(tld.contains(
"net"
)){
if
(mDataArr.get(pos).mName.contains(
"net"
)){
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
}
if
(tld.contains(
"co.kr"
)){
if
(mDataArr.get(pos).mName.contains(
"co.kr"
)){
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
}
if
( tld.contains(
"kr"
)){
if
(mDataArr.get(pos).mName.contains(
"kr"
)){
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
}
if
(tld.contains(
"org"
)){
if
(mDataArr.get(pos).mName.contains(
"org"
)){
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
}
if
(tld.contains(
"info"
)){
if
(mDataArr.get(pos).mName.contains(
"info"
)){
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
}
if
(tld.contains(
"me"
)){
if
(mDataArr.get(pos).mName.contains(
"me"
)){
vh.mCheckBox.setEnabled(
true
);
vh.mTextView.setTextColor(Color.RED);
}
}
vh.mTextView.setText(mDataArr.get(pos).mName);
vh.mCheckBox.setChecked(mDataArr.get(pos).mChecked);
vh.mCheckBox.setTag(mDataArr.get(pos));
vh.mCheckBox.setOnClickListener(
new
View.OnClickListener() {
public
void
onClick(View v) {
if
(vh.mCheckBox.isChecked()) {
coupon_chk_cnt +=
1
;
}
else
{
coupon_chk_cnt -=
1
;
}
});
return
convertView;
}