From 88dca4aa5ecdb428e7e8d8b048a45fae40766c16 Mon Sep 17 00:00:00 2001 From: Jordan Harrison <76656637+jordharr@users.noreply.github.com> Date: Sat, 26 Nov 2022 23:09:13 +0000 Subject: [PATCH 01/13] readme update --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 33148ab..58c01bb 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,10 @@ Todo - a task management application built for Android +## Details + +Todo is a basic task manager/todo list built for Android. It is built using Kotlin, MVVM / Clean Architecture, Fragments, Dagger & Hilt, with Firebase for the backend (Authentication & Firestore). + ## References [Android Architecture Documentation](https://developer.android.com/topic/architecture) From 39918b4df37f70ea29027f7000b22c2160eac244 Mon Sep 17 00:00:00 2001 From: Jordan Harrison <76656637+jordharr@users.noreply.github.com> Date: Sat, 26 Nov 2022 23:11:44 +0000 Subject: [PATCH 02/13] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 58c01bb..4ab1367 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Todo - a task management application built for Android ## Details -Todo is a basic task manager/todo list built for Android. It is built using Kotlin, MVVM / Clean Architecture, Fragments, Dagger & Hilt, with Firebase for the backend (Authentication & Firestore). +Todo is a basic task manager/todo list built for Android. It is built using Kotlin, MVVM / Clean Architecture, Fragments, Dagger & Hilt, with Firebase for the backend (Authentication & Firestore). The interface is built with Material 3 and uses the system preference to determine light/dark mode. ## References From 28c03aa1322bf0da102ff1e2bbd4af914c8943fd Mon Sep 17 00:00:00 2001 From: Jordan Harrison <76656637+jordharr@users.noreply.github.com> Date: Sat, 26 Nov 2022 23:18:14 +0000 Subject: [PATCH 03/13] fix forgot password location when keyboard is open --- app/src/main/res/layout/fragment_login.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/res/layout/fragment_login.xml b/app/src/main/res/layout/fragment_login.xml index 0568bde..cc69e90 100644 --- a/app/src/main/res/layout/fragment_login.xml +++ b/app/src/main/res/layout/fragment_login.xml @@ -79,8 +79,7 @@ android:text="@string/forgot_password" android:paddingTop="4dp" android:paddingBottom="4dp" - app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="@id/login" - app:layout_constraintTop_toTopOf="@id/login" + app:layout_constraintTop_toBottomOf="@id/login" app:layout_constraintVertical_bias="0.11" /> \ No newline at end of file From 45de58012a63de912a7bcab5ca7a3ac5190a6574 Mon Sep 17 00:00:00 2001 From: Jordan Harrison <76656637+jordharr@users.noreply.github.com> Date: Sun, 27 Nov 2022 11:29:02 +0000 Subject: [PATCH 04/13] add priority to task --- .../dev/jord/todo/ui/home/AddTaskFragment.kt | 17 ++++++++----- app/src/main/res/layout/dropdown_item.xml | 8 ++++++ app/src/main/res/layout/fragment_add_task.xml | 25 ++++++++++++++++++- app/src/main/res/values/strings.xml | 14 +++++------ 4 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 app/src/main/res/layout/dropdown_item.xml diff --git a/app/src/main/java/dev/jord/todo/ui/home/AddTaskFragment.kt b/app/src/main/java/dev/jord/todo/ui/home/AddTaskFragment.kt index f7c780b..8b56219 100644 --- a/app/src/main/java/dev/jord/todo/ui/home/AddTaskFragment.kt +++ b/app/src/main/java/dev/jord/todo/ui/home/AddTaskFragment.kt @@ -5,6 +5,7 @@ import androidx.fragment.app.Fragment import android.view.LayoutInflater import android.view.View import android.view.ViewGroup +import android.widget.ArrayAdapter import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.viewModels import dagger.hilt.android.AndroidEntryPoint @@ -37,13 +38,17 @@ class AddTaskFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { super.onViewCreated(view, savedInstanceState) binding = FragmentAddTaskBinding.bind(view) + + val priorityArray = resources.getStringArray(R.array.priority) + val arrayAdapter = activity?.let { ArrayAdapter(it, R.layout.dropdown_item, priorityArray) } + binding.priorityDropdown.setAdapter(arrayAdapter) + binding.addTaskButton.setOnClickListener { - viewModel.addTask( - Task( - title = binding.taskName.text.toString(), - description = binding.taskDescription.text.toString() - ) - ) + val title = binding.taskName.text.toString() + val description = binding.taskDescription.text.toString() + val priority = binding.priorityDropdown.text.toString() + val task = Task(title = title, description = description, priority = priority) + viewModel.addTask(task) snackbar("Task added successfully!") activity?.supportFragmentManager?.beginTransaction() ?.replace(R.id.container, HomeFragment()) diff --git a/app/src/main/res/layout/dropdown_item.xml b/app/src/main/res/layout/dropdown_item.xml new file mode 100644 index 0000000..37f941a --- /dev/null +++ b/app/src/main/res/layout/dropdown_item.xml @@ -0,0 +1,8 @@ + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_add_task.xml b/app/src/main/res/layout/fragment_add_task.xml index 48c6600..ea8b573 100644 --- a/app/src/main/res/layout/fragment_add_task.xml +++ b/app/src/main/res/layout/fragment_add_task.xml @@ -43,6 +43,29 @@ android:layout_height="wrap_content" /> + + + + /> + + +