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 } } 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) } }