제가 너무 비효율적으로 하는건 아닌지..
먼저 레이아웃에 6개의 레이아웃과 텍스트뷰와 이미지뷰가 있습니다.
이게 현재 모두 투명인 상태이고 상황에따라서 3개가 보여질수도 4개가 보여질수도 있습니다.
참고사항으로 레이아웃의 백그라운드이미지와 텍스트뷰 내용만 경우에 따라 변경이 되고,
이미지뷰의 이미지는 계속 하나의 이미지를 사용합니다.
그래서 저는 이렇게 했습니다.
각각(레이아웃, 텍스트뷰, 이미지뷰)6개의 배열을 잡고 각각의 객체를 생성하였고
그리고 각각 배열의 주소값을 가지고 for를 돌면서 로직처리를 하였습니다.
바로 이런 방식이죠.
sectionAddLayArr[0] = (LinearLayout)convertView.findViewById(R.id.section_add_lay0);
sectionAddLayArr[1] = (LinearLayout)convertView.findViewById(R.id.section_add_lay1);
sectionAddLayArr[2] = (LinearLayout)convertView.findViewById(R.id.section_add_lay2);
sectionAddLayArr[3] = (LinearLayout)convertView.findViewById(R.id.section_add_lay3);
sectionAddLayArr[4] = (LinearLayout)convertView.findViewById(R.id.section_add_lay4);
sectionAddLayArr[5] = (LinearLayout)convertView.findViewById(R.id.section_add_lay5);
sectionAddTextView[0] = (TextView)convertView.findViewById(R.id.section_add_textview0);
sectionAddTextView[1] = (TextView)convertView.findViewById(R.id.section_add_textview1);
sectionAddTextView[2] = (TextView)convertView.findViewById(R.id.section_add_textview2);
sectionAddTextView[3] = (TextView)convertView.findViewById(R.id.section_add_textview3);
sectionAddTextView[4] = (TextView)convertView.findViewById(R.id.section_add_textview4);
sectionAddTextView[5] = (TextView)convertView.findViewById(R.id.section_add_textview5);
sectionDelete[0] = (ImageView)convertView.findViewById(R.id.section_add_delete0);
sectionDelete[1] = (ImageView)convertView.findViewById(R.id.section_add_delete1);
sectionDelete[2] = (ImageView)convertView.findViewById(R.id.section_add_delete2);
sectionDelete[3] = (ImageView)convertView.findViewById(R.id.section_add_delete3);
sectionDelete[4] = (ImageView)convertView.findViewById(R.id.section_add_delete4);
sectionDelete[5] = (ImageView)convertView.findViewById(R.id.section_add_delete5);
이렇게 하여 for를 돌면서 이벤트 처리도 하고 조건 비교도 하여
상황에 맞게 레이아웃의 백그라운드 이미지나 텍스트뷰 내용을 변경하고..
상황에 맞게 이미지뷰의 이미지를 투명에서 보이게끔 처리를 하였습니다.
이렇게 하긴 하는데 뭔가 이상한 느낌이 듭니다...
이렇게 처리하고 있는게 올바른건가요;;