Esempio n. 1
0
	public void InitListView(TodoListModel listModel){
		this.listModel = listModel;

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

	}
Esempio n. 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;
	}
Esempio n. 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 ();
	}
Esempio n. 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 ();
	}
Esempio n. 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 ();
	}
Esempio n. 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);
	}
Esempio n. 7
0
	public void Start(){
		allListsModel.LoadAllLists ();
		currentTodoListModel = allListsModel.GetCurrentList ();
		todoView.SetCurrentListTitle (currentTodoListModel.listName);
		FillItems ();
	}
Esempio n. 8
0
	public List<TodoItemView> FillItems(TodoListModel currentTodoListModel){
		foreach (var item in currentTodoListModel.items) {
			CreateOrUpdateItemView(item);
		}
		return itemsView;
	}
Esempio n. 9
0
	public void OnCancle(){
		gameObject.SetActive (false);
		editList = null;
	}
Esempio n. 10
0
	public void DestroyList(TodoListModel list){
		listsId.Remove (list.listId);
		SaveAllListsIds ();
		lists.Remove (list);
		PlayerPrefs.DeleteKey (list.listId.ToString());
	}
Esempio n. 11
0
	public void EditCurrentList(TodoListModel list){
		list.SaveTodoList ();
	}