1 |
|
package com.dreamcatcher.bicycle.view.settinglistview; |
2 |
|
|
3 |
|
import java.util.ArrayList; |
4 |
|
|
5 |
|
import android.view.View; |
6 |
|
import android.view.ViewGroup; |
7 |
|
import android.widget.BaseAdapter; |
8 |
|
|
9 |
|
import com.dreamcatcher.bicycle.R; |
10 |
|
|
|
|
| 0% |
Uncovered Elements: 29 (29) |
Complexity: 9 |
Complexity Density: 0,56 |
|
11 |
|
public class SettingListAdapter extends BaseAdapter { |
12 |
|
ArrayList<View> mArrayList = null; |
13 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
14 |
0
|
public SettingListAdapter(ArrayList<View> arrayList){... |
15 |
0
|
mArrayList = arrayList; |
16 |
|
} |
17 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
18 |
0
|
public int getCount() {... |
19 |
0
|
return mArrayList.size(); |
20 |
|
} |
21 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
22 |
0
|
public Object getItem(int position) {... |
23 |
0
|
return mArrayList.get(position); |
24 |
|
} |
25 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
26 |
0
|
public long getItemId(int position) {... |
27 |
0
|
return 0; |
28 |
|
} |
29 |
|
|
|
|
| 0% |
Uncovered Elements: 20 (20) |
Complexity: 5 |
Complexity Density: 0,42 |
|
30 |
0
|
public View getView(int position, View convertView, ViewGroup parent) {... |
31 |
0
|
View view = null; |
32 |
0
|
if(convertView == null){ |
33 |
0
|
view = mArrayList.get(position); |
34 |
0
|
if(mArrayList.size() > 1){ |
35 |
0
|
if(position == 0){ |
36 |
0
|
view.setBackgroundResource(R.drawable.setting_listitem_bg_top); |
37 |
0
|
}else if(position < mArrayList.size() -1){ |
38 |
0
|
view.setBackgroundResource(R.drawable.setting_listitem_bg_middle); |
39 |
|
}else { |
40 |
0
|
view.setBackgroundResource(R.drawable.setting_listitem_bg_bottom); |
41 |
|
} |
42 |
|
}else { |
43 |
0
|
view.setBackgroundResource(R.drawable.setting_listitem_bg_whole); |
44 |
|
} |
45 |
|
}else { |
46 |
0
|
view = convertView; |
47 |
|
} |
48 |
0
|
return view; |
49 |
|
} |
50 |
|
} |