@Override public View getChildView( int groupPosition, int childPosition, boolean b, View view, ViewGroup viewGroup) { // OrderCenterItemAdapter carStyleAdapter = new OrderCenterItemAdapter(context,new // HashMap<String ,String>(),R.layout.order_center_child_item); ViewHolder viewHolder1 = null; if (view == null) { viewHolder1 = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(context); view = inflater.inflate(R.layout.order_group_middle, null); viewHolder1.order_heard_show = (TextView) view.findViewById(R.id.order_heard_show); viewHolder1.hotel_room_type = (TextView) view.findViewById(R.id.hotel_room_type); viewHolder1.hotel_order_inroom_day = (TextView) view.findViewById(R.id.hotel_order_inroom_day); viewHolder1.hotel_order_outroom_day = (TextView) view.findViewById(R.id.hotel_order_outroom_day); viewHolder1.hotel_order_no = (TextView) view.findViewById(R.id.hotel_order_no); viewHolder1.tx_guest_name = (TextView) view.findViewById(R.id.tx_guest_name); viewHolder1.tx_guest_phone = (TextView) view.findViewById(R.id.tx_guest_phone); viewHolder1.point_value = (TextView) view.findViewById(R.id.point_value); viewHolder1.price_value = (TextView) view.findViewById(R.id.price_value); viewHolder1.text_count_days = (TextView) view.findViewById(R.id.text_count_days); view.setTag(viewHolder1); } else { viewHolder1 = (ViewHolder) view.getTag(); } if (child != null) { viewHolder1.hotel_order_inroom_day.setText( DateUtil.formatStringDateTime( child.get(childPosition).getRoomInfo().getStartDate(), "MM月dd日")); viewHolder1.hotel_order_outroom_day.setText( DateUtil.formatStringDateTime( child.get(childPosition).getRoomInfo().getEndDate(), "MM月dd日")); viewHolder1.order_heard_show.setText(child.get(childPosition).getRoomInfo().getHotelName()); viewHolder1.hotel_room_type.setText( child.get(childPosition).getRoomInfo().getViewIntro() + child.get(childPosition).getRoomInfo().getRoomTypeName() + "-" + child.get(childPosition).getRoomInfo().getFloorName() + "-" + child.get(childPosition).getRoomInfo().getRoomCode() + " " + child.get(childPosition).getRoomInfo().getBedTypeContent()); int subday = DateUtil.nDaysBetweenTwoDate( child.get(childPosition).getRoomInfo().getStartDate(), child.get(childPosition).getRoomInfo().getEndDate()); viewHolder1.text_count_days.setText( context.getString(R.string._subday, subday + "")); // 共计天数 } return view; }
@Override public View getChildView( int groupPosition, int childPosition, boolean b, View view, ViewGroup viewGroup) { // OrderCenterItemAdapter carStyleAdapter = new OrderCenterItemAdapter(context,new // HashMap<String ,String>(),R.layout.order_center_child_item); ViewHolder viewHolder1 = null; if (view == null) { viewHolder1 = new ViewHolder(); LayoutInflater inflater = LayoutInflater.from(context); view = inflater.inflate(R.layout.common_subdays, null); viewHolder1.order_heard_show = (TextView) view.findViewById(R.id.order_heard_show); viewHolder1.hotel_room_type = (TextView) view.findViewById(R.id.hotel_room_type); viewHolder1.hotel_order_inroom_day = (TextView) view.findViewById(R.id.hotel_order_inroom_day); viewHolder1.hotel_order_outroom_day = (TextView) view.findViewById(R.id.hotel_order_outroom_day); viewHolder1.hotel_order_no = (TextView) view.findViewById(R.id.hotel_order_no); viewHolder1.tx_guest_name = (TextView) view.findViewById(R.id.tx_guest_name); viewHolder1.tx_guest_phone = (TextView) view.findViewById(R.id.tx_guest_phone); viewHolder1.point_value = (TextView) view.findViewById(R.id.point_value); viewHolder1.price_value = (TextView) view.findViewById(R.id.price_value); viewHolder1.text_count_days = (TextView) view.findViewById(R.id.text_count_days); view.setTag(viewHolder1); } else { viewHolder1 = (ViewHolder) view.getTag(); } int subday = DateUtil.nDaysBetweenTwoDate( group.get(groupPosition).getStartDate(), group.get(groupPosition).getEndDate()); viewHolder1.text_count_days.setText(context.getString(R.string._subday, subday + "")); // 共计天数 viewHolder1.hotel_order_inroom_day.setText( DateUtil.formatStringDateTime(group.get(groupPosition).getStartDate(), "MM月dd日")); viewHolder1.hotel_order_outroom_day.setText( DateUtil.formatStringDateTime(group.get(groupPosition).getEndDate(), "MM月dd日")); viewHolder1.hotel_order_no.setText(group.get(groupPosition).getOrderNo()); // for(GuestInfo guest:guestInfos){ // } viewHolder1.tx_guest_name.setText(guestInfos.get(0).getGuestName()); viewHolder1.tx_guest_phone.setText(guestInfos.get(0).getTelephone()); viewHolder1.point_value.setText( Handler_String.isBlank(group.get(groupPosition).getPointNight()) ? "0.00" : group.get(groupPosition).getPointNight()); viewHolder1.price_value.setText(group.get(groupPosition).getConsumption()); // Animation translateAnimation= AnimationUtils.loadAnimation(context, R.anim.push_up_in); // view.setAnimation(translateAnimation); return view; }
/** * @return void 返回类型 * @throws @Title: initView @Description: 初始化控件 */ public void initView() { LayoutInflater inflater = android.view.LayoutInflater.from(getActivity()); heardView = inflater.inflate(R.layout.reservation_conditions_room, null); listview_roomlist.addHeaderView(heardView); gallery_hotel = (IMGGallery) heardView.findViewById(R.id.gallery_hotel); indicator_container = (LinearLayout) heardView.findViewById(R.id.indicator_container); text_startDate = (TextView) heardView.findViewById(R.id.text_startDate); text_endDate = (TextView) heardView.findViewById(R.id.text_endDate); text_count_days = (TextView) heardView.findViewById(R.id.text_count_days); text_hotelname = (TextView) heardView.findViewById(R.id.text_hotelname); text_hotelidx = (TextView) heardView.findViewById(R.id.text_hotelidx); rd = (ReservationDto) MapVo.get("reservtion"); text_hotelname.setText(rd.getHotelName()); text_hotelidx.setText(rd.getProjectIdx()); text_startDate.setText(rd.getStartDate()); text_endDate.setText(rd.getEndDate()); int subDay = DateUtil.nDaysBetweenTwoDate(rd.getStartDate(), rd.getEndDate()); text_count_days.setText(getString(R.string._subday, subDay)); }