From 334a164ddd221f5c1a179de675f0420c499f49cc Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Wed, 13 Mar 2024 15:41:01 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[FIX/#253]=20=EB=A6=AC=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=96=B4=EB=8C=91=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ListAllocatorAdapter.kt} | 12 ++++++------ .../ListAllocatorViewHolder.kt} | 4 ++-- .../todo/mytodo/todolist/MyTodoListViewHolder.kt | 4 ++-- .../todo/ourtodo/todolist/OurTodoListViewHolder.kt | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) rename presentation/src/main/java/com/going/presentation/todo/{allocator/TodoAllocatorAdapter.kt => list/ListAllocatorAdapter.kt} (75%) rename presentation/src/main/java/com/going/presentation/todo/{allocator/TodoAllocatorViewHolder.kt => list/ListAllocatorViewHolder.kt} (93%) diff --git a/presentation/src/main/java/com/going/presentation/todo/allocator/TodoAllocatorAdapter.kt b/presentation/src/main/java/com/going/presentation/todo/list/ListAllocatorAdapter.kt similarity index 75% rename from presentation/src/main/java/com/going/presentation/todo/allocator/TodoAllocatorAdapter.kt rename to presentation/src/main/java/com/going/presentation/todo/list/ListAllocatorAdapter.kt index befbde4b..33b39541 100644 --- a/presentation/src/main/java/com/going/presentation/todo/allocator/TodoAllocatorAdapter.kt +++ b/presentation/src/main/java/com/going/presentation/todo/list/ListAllocatorAdapter.kt @@ -1,4 +1,4 @@ -package com.going.presentation.todo.allocator +package com.going.presentation.todo.list import android.view.LayoutInflater import android.view.ViewGroup @@ -7,18 +7,18 @@ import com.going.domain.entity.response.TodoListAllocatorModel import com.going.presentation.databinding.ItemTodoNameBinding import com.going.ui.util.ItemDiffCallback -class TodoAllocatorAdapter( +class ListAllocatorAdapter( private val isCompleted: Boolean -) : ListAdapter(diffUtil) { +) : ListAdapter(diffUtil) { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TodoAllocatorViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ListAllocatorViewHolder { val inflater by lazy { LayoutInflater.from(parent.context) } val binding: ItemTodoNameBinding = ItemTodoNameBinding.inflate(inflater, parent, false) - return TodoAllocatorViewHolder(binding, isCompleted) + return ListAllocatorViewHolder(binding, isCompleted) } - override fun onBindViewHolder(holder: TodoAllocatorViewHolder, position: Int) { + override fun onBindViewHolder(holder: ListAllocatorViewHolder, position: Int) { holder.onBind(getItem(position)) } diff --git a/presentation/src/main/java/com/going/presentation/todo/allocator/TodoAllocatorViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/list/ListAllocatorViewHolder.kt similarity index 93% rename from presentation/src/main/java/com/going/presentation/todo/allocator/TodoAllocatorViewHolder.kt rename to presentation/src/main/java/com/going/presentation/todo/list/ListAllocatorViewHolder.kt index 4169aa2d..d0b5cd19 100644 --- a/presentation/src/main/java/com/going/presentation/todo/allocator/TodoAllocatorViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/list/ListAllocatorViewHolder.kt @@ -1,4 +1,4 @@ -package com.going.presentation.todo.allocator +package com.going.presentation.todo.list import androidx.recyclerview.widget.RecyclerView import com.going.domain.entity.response.TodoListAllocatorModel @@ -6,7 +6,7 @@ import com.going.presentation.R import com.going.presentation.databinding.ItemTodoNameBinding import com.going.ui.extension.colorOf -class TodoAllocatorViewHolder( +class ListAllocatorViewHolder( val binding: ItemTodoNameBinding, private val isCompleted: Boolean ) : RecyclerView.ViewHolder(binding.root) { diff --git a/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt index bea34144..ca45f004 100644 --- a/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/mytodo/todolist/MyTodoListViewHolder.kt @@ -5,7 +5,7 @@ import androidx.recyclerview.widget.RecyclerView import com.going.domain.entity.response.TodoModel import com.going.presentation.R import com.going.presentation.databinding.ItemMyTodoBinding -import com.going.presentation.todo.allocator.TodoAllocatorAdapter +import com.going.presentation.todo.list.ListAllocatorAdapter import com.going.ui.extension.colorOf import com.going.ui.extension.setOnSingleClickListener @@ -28,7 +28,7 @@ class MyTodoListViewHolder( cbMyTodoSelected.isVisible = isCompleted cbMyTodoUnselected.isVisible = !isCompleted - rvMyTodoName.adapter = TodoAllocatorAdapter(isCompleted).apply { + rvMyTodoName.adapter = ListAllocatorAdapter(isCompleted).apply { submitList(item.allocators) } diff --git a/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt index ded7c72c..ea6c3120 100644 --- a/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/ourtodo/todolist/OurTodoListViewHolder.kt @@ -5,7 +5,7 @@ import androidx.recyclerview.widget.RecyclerView import com.going.domain.entity.response.TodoModel import com.going.presentation.R import com.going.presentation.databinding.ItemOurTodoBinding -import com.going.presentation.todo.allocator.TodoAllocatorAdapter +import com.going.presentation.todo.list.ListAllocatorAdapter import com.going.ui.extension.colorOf import com.going.ui.extension.setOnSingleClickListener @@ -25,7 +25,7 @@ class OurTodoListViewHolder( } else { rvOurTodoName.visibility = View.VISIBLE layoutOurTodoEmptyAllocator.visibility = View.INVISIBLE - rvOurTodoName.adapter = TodoAllocatorAdapter(isCompleted).apply { + rvOurTodoName.adapter = ListAllocatorAdapter(isCompleted).apply { submitList(item.allocators) } } From 5ef69847c814654ff4e610517b283a2d47d7bd28 Mon Sep 17 00:00:00 2001 From: Sangho Kim Date: Wed, 13 Mar 2024 15:44:51 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[FIX/#253]=20=ED=88=AC=EB=91=90=20=EC=96=B4?= =?UTF-8?q?=EB=8C=91=ED=84=B0=20=EB=84=A4=EC=9D=B4=EB=B0=8D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...doAllocatorAdapter.kt => ChangeAllocatorAdapter.kt} | 10 +++++----- ...catorViewHolder.kt => ChangeAllocatorViewHolder.kt} | 2 +- .../presentation/todo/change/TodoChangeActivity.kt | 4 ++-- ...rticipantAdapter.kt => CreateParticipantAdapter.kt} | 10 +++++----- ...antViewHolder.kt => CreateParticipantViewHolder.kt} | 2 +- .../presentation/todo/create/TodoCreateActivity.kt | 4 ++-- ...ipAllocatorAdapter.kt => DetailAllocatorAdapter.kt} | 8 ++++---- ...catorViewHolder.kt => DetailAllocatorViewHolder.kt} | 2 +- .../presentation/todo/detail/TodoDetailActivity.kt | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) rename presentation/src/main/java/com/going/presentation/todo/change/{TodoAllocatorAdapter.kt => ChangeAllocatorAdapter.kt} (75%) rename presentation/src/main/java/com/going/presentation/todo/change/{TodoAllocatorViewHolder.kt => ChangeAllocatorViewHolder.kt} (97%) rename presentation/src/main/java/com/going/presentation/todo/create/{TripParticipantAdapter.kt => CreateParticipantAdapter.kt} (75%) rename presentation/src/main/java/com/going/presentation/todo/create/{TripParticipantViewHolder.kt => CreateParticipantViewHolder.kt} (97%) rename presentation/src/main/java/com/going/presentation/todo/detail/{TripAllocatorAdapter.kt => DetailAllocatorAdapter.kt} (76%) rename presentation/src/main/java/com/going/presentation/todo/detail/{TripAllocatorViewHolder.kt => DetailAllocatorViewHolder.kt} (96%) diff --git a/presentation/src/main/java/com/going/presentation/todo/change/TodoAllocatorAdapter.kt b/presentation/src/main/java/com/going/presentation/todo/change/ChangeAllocatorAdapter.kt similarity index 75% rename from presentation/src/main/java/com/going/presentation/todo/change/TodoAllocatorAdapter.kt rename to presentation/src/main/java/com/going/presentation/todo/change/ChangeAllocatorAdapter.kt index 7827f0f5..b0f10c86 100644 --- a/presentation/src/main/java/com/going/presentation/todo/change/TodoAllocatorAdapter.kt +++ b/presentation/src/main/java/com/going/presentation/todo/change/ChangeAllocatorAdapter.kt @@ -7,17 +7,17 @@ import com.going.domain.entity.response.TodoAllocatorModel import com.going.presentation.databinding.ItemTodoCreateNameBinding import com.going.ui.util.ItemDiffCallback -class TodoAllocatorAdapter( +class ChangeAllocatorAdapter( private val itemClick: (Int) -> Unit -) : ListAdapter(diffUtil) { +) : ListAdapter(diffUtil) { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TodoAllocatorViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ChangeAllocatorViewHolder { val binding: ItemTodoCreateNameBinding = ItemTodoCreateNameBinding.inflate(LayoutInflater.from(parent.context), parent, false) - return TodoAllocatorViewHolder(binding, itemClick) + return ChangeAllocatorViewHolder(binding, itemClick) } - override fun onBindViewHolder(holder: TodoAllocatorViewHolder, position: Int) { + override fun onBindViewHolder(holder: ChangeAllocatorViewHolder, position: Int) { holder.onBind(getItem(position), position) } diff --git a/presentation/src/main/java/com/going/presentation/todo/change/TodoAllocatorViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/change/ChangeAllocatorViewHolder.kt similarity index 97% rename from presentation/src/main/java/com/going/presentation/todo/change/TodoAllocatorViewHolder.kt rename to presentation/src/main/java/com/going/presentation/todo/change/ChangeAllocatorViewHolder.kt index 524c2100..75e299e1 100644 --- a/presentation/src/main/java/com/going/presentation/todo/change/TodoAllocatorViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/change/ChangeAllocatorViewHolder.kt @@ -6,7 +6,7 @@ import com.going.presentation.R import com.going.presentation.databinding.ItemTodoCreateNameBinding import com.going.ui.extension.colorOf -class TodoAllocatorViewHolder( +class ChangeAllocatorViewHolder( val binding: ItemTodoCreateNameBinding, private val itemClick: (Int) -> Unit ) : RecyclerView.ViewHolder(binding.root) { diff --git a/presentation/src/main/java/com/going/presentation/todo/change/TodoChangeActivity.kt b/presentation/src/main/java/com/going/presentation/todo/change/TodoChangeActivity.kt index 85c68f07..296ad2d0 100644 --- a/presentation/src/main/java/com/going/presentation/todo/change/TodoChangeActivity.kt +++ b/presentation/src/main/java/com/going/presentation/todo/change/TodoChangeActivity.kt @@ -27,7 +27,7 @@ class TodoChangeActivity : BaseActivity(R.layout.acti private val viewModel by viewModels() - private var _adapter: TodoAllocatorAdapter? = null + private var _adapter: ChangeAllocatorAdapter? = null private val adapter get() = requireNotNull(_adapter) { getString(R.string.adapter_not_initialized_error_msg) } @@ -115,7 +115,7 @@ class TodoChangeActivity : BaseActivity(R.layout.acti } private fun initOurTodoNameListAdapter() { - _adapter = TodoAllocatorAdapter { position -> + _adapter = ChangeAllocatorAdapter { position -> viewModel.allocatorModelList[position].also { it.isAllocated = !it.isAllocated } viewModel.checkIsFinishAvailable() } diff --git a/presentation/src/main/java/com/going/presentation/todo/create/TripParticipantAdapter.kt b/presentation/src/main/java/com/going/presentation/todo/create/CreateParticipantAdapter.kt similarity index 75% rename from presentation/src/main/java/com/going/presentation/todo/create/TripParticipantAdapter.kt rename to presentation/src/main/java/com/going/presentation/todo/create/CreateParticipantAdapter.kt index 78d101b1..227f369c 100644 --- a/presentation/src/main/java/com/going/presentation/todo/create/TripParticipantAdapter.kt +++ b/presentation/src/main/java/com/going/presentation/todo/create/CreateParticipantAdapter.kt @@ -7,18 +7,18 @@ import com.going.domain.entity.response.TripParticipantModel import com.going.presentation.databinding.ItemTodoCreateNameBinding import com.going.ui.util.ItemDiffCallback -class TripParticipantAdapter( +class CreateParticipantAdapter( private val isFixed: Boolean, private val itemClick: (Int) -> Unit -) : ListAdapter(diffUtil) { +) : ListAdapter(diffUtil) { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TripParticipantViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): CreateParticipantViewHolder { val binding: ItemTodoCreateNameBinding = ItemTodoCreateNameBinding.inflate(LayoutInflater.from(parent.context), parent, false) - return TripParticipantViewHolder(binding, isFixed, itemClick) + return CreateParticipantViewHolder(binding, isFixed, itemClick) } - override fun onBindViewHolder(holder: TripParticipantViewHolder, position: Int) { + override fun onBindViewHolder(holder: CreateParticipantViewHolder, position: Int) { holder.onBind(getItem(position), position) } diff --git a/presentation/src/main/java/com/going/presentation/todo/create/TripParticipantViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/create/CreateParticipantViewHolder.kt similarity index 97% rename from presentation/src/main/java/com/going/presentation/todo/create/TripParticipantViewHolder.kt rename to presentation/src/main/java/com/going/presentation/todo/create/CreateParticipantViewHolder.kt index af75cd97..21b2fec5 100644 --- a/presentation/src/main/java/com/going/presentation/todo/create/TripParticipantViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/create/CreateParticipantViewHolder.kt @@ -6,7 +6,7 @@ import com.going.presentation.R import com.going.presentation.databinding.ItemTodoCreateNameBinding import com.going.ui.extension.colorOf -class TripParticipantViewHolder( +class CreateParticipantViewHolder( val binding: ItemTodoCreateNameBinding, private val isFixed: Boolean, private val itemClick: (Int) -> Unit diff --git a/presentation/src/main/java/com/going/presentation/todo/create/TodoCreateActivity.kt b/presentation/src/main/java/com/going/presentation/todo/create/TodoCreateActivity.kt index a4977be2..52fd4517 100644 --- a/presentation/src/main/java/com/going/presentation/todo/create/TodoCreateActivity.kt +++ b/presentation/src/main/java/com/going/presentation/todo/create/TodoCreateActivity.kt @@ -27,7 +27,7 @@ class TodoCreateActivity : BaseActivity(R.layout.acti private val viewModel by viewModels() - private var _adapter: TripParticipantAdapter? = null + private var _adapter: CreateParticipantAdapter? = null private val adapter get() = requireNotNull(_adapter) { getString(R.string.adapter_not_initialized_error_msg) } @@ -104,7 +104,7 @@ class TodoCreateActivity : BaseActivity(R.layout.acti } private fun initOurTodoNameListAdapter() { - _adapter = TripParticipantAdapter(false) { position -> + _adapter = CreateParticipantAdapter(false) { position -> viewModel.participantModelList[position].also { it.isSelected = !it.isSelected } viewModel.checkIsFinishAvailable() } diff --git a/presentation/src/main/java/com/going/presentation/todo/detail/TripAllocatorAdapter.kt b/presentation/src/main/java/com/going/presentation/todo/detail/DetailAllocatorAdapter.kt similarity index 76% rename from presentation/src/main/java/com/going/presentation/todo/detail/TripAllocatorAdapter.kt rename to presentation/src/main/java/com/going/presentation/todo/detail/DetailAllocatorAdapter.kt index 3d6144de..88d7719d 100644 --- a/presentation/src/main/java/com/going/presentation/todo/detail/TripAllocatorAdapter.kt +++ b/presentation/src/main/java/com/going/presentation/todo/detail/DetailAllocatorAdapter.kt @@ -7,16 +7,16 @@ import com.going.domain.entity.response.TodoAllocatorModel import com.going.presentation.databinding.ItemTodoCreateNameBinding import com.going.ui.util.ItemDiffCallback -class TripAllocatorAdapter : ListAdapter(diffUtil) { +class DetailAllocatorAdapter : ListAdapter(diffUtil) { - override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): TripAllocatorViewHolder { + override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): DetailAllocatorViewHolder { val inflater by lazy { LayoutInflater.from(parent.context) } val binding: ItemTodoCreateNameBinding = ItemTodoCreateNameBinding.inflate(inflater, parent, false) - return TripAllocatorViewHolder(binding) + return DetailAllocatorViewHolder(binding) } - override fun onBindViewHolder(holder: TripAllocatorViewHolder, position: Int) { + override fun onBindViewHolder(holder: DetailAllocatorViewHolder, position: Int) { holder.onBind(getItem(position)) } diff --git a/presentation/src/main/java/com/going/presentation/todo/detail/TripAllocatorViewHolder.kt b/presentation/src/main/java/com/going/presentation/todo/detail/DetailAllocatorViewHolder.kt similarity index 96% rename from presentation/src/main/java/com/going/presentation/todo/detail/TripAllocatorViewHolder.kt rename to presentation/src/main/java/com/going/presentation/todo/detail/DetailAllocatorViewHolder.kt index 20185e00..62fe6c1c 100644 --- a/presentation/src/main/java/com/going/presentation/todo/detail/TripAllocatorViewHolder.kt +++ b/presentation/src/main/java/com/going/presentation/todo/detail/DetailAllocatorViewHolder.kt @@ -6,7 +6,7 @@ import com.going.presentation.R import com.going.presentation.databinding.ItemTodoCreateNameBinding import com.going.ui.extension.colorOf -class TripAllocatorViewHolder( +class DetailAllocatorViewHolder( val binding: ItemTodoCreateNameBinding ) : RecyclerView.ViewHolder(binding.root) { diff --git a/presentation/src/main/java/com/going/presentation/todo/detail/TodoDetailActivity.kt b/presentation/src/main/java/com/going/presentation/todo/detail/TodoDetailActivity.kt index 50ed3b6f..d1dd0b2d 100644 --- a/presentation/src/main/java/com/going/presentation/todo/detail/TodoDetailActivity.kt +++ b/presentation/src/main/java/com/going/presentation/todo/detail/TodoDetailActivity.kt @@ -31,7 +31,7 @@ class TodoDetailActivity : private val viewModel by viewModels() - private var _adapter: TripAllocatorAdapter? = null + private var _adapter: DetailAllocatorAdapter? = null private val adapter get() = requireNotNull(_adapter) { getString(R.string.adapter_not_initialized_error_msg) } @@ -89,7 +89,7 @@ class TodoDetailActivity : private fun initAllocatorListAdapter() { if (viewModel.isPublic) { - _adapter = TripAllocatorAdapter() + _adapter = DetailAllocatorAdapter() binding.rvOurTodoDetailPerson.adapter = adapter } }