From 5f7f4ea1d5261ef7d105b83d21911631c0de12d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 19:04:10 +0900 Subject: [PATCH 01/10] =?UTF-8?q?#16=20[ui]=20=EC=96=B4=EB=8C=91=ED=84=B0?= =?UTF-8?q?=EC=99=80=20=EB=A6=AC=EC=82=AC=EC=9D=B4=ED=81=B4=EB=9F=AC?= =?UTF-8?q?=EB=B7=B0=20=EC=97=B0=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../hous/housaoslab/ui/home/HomeFragment.kt | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt b/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt index 41cf237..2581473 100644 --- a/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt @@ -7,16 +7,14 @@ import android.view.ViewGroup import androidx.fragment.app.Fragment import com.hous.housaoslab.R import com.hous.housaoslab.databinding.FragmentHomeBinding -import com.hous.housaoslab.ui.home.model.ComingUpAdapter -import com.hous.housaoslab.ui.home.model.ComingUpData -import com.hous.housaoslab.ui.home.model.RulesAdapter -import com.hous.housaoslab.ui.home.model.RulesData +import com.hous.housaoslab.ui.home.model.* class HomeFragment : Fragment() { private var _binding: FragmentHomeBinding? = null val binding get() = _binding!! private lateinit var comingUpAdapter: ComingUpAdapter private lateinit var rulesAdapter: RulesAdapter + private lateinit var toDoAdapter: ToDoAdapter override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View { _binding = FragmentHomeBinding.inflate(inflater, container, false) @@ -61,5 +59,19 @@ class HomeFragment : Fragment() { ) ) comingUpAdapter.notifyDataSetChanged() + + toDoAdapter = ToDoAdapter() + binding.rvHomeToDo.adapter = toDoAdapter + + rulesAdapter.rulesList.addAll( + listOf( + RulesData("퇴근하고 마트"), + RulesData("저녁 설거지"), + RulesData("아침 설거지"), + RulesData("물 사기"), + RulesData("야식 먹지 말자"), + ) + ) + comingUpAdapter.notifyDataSetChanged() } } \ No newline at end of file From 51080784c4a2235f0e18f6db82b53ecd2e2a1dd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 19:04:23 +0900 Subject: [PATCH 02/10] =?UTF-8?q?#16=20[ui]=20ToDo=20=EC=96=B4=EB=8C=91?= =?UTF-8?q?=ED=84=B0=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../housaoslab/ui/home/model/ToDoAdapter.kt | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt diff --git a/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt b/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt new file mode 100644 index 0000000..588d43b --- /dev/null +++ b/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt @@ -0,0 +1,37 @@ +package com.hous.housaoslab.ui.home.model + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import com.hous.housaoslab.databinding.ItemHomeToDoBinding + +class ToDoAdapter : RecyclerView.Adapter() { + val toDoList = mutableListOf() + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ToDoViewHolder { + val binding = + ItemHomeToDoBinding.inflate( + LayoutInflater.from(parent.context), + parent, + false + ) + return ToDoViewHolder(binding) + } + + override fun onBindViewHolder(holder: ToDoViewHolder, position: Int) { + holder.onBind(toDoList[position]) + } + + override fun getItemCount(): Int = toDoList.size + + class ToDoViewHolder( + private val binding: ItemHomeToDoBinding + ) : RecyclerView.ViewHolder(binding.root) { + fun onBind(data: ToDoData) { + binding.tvHomeToDo.text = data.rules + } + } +} + +{ +} \ No newline at end of file From f8cf83387b481fe472b21923817f21ac5a17bfd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 19:04:35 +0900 Subject: [PATCH 03/10] =?UTF-8?q?#16=20[ui]=20ToDo=20Data=ED=81=B4?= =?UTF-8?q?=EB=9E=98=EC=8A=A4=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hous/housaoslab/ui/home/model/ToDoData.kt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoData.kt diff --git a/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoData.kt b/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoData.kt new file mode 100644 index 0000000..816aa8b --- /dev/null +++ b/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoData.kt @@ -0,0 +1,5 @@ +package com.hous.housaoslab.ui.home.model + +data class ToDoData( + val rules: String +) From e468ee694388b1a724d2e7a5b851e5f0027ec490 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 19:04:54 +0900 Subject: [PATCH 04/10] =?UTF-8?q?#16=20[ui]=20ToDo=20=EC=95=84=EC=9D=B4?= =?UTF-8?q?=ED=85=9C=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_home_to_do.xml | 40 +++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 app/src/main/res/layout/item_home_to_do.xml diff --git a/app/src/main/res/layout/item_home_to_do.xml b/app/src/main/res/layout/item_home_to_do.xml new file mode 100644 index 0000000..d5c6aa8 --- /dev/null +++ b/app/src/main/res/layout/item_home_to_do.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + \ No newline at end of file From 6172448d93d12c7fcc0ee4368718be5e82762aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 20:28:17 +0900 Subject: [PATCH 05/10] =?UTF-8?q?#16=20[chore]=20=EB=93=A4=EC=97=AC?= =?UTF-8?q?=EC=93=B0=EA=B8=B0=20=EA=B4=80=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt b/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt index 2581473..328d6e0 100644 --- a/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt @@ -30,7 +30,6 @@ class HomeFragment : Fragment() { private fun initAdapter() { comingUpAdapter = ComingUpAdapter() binding.rvHomeComingUp.adapter = comingUpAdapter - comingUpAdapter.comingUpList.addAll( listOf( ComingUpData(R.drawable.shape_yellow_bg_fill_16_rectangle, R.drawable.img_coming_up_plus, "D-1"), @@ -48,7 +47,6 @@ class HomeFragment : Fragment() { rulesAdapter = RulesAdapter() binding.rvHomeRules.adapter = rulesAdapter - rulesAdapter.rulesList.addAll( listOf( RulesData("00시~ 불 끄기!"), @@ -62,7 +60,7 @@ class HomeFragment : Fragment() { toDoAdapter = ToDoAdapter() binding.rvHomeToDo.adapter = toDoAdapter - + toDoAdapter.toDoList.addAll( rulesAdapter.rulesList.addAll( listOf( RulesData("퇴근하고 마트"), From beb5a7c79fd9ab43913d4d5c360a4350c2712ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 20:28:47 +0900 Subject: [PATCH 06/10] =?UTF-8?q?#16=20[chore]=20ToDoData=20=EC=A7=91?= =?UTF-8?q?=EC=96=B4=EB=84=A3=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/hous/housaoslab/ui/home/HomeFragment.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt b/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt index 328d6e0..2067385 100644 --- a/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt +++ b/app/src/main/java/com/hous/housaoslab/ui/home/HomeFragment.kt @@ -61,13 +61,12 @@ class HomeFragment : Fragment() { toDoAdapter = ToDoAdapter() binding.rvHomeToDo.adapter = toDoAdapter toDoAdapter.toDoList.addAll( - rulesAdapter.rulesList.addAll( listOf( - RulesData("퇴근하고 마트"), - RulesData("저녁 설거지"), - RulesData("아침 설거지"), - RulesData("물 사기"), - RulesData("야식 먹지 말자"), + ToDoData("퇴근하고 마트"), + ToDoData("저녁 설거지"), + ToDoData("아침 설거지"), + ToDoData("물 사기"), + ToDoData("야식 먹지 말자"), ) ) comingUpAdapter.notifyDataSetChanged() From 0a128bf1e739aade878260e83a79d2c4f7ac57df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 20:29:12 +0900 Subject: [PATCH 07/10] =?UTF-8?q?#16=20[chore]=20=EC=98=A4=ED=83=80=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt | 3 --- 1 file changed, 3 deletions(-) diff --git a/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt b/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt index 588d43b..e044f70 100644 --- a/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt +++ b/app/src/main/java/com/hous/housaoslab/ui/home/model/ToDoAdapter.kt @@ -31,7 +31,4 @@ class ToDoAdapter : RecyclerView.Adapter() { binding.tvHomeToDo.text = data.rules } } -} - -{ } \ No newline at end of file From bd80b4926c1e8fce63b37d78d66cd3d0ddfd4818 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 20:33:36 +0900 Subject: [PATCH 08/10] =?UTF-8?q?#16=20[ui]=20fragment=5Fhome=EC=97=90=20T?= =?UTF-8?q?oDo=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/fragment_home.xml | 31 ++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/app/src/main/res/layout/fragment_home.xml b/app/src/main/res/layout/fragment_home.xml index 5d53df8..d657543 100644 --- a/app/src/main/res/layout/fragment_home.xml +++ b/app/src/main/res/layout/fragment_home.xml @@ -56,7 +56,7 @@ + + + + \ No newline at end of file From 11ac57d6dce3edd985bdc735305445a9c695e005 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 21:24:51 +0900 Subject: [PATCH 09/10] =?UTF-8?q?#16=20[ui]=20to=20do=20=EC=B2=B4=ED=81=AC?= =?UTF-8?q?=EB=B0=95=EC=8A=A4=20selector=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/drawable/ic_blue_fill_check_box.xml | 10 ++++++++++ app/src/main/res/drawable/ic_blue_line_check_box.xml | 10 ++++++++++ app/src/main/res/drawable/sel_home_to_do_check_box.xml | 5 +++++ 3 files changed, 25 insertions(+) create mode 100644 app/src/main/res/drawable/ic_blue_fill_check_box.xml create mode 100644 app/src/main/res/drawable/ic_blue_line_check_box.xml create mode 100644 app/src/main/res/drawable/sel_home_to_do_check_box.xml diff --git a/app/src/main/res/drawable/ic_blue_fill_check_box.xml b/app/src/main/res/drawable/ic_blue_fill_check_box.xml new file mode 100644 index 0000000..ae439c6 --- /dev/null +++ b/app/src/main/res/drawable/ic_blue_fill_check_box.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/ic_blue_line_check_box.xml b/app/src/main/res/drawable/ic_blue_line_check_box.xml new file mode 100644 index 0000000..17a4d0e --- /dev/null +++ b/app/src/main/res/drawable/ic_blue_line_check_box.xml @@ -0,0 +1,10 @@ + + + diff --git a/app/src/main/res/drawable/sel_home_to_do_check_box.xml b/app/src/main/res/drawable/sel_home_to_do_check_box.xml new file mode 100644 index 0000000..f9ebf03 --- /dev/null +++ b/app/src/main/res/drawable/sel_home_to_do_check_box.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file From c659eb34ef576cc42572ee7f1eed05551cf9bb12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EC=98=81=EC=A3=BC?= Date: Fri, 8 Jul 2022 21:25:37 +0900 Subject: [PATCH 10/10] =?UTF-8?q?#16=20[fix]=20to=20do=20=EC=9D=B4?= =?UTF-8?q?=EB=AF=B8=EC=A7=80=EB=B7=B0=20=EC=B2=B4=ED=81=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/res/layout/item_home_to_do.xml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/app/src/main/res/layout/item_home_to_do.xml b/app/src/main/res/layout/item_home_to_do.xml index d5c6aa8..a37a878 100644 --- a/app/src/main/res/layout/item_home_to_do.xml +++ b/app/src/main/res/layout/item_home_to_do.xml @@ -15,11 +15,13 @@ android:layout_height="wrap_content" android:paddingTop="9dp"> - @@ -32,7 +34,7 @@ android:textColor="@color/black" android:textSize="13sp" android:textStyle="bold" - app:layout_constraintStart_toEndOf="@id/iv_home_to_do" + app:layout_constraintStart_toEndOf="@id/cb_home_to_do" app:layout_constraintTop_toTopOf="parent" tools:text="청소기 돌리기" />