public void InitListView(TodoListModel listModel){ this.listModel = listModel; listName.text = listModel.listName; itemsAmount.text = "(" + listModel.items.Count + ")"; }
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; }
public void CreateNewList(TodoListModel newList){ if (lists.Any (x => x.listName == newList.listName)) return; newList.SaveTodoList (); lists.Add (newList); listsId.Add (newList.listId); SaveAllListsIds (); }
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 (); }
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 (); }
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); }
public void Start(){ allListsModel.LoadAllLists (); currentTodoListModel = allListsModel.GetCurrentList (); todoView.SetCurrentListTitle (currentTodoListModel.listName); FillItems (); }
public List<TodoItemView> FillItems(TodoListModel currentTodoListModel){ foreach (var item in currentTodoListModel.items) { CreateOrUpdateItemView(item); } return itemsView; }
public void OnCancle(){ gameObject.SetActive (false); editList = null; }
public void DestroyList(TodoListModel list){ listsId.Remove (list.listId); SaveAllListsIds (); lists.Remove (list); PlayerPrefs.DeleteKey (list.listId.ToString()); }
public void EditCurrentList(TodoListModel list){ list.SaveTodoList (); }