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

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

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