// Path: src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleCheckBoxListAdapter.java
// public class GosScheduleCheckBoxListAdapter extends BaseAdapter {
// 
// 	ArrayList<GosScheduleCheckBoxListDateHolder> items;
// 	private LayoutInflater mInflater;
// 
// 	public GosScheduleCheckBoxListAdapter(Context context, ArrayList<GosScheduleCheckBoxListDateHolder> items) {
// 		super();
// 		this.items = items;
// 		mInflater = LayoutInflater.from(context);
// 	}
// 
// 	@Override
// 	public int getCount() {
// 		return items.size();
// 	}
// 
// 	@Override
// 	public Object getItem(int position) {
// 		// TODO Auto-generated method stub
// 		return items.get(position);
// 	}
// 
// 	@Override
// 	public long getItemId(int position) {
// 		return position;
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 		View view;
// 		if (convertView == null) {
// 			view = mInflater.inflate(R.layout.item_comd_listview_with_checkbox, null);
// 		} else {
// 			view = convertView;
// 		}
// 		TextView itemName = (TextView) view.findViewById(R.id.tv_item);
// 		CheckBox checkBox = (CheckBox) view.findViewById(R.id.cb_date);
// 		itemName.setText(items.get(position).itemName);
// 		checkBox.setChecked(items.get(position).checked);
// 		return view;
// 	}
// 
// }
// 
// Path: src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleCheckBoxListDateHolder.java
// public class GosScheduleCheckBoxListDateHolder {
// 
// 	public String itemName;
// 	public boolean checked;
// 
// 	/**
// 	 * @param itemName
// 	 * @param checked
// 	 */
// 	public GosScheduleCheckBoxListDateHolder(String itemName, boolean checked) {
// 		super();
// 		this.itemName = itemName;
// 		this.checked = checked;
// 	}
// 
// }


import java.util.ArrayList;
import com.gizwits.opensource.smartlight.R;
import com.gizwits.opensource.devicecontrol.ui.adapter.GosScheduleCheckBoxListAdapter;
import com.gizwits.opensource.devicecontrol.ui.adapter.GosScheduleCheckBoxListDateHolder;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;
		tvBack.setOnClickListener(this);
		tvSave.setOnClickListener(this);
	}

	private void initView() {
		tvBack = (TextView) findViewById(R.id.tv_back);
		tvSave = (TextView) findViewById(R.id.tv_save);
		lvRepeat = (ListView) findViewById(R.id.lv_repeat);
	}

	private void initDate() {
		Intent intent = getIntent();
		repeat = intent.getStringExtra("repeat");
		String[] week = { "sun", "mon", "tue", "wed", "thu", "fri", "sat"};
		String[] itemNames = {  getResources().getString(R.string.apm_every_sun),getResources().getString(R.string.apm_every_mon),
				getResources().getString(R.string.apm_every_tue), getResources().getString(R.string.apm_every_wed),
				getResources().getString(R.string.apm_every_thu), getResources().getString(R.string.apm_every_fri),
				getResources().getString(R.string.apm_every_sat) };
		for (int i = 0; i < itemNames.length; i++) {
			String itemName = itemNames[i];
			Boolean checked = false;
			if (repeat.contains(week[i])) {
				checked = true;
			}
			GosScheduleCheckBoxListDateHolder item = new GosScheduleCheckBoxListDateHolder(itemName, checked);
			repeatDates.add(item);
		}
	}

	private void UpdateUI() {
// Path: src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleCheckBoxListAdapter.java
// public class GosScheduleCheckBoxListAdapter extends BaseAdapter {
// 
// 	ArrayList<GosScheduleCheckBoxListDateHolder> items;
// 	private LayoutInflater mInflater;
// 
// 	public GosScheduleCheckBoxListAdapter(Context context, ArrayList<GosScheduleCheckBoxListDateHolder> items) {
// 		super();
// 		this.items = items;
// 		mInflater = LayoutInflater.from(context);
// 	}
// 
// 	@Override
// 	public int getCount() {
// 		return items.size();
// 	}
// 
// 	@Override
// 	public Object getItem(int position) {
// 		// TODO Auto-generated method stub
// 		return items.get(position);
// 	}
// 
// 	@Override
// 	public long getItemId(int position) {
// 		return position;
// 	}
// 
// 	@Override
// 	public View getView(int position, View convertView, ViewGroup parent) {
// 		View view;
// 		if (convertView == null) {
// 			view = mInflater.inflate(R.layout.item_comd_listview_with_checkbox, null);
// 		} else {
// 			view = convertView;
// 		}
// 		TextView itemName = (TextView) view.findViewById(R.id.tv_item);
// 		CheckBox checkBox = (CheckBox) view.findViewById(R.id.cb_date);
// 		itemName.setText(items.get(position).itemName);
// 		checkBox.setChecked(items.get(position).checked);
// 		return view;
// 	}
// 
// }
// 
// Path: src/com/gizwits/opensource/devicecontrol/ui/adapter/GosScheduleCheckBoxListDateHolder.java
// public class GosScheduleCheckBoxListDateHolder {
// 
// 	public String itemName;
// 	public boolean checked;
// 
// 	/**
// 	 * @param itemName
// 	 * @param checked
// 	 */
// 	public GosScheduleCheckBoxListDateHolder(String itemName, boolean checked) {
// 		super();
// 		this.itemName = itemName;
// 		this.checked = checked;
// 	}
// 
// }


// Path: src/com/gizwits/opensource/devicecontrol/ui/activity/GosScheduleEditRepeatActivity.java
import java.util.ArrayList;
import com.gizwits.opensource.smartlight.R;
import com.gizwits.opensource.devicecontrol.ui.adapter.GosScheduleCheckBoxListAdapter;
import com.gizwits.opensource.devicecontrol.ui.adapter.GosScheduleCheckBoxListDateHolder;
import android.content.Intent;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;

		tvBack.setOnClickListener(this);
		tvSave.setOnClickListener(this);
	}

	private void initView() {
		tvBack = (TextView) findViewById(R.id.tv_back);
		tvSave = (TextView) findViewById(R.id.tv_save);
		lvRepeat = (ListView) findViewById(R.id.lv_repeat);
	}

	private void initDate() {
		Intent intent = getIntent();
		repeat = intent.getStringExtra("repeat");
		String[] week = { "sun", "mon", "tue", "wed", "thu", "fri", "sat"};
		String[] itemNames = {  getResources().getString(R.string.apm_every_sun),getResources().getString(R.string.apm_every_mon),
				getResources().getString(R.string.apm_every_tue), getResources().getString(R.string.apm_every_wed),
				getResources().getString(R.string.apm_every_thu), getResources().getString(R.string.apm_every_fri),
				getResources().getString(R.string.apm_every_sat) };
		for (int i = 0; i < itemNames.length; i++) {
			String itemName = itemNames[i];
			Boolean checked = false;
			if (repeat.contains(week[i])) {
				checked = true;
			}
			GosScheduleCheckBoxListDateHolder item = new GosScheduleCheckBoxListDateHolder(itemName, checked);
			repeatDates.add(item);
		}
	}

	private void UpdateUI() {
		final GosScheduleCheckBoxListAdapter mAdapter = new GosScheduleCheckBoxListAdapter(this, repeatDates);