From f8bb3b452398e15cfc907559a9804f3b75351499 Mon Sep 17 00:00:00 2001 From: Leekangmin Date: Sun, 31 Dec 2023 16:24:34 +0900 Subject: [PATCH 1/7] [feature/#5] manifest GroupListActivity --- app/src/main/AndroidManifest.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 9b07efcd..5f43d883 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -27,6 +27,8 @@ + \ No newline at end of file From b3ec687e3fd8323374258d0f67a408e4923df73b Mon Sep 17 00:00:00 2001 From: Leekangmin Date: Sun, 31 Dec 2023 16:24:57 +0900 Subject: [PATCH 2/7] [feature/#5] sample_left vector --- app/src/main/res/drawable/sample_left.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 app/src/main/res/drawable/sample_left.xml diff --git a/app/src/main/res/drawable/sample_left.xml b/app/src/main/res/drawable/sample_left.xml new file mode 100644 index 00000000..91865e52 --- /dev/null +++ b/app/src/main/res/drawable/sample_left.xml @@ -0,0 +1,10 @@ + + + From 1418241f2e791d656c1ac74ac6a8e5659268426d Mon Sep 17 00:00:00 2001 From: Leekangmin Date: Sun, 31 Dec 2023 16:25:39 +0900 Subject: [PATCH 3/7] [feature/#5] activity_group_list.xml --- .../main/res/layout/activity_group_list.xml | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 app/src/main/res/layout/activity_group_list.xml diff --git a/app/src/main/res/layout/activity_group_list.xml b/app/src/main/res/layout/activity_group_list.xml new file mode 100644 index 00000000..2a2758aa --- /dev/null +++ b/app/src/main/res/layout/activity_group_list.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + \ No newline at end of file From 2b70ae7ed75413603e8be2b060dd8ab04274cc85 Mon Sep 17 00:00:00 2001 From: Leekangmin Date: Sun, 31 Dec 2023 16:25:52 +0900 Subject: [PATCH 4/7] [feature/#5] item_group_list.xml --- app/src/main/res/layout/item_group_list.xml | 67 +++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 app/src/main/res/layout/item_group_list.xml diff --git a/app/src/main/res/layout/item_group_list.xml b/app/src/main/res/layout/item_group_list.xml new file mode 100644 index 00000000..4e3e799d --- /dev/null +++ b/app/src/main/res/layout/item_group_list.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + \ No newline at end of file From 5b2ab340e4ed6cf40db8c1fd84a898eae1d45ac1 Mon Sep 17 00:00:00 2001 From: Leekangmin Date: Sun, 31 Dec 2023 16:26:03 +0900 Subject: [PATCH 5/7] [feature/#5] Group domain --- .../src/main/java/com/teumteum/domain/entity/Group.kt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 core/domain/src/main/java/com/teumteum/domain/entity/Group.kt diff --git a/core/domain/src/main/java/com/teumteum/domain/entity/Group.kt b/core/domain/src/main/java/com/teumteum/domain/entity/Group.kt new file mode 100644 index 00000000..2a41093d --- /dev/null +++ b/core/domain/src/main/java/com/teumteum/domain/entity/Group.kt @@ -0,0 +1,10 @@ +package com.teumteum.domain.entity + +data class Group( + val id: Long, + val topic: String, + val name: String, + val introduction: String, + val photoUrls: List, + val date: String +) \ No newline at end of file From ee5957eddddcda8f8aa2334411e2122a52416f6d Mon Sep 17 00:00:00 2001 From: Leekangmin Date: Sun, 31 Dec 2023 16:26:19 +0900 Subject: [PATCH 6/7] =?UTF-8?q?[feature/#5]=20=EA=B7=B8=EB=A3=B9=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20Adapter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/group/GroupListAdapter.kt | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListAdapter.kt diff --git a/app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListAdapter.kt b/app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListAdapter.kt new file mode 100644 index 00000000..018a1f56 --- /dev/null +++ b/app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListAdapter.kt @@ -0,0 +1,48 @@ +package com.teumteum.teumteum.presentation.group + +import android.view.LayoutInflater +import android.view.ViewGroup +import androidx.recyclerview.widget.RecyclerView +import com.teumteum.domain.entity.Group +import com.teumteum.teumteum.databinding.ItemGroupListBinding + +class GroupListAdapter(private val itemClick: (Group) -> (Unit)) : + RecyclerView.Adapter() { + private val groupList = mutableListOf() + + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GroupListViewHolder { + val binding = ItemGroupListBinding.inflate( + LayoutInflater.from(parent.context), + parent, + false, + ) + return GroupListViewHolder(binding, itemClick) + } + + override fun onBindViewHolder(holder: GroupListViewHolder, position: Int) { + holder.onBind(groupList[position]) + } + + override fun getItemCount(): Int = groupList.size + + fun setItems(newItems: List) { + groupList.clear() + groupList.addAll(newItems) + notifyDataSetChanged() + } + + class GroupListViewHolder( + private val binding: ItemGroupListBinding, + private val itemClick: (Group) -> (Unit) + ) : RecyclerView.ViewHolder(binding.root) { + fun onBind(item: Group) { + binding.tvGroupName.text = item.name + binding.tvTitleBadge.text = item.topic + binding.tvDate.text = item.date + + binding.root.setOnClickListener { + itemClick(item) + } + } + } +} \ No newline at end of file From 57f09410169af99e8df76a6236d18f69b018dd4a Mon Sep 17 00:00:00 2001 From: Leekangmin Date: Sun, 31 Dec 2023 16:26:39 +0900 Subject: [PATCH 7/7] =?UTF-8?q?[feature/#5]=20GroupListActivity=20UI?= =?UTF-8?q?=EB=A7=8C=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/group/GroupListActivity.kt | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListActivity.kt diff --git a/app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListActivity.kt b/app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListActivity.kt new file mode 100644 index 00000000..3291e4bd --- /dev/null +++ b/app/src/main/java/com/teumteum/teumteum/presentation/group/GroupListActivity.kt @@ -0,0 +1,38 @@ +package com.teumteum.teumteum.presentation.group + +import android.os.Bundle +import android.widget.Toast +import com.teumteum.base.BindingActivity +import com.teumteum.domain.entity.Group +import com.teumteum.teumteum.R +import com.teumteum.teumteum.databinding.ActivityGroupListBinding + +class GroupListActivity : BindingActivity(R.layout.activity_group_list) { + private lateinit var adapter: GroupListAdapter + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + + initView() + } + + private fun initView() { + binding.tvTitle.text = "모각작" + + adapter = GroupListAdapter { + Toast.makeText(this, it.name, Toast.LENGTH_SHORT).show() + } + + binding.rvGroupList.adapter = adapter + adapter.setItems( + listOf( + Group(1L, "모각작", "모여서 작업할 사람", "나는 소개", listOf("", ""), "1월 10일 오후 07:00"), + Group(2L, "모각작", "모여서 작업 안할 사람", "나는 소개", listOf("", ""), "1월 21일 오후 04:00"), + Group(3L, "모각작", "모여서 작업 하기 싫은 사람", "나는 소개", listOf("", ""), "1월 26일 오후 11:00"), + Group(4L, "모각작", "모여서 작업 하고 싶은 사람", "나는 소개", listOf("", ""), "2월 13일 오전 11:00"), + Group(5L, "모각작", "모일 사람", "나는 소개", listOf("", ""), "4월 06일 오후 04:00"), + Group(6L, "모각작", "안 모일 사람", "나는 소개", listOf("", ""), "11월 16일 오후 08:00"), + ) + ) + } +} \ No newline at end of file