-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 집안일 담당자 정하고 생성 #85
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ff387a9
집안일 담당자 rv 추가
sujin-kk 20e8e94
create bottom sheet dialog
sujin-kk e9cb12a
집안일 담당자 rv 추가
sujin-kk 65c7735
Merge branch 'develop' of https://github.com/depromeet/HouseKeeper in…
sujin-kk 3f202c3
바텀 시트 동작 확인
sujin-kk 3ce3a50
팀 조회 api로 그룹원 출력 확인
sujin-kk 056e12e
집안일 추가 동작
sujin-kk b9f747c
집안일 정보 업데이트
sujin-kk 227336e
집안일 이동 시 담당자 뷰 바뀌게 수정
sujin-kk ce2854b
집안일 생성 동작 확인
sujin-kk b04e55c
memberId 리스폰스 추가
sujin-kk 8f7b60a
직접 추가 구현
sujin-kk 6d67fd0
집안일 수정 api
sujin-kk 3a00705
집안일 수정 동작 확인
sujin-kk faf9f78
프로필 뷰 글자수 제한
sujin-kk 95ad68d
Merge branch 'develop' of https://github.com/depromeet/HouseKeeper in…
sujin-kk 78ae339
logout 처리
sujin-kk 9bca87d
JVM 제거
sujin-kk 8695811
Merge branch 'develop' into feature/add-assignee
sujin-kk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
app/src/main/java/com/depromeet/housekeeper/adapter/AddAssigneeAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package com.depromeet.housekeeper.adapter | ||
|
||
import android.annotation.SuppressLint | ||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.bumptech.glide.Glide | ||
import com.depromeet.housekeeper.databinding.ItemProfileBinding | ||
import com.depromeet.housekeeper.model.Assignee | ||
|
||
class AddAssigneeAdapter(private val assignees: ArrayList<Assignee>) | ||
: RecyclerView.Adapter<AddAssigneeAdapter.ViewHolder>() { | ||
|
||
@SuppressLint("NotifyDataSetChanged") | ||
fun updateAssignees(assignee: ArrayList<Assignee>) { | ||
assignees.clear() | ||
assignees.addAll(assignee) | ||
notifyDataSetChanged() | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
val binding: ItemProfileBinding = ItemProfileBinding.inflate( | ||
LayoutInflater.from(parent.context), parent, false) | ||
return ViewHolder(binding) | ||
} | ||
|
||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
holder.bind(assignees[position]) | ||
} | ||
|
||
override fun getItemCount(): Int = assignees.size | ||
|
||
inner class ViewHolder(val binding: ItemProfileBinding) | ||
: RecyclerView.ViewHolder(binding.root){ | ||
fun bind(assignee: Assignee) { | ||
binding.assignTemp = assignee | ||
Glide.with(binding.root) | ||
.load(assignee.profilePath) | ||
.into(binding.ivIcon) | ||
} | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
app/src/main/java/com/depromeet/housekeeper/adapter/BottomSheetAssigneeAdapter.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package com.depromeet.housekeeper.adapter | ||
|
||
import android.annotation.SuppressLint | ||
import android.view.LayoutInflater | ||
import android.view.ViewGroup | ||
import androidx.recyclerview.widget.RecyclerView | ||
import com.bumptech.glide.Glide | ||
import com.depromeet.housekeeper.databinding.ItemBottomSheetAssigneeBinding | ||
import com.depromeet.housekeeper.model.Assignee | ||
import timber.log.Timber | ||
|
||
class BottomSheetAssigneeAdapter(private val assignees: ArrayList<Assignee>, private val curAssignees: ArrayList<Assignee>) | ||
: RecyclerView.Adapter<BottomSheetAssigneeAdapter.ViewHolder>() { | ||
|
||
private var selectedAssignees: ArrayList<Assignee> = arrayListOf() // 선택한 담당자들 | ||
|
||
init { | ||
selectedAssignees.addAll(curAssignees) | ||
Timber.d(curAssignees.toString()) | ||
Timber.d(selectedAssignees.toString()) | ||
} | ||
|
||
fun getSelectedAssignees(): ArrayList<Assignee> { | ||
return selectedAssignees | ||
} | ||
|
||
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { | ||
val binding: ItemBottomSheetAssigneeBinding = ItemBottomSheetAssigneeBinding.inflate( | ||
LayoutInflater.from(parent.context), parent, false) | ||
|
||
binding.itemBottomSheetAssigneeCl.isSelected = false | ||
return ViewHolder(binding) | ||
} | ||
|
||
@SuppressLint("NotifyDataSetChanged") | ||
override fun onBindViewHolder(holder: ViewHolder, position: Int) { | ||
holder.bind(assignees[position]) | ||
|
||
holder.binding.itemBottomSheetAssigneeCl.apply { | ||
setOnClickListener { | ||
isSelected = !isSelected | ||
|
||
when(isSelected) { | ||
true -> selectedAssignees.add(assignees[position]) | ||
false -> selectedAssignees.remove(assignees[position]) | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
override fun getItemCount(): Int = assignees.size | ||
|
||
inner class ViewHolder(val binding: ItemBottomSheetAssigneeBinding) | ||
: RecyclerView.ViewHolder(binding.root){ | ||
|
||
@SuppressLint("NotifyDataSetChanged") | ||
fun bind(assignee: Assignee) { | ||
// 초기 selected | ||
if(selectedAssignees.contains(assignee)) { | ||
binding.itemBottomSheetAssigneeCheckIv.isSelected = true | ||
binding.itemBottomSheetAssigneeCl.isSelected = true | ||
} | ||
|
||
binding.itemBottomSheetAssigneeNameTv.text = assignee.memberName | ||
binding.itemBottomSheetAssigneeCl.isSelected = binding.itemBottomSheetAssigneeCheckIv.isSelected | ||
Glide.with(binding.root) | ||
.load(assignee.profilePath) | ||
.into(binding.itemBottomSheetAssigneeProfileIv) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
확인했습니다~~