示例#1
0
	public void InitListView(TodoListModel listModel){
		this.listModel = listModel;

		listName.text = listModel.listName;
		itemsAmount.text = "(" + listModel.items.Count + ")";

	}
示例#2
0
	public TodoListView CreateListView(TodoListModel todoListModel){
		TodoListView listView = Instantiate (oneListViewPrefab).GetComponent<TodoListView> ();
		listView.InitListView (todoListModel);
		listView.transform.SetParent (allListsContentHolder);
		listView.transform.localScale = Vector3.one;
		listsView.Add (listView);
		return listView;
	}
示例#3
0
	public void CreateNewList(TodoListModel newList){
		if (lists.Any (x => x.listName == newList.listName))
			return;
		newList.SaveTodoList ();
		lists.Add (newList);
		listsId.Add (newList.listId);
		SaveAllListsIds ();
	}
示例#4
0
	public void SetCurrentList(TodoListView listView){
		//Debug.Log ();
		allListsModel.SetCurrentList (listView.listModel.listName);
		currentTodoListModel = allListsModel.GetCurrentList ();
		todoView.SetCurrentListTitle (listView.listModel.listName);
		todoView.ClearItems ();
		FillItems ();
		todoView.HideAllListView ();
	}
示例#5
0
	public void CreateNewList(string listName){
		if (lists.Any (x => x.listName == listName))
			return;
		TodoListModel newList = new TodoListModel (GetListId(),listName);
		newList.SaveTodoList ();
		lists.Add (newList);
		listsId.Add (newList.listId);
		SaveAllListsIds ();
	}
示例#6
0
	public void ShowEditListView(TodoListModel listModel){
		editList = listModel;

		if (editList != null) {
			inputName.text = listModel.listName;
			shareWithFriends.isOn = listModel.shareWithAllFrineds;
		} else {
			inputName.text = "";
			shareWithFriends.isOn = false;
			editList = new TodoListModel();
		}
		gameObject.SetActive (true);
	}
示例#7
0
	public void Start(){
		allListsModel.LoadAllLists ();
		currentTodoListModel = allListsModel.GetCurrentList ();
		todoView.SetCurrentListTitle (currentTodoListModel.listName);
		FillItems ();
	}
示例#8
0
	public List<TodoItemView> FillItems(TodoListModel currentTodoListModel){
		foreach (var item in currentTodoListModel.items) {
			CreateOrUpdateItemView(item);
		}
		return itemsView;
	}
示例#9
0
	public void OnCancle(){
		gameObject.SetActive (false);
		editList = null;
	}
示例#10
0
	public void DestroyList(TodoListModel list){
		listsId.Remove (list.listId);
		SaveAllListsIds ();
		lists.Remove (list);
		PlayerPrefs.DeleteKey (list.listId.ToString());
	}
示例#11
0
	public void EditCurrentList(TodoListModel list){
		list.SaveTodoList ();
	}