Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ........
- int select;
- public void setSelect(int select){
- this.select = select;
- }
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- LayoutInflater inflater = (LayoutInflater) context
- .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
- View rowView = inflater.inflate(R.layout.item_2colum_1_1, parent, false);
- TextView textView = (TextView) rowView.findViewById(R.id.tvNameGroup);
- TextView textView1 = (TextView) rowView.findViewById(R.id.tvBeginEnadNumber);
- Groups item = values.get(position);
- textView.setText(item.getName());
- textView1.setText(item.getMin() + " - " + item.getMax());
- if(position%2 == 0){
- textView.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.tvborder_color));
- textView1.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.tvborder_color));
- }
- if(position == select){
- textView.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.tvborder_select));
- textView1.setBackgroundDrawable(context.getResources().getDrawable(R.drawable.tvborder_select));
- }
- return rowView;
- }
- ........
- @Override
- public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
- iSelect = position;
- groupsAdapter.setSelect(iSelect);
- listGroups.invalidateViews();
- }
Add Comment
Please, Sign In to add comment