Skip to content
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] 팀원 현황 뷰 구현 #35

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
07cf836
[ADD] fragment 확인용 test activity 생성
emjayMJkim Jul 14, 2023
e45fa4f
[ADD] 팀원 현황 뷰 날짜 background 생성
emjayMJkim Jul 14, 2023
0c93097
[ADD] 팀원 현황 뷰 날짜 item 생성
emjayMJkim Jul 14, 2023
a14c9a7
[FEAT] 팀원 현황 뷰 recyclerview 추가
emjayMJkim Jul 14, 2023
4404b6f
Merge branch 'develop' of https://github.com/emjayMJkim/Puzzling_Andr…
emjayMJkim Jul 14, 2023
7b8fce4
[ADD] 팀원 현황 뷰 recyclerview item 생성
emjayMJkim Jul 14, 2023
7ca4e01
[ADD] 팀원 현황 뷰 data class 생성
emjayMJkim Jul 14, 2023
71ea800
[FIX] Merge conflict 해결
emjayMJkim Jul 15, 2023
e14c1d7
[MOD] 회고 진행 title item 수정
emjayMJkim Jul 15, 2023
825a7d3
[ADD] MVVM용 파일 생성
emjayMJkim Jul 15, 2023
e55acb4
[FEAT] 회고 진행 현황 리스트 생성
emjayMJkim Jul 15, 2023
380ac26
[UI] 팀원 현황 뷰 layout 위치 조정
emjayMJkim Jul 15, 2023
709f2e2
[FEAT] 팀원 현황 뷰 상단 date 추가
emjayMJkim Jul 15, 2023
97d9176
[FEAT] 일주일 날짜 상단 띄우기 구현
emjayMJkim Jul 15, 2023
eccbc18
[ADD] 팀원 회고 리스트 data class 생성
emjayMJkim Jul 15, 2023
d59c68c
[FEAT] 서버 API에 맞게 회고 진행 현황 리스트 생성
emjayMJkim Jul 16, 2023
614a623
[UI] 회고 진행 리스트 recyclerview 위치 조정
emjayMJkim Jul 16, 2023
c0419aa
[FIX] Merge conflict 해결
emjayMJkim Jul 16, 2023
b8e4fa9
[ADD] ViewPager 생성
emjayMJkim Jul 17, 2023
5bad872
[FIX] Merge conflict 해결
emjayMJkim Jul 17, 2023
abc926d
[FIX] Merge conflict 해결
emjayMJkim Jul 17, 2023
4f4ae41
[FEAT] 팀원 회고 현황 viewPager 구현
emjayMJkim Jul 17, 2023
6f15a9c
[MOD] 필요 없는 코드 정리
emjayMJkim Jul 17, 2023
1970d13
[FIX] Merge conflict 해결
emjayMJkim Jul 17, 2023
efb9da8
[ADD] 회고 주기 아닌 경우의 fragment 연결
emjayMJkim Jul 17, 2023
7bde159
[ADD] 회고 진행한 사람 없는 경우 추가
emjayMJkim Jul 17, 2023
317fc05
[ADD] testActivity로 뷰 확인
emjayMJkim Jul 17, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@
android:name=".presentation.main.MainActivity"
android:exported="true"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".presentation.invitationCode.InvitationCodeActivity"
Expand All @@ -38,22 +43,15 @@
android:exported="true"
android:windowSoftInputMode="adjustPan" />
<activity
android:name=".presentation.team.currentSituation.TeamCurrentSituationFragment"
android:exported="true"
android:windowSoftInputMode="adjustPan" />
android:name=".presentation.team.currentSituation.MjTestActivity"
android:windowSoftInputMode="adjustPan"
android:exported="true" >
</activity>
<activity android:name=".presentation.detailRetrospect.DetailRetroActivity"
android:exported="true"/>
<activity android:name=".presentation.onboarding.LoginActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

<data
android:host="oauth"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.puzzling.puzzlingaos.data.model.response

import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectList
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class ResponseTeamRetrospectListDto(
@SerialName("status")
val status: Int,
@SerialName("success")
val success: Boolean,
@SerialName("message")
val message: String,
@SerialName("date")
val data: List<TeamRetrospectList>?
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.puzzling.puzzlingaos.data.repository

import com.puzzling.puzzlingaos.data.source.remote.TeamCurrentSituationRemoteDataSource
import com.puzzling.puzzlingaos.domain.repository.TeamCurrentSituationRepository

class TeamCurrentSituationRepositoryImpl(private val teamCurrentSituationRemoteDataSource: TeamCurrentSituationRemoteDataSource) :
TeamCurrentSituationRepository
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzling.puzzlingaos.data.source.remote

class TeamCurrentSituationRemoteDataSource {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.puzzling.puzzlingaos.domain.entity

import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class TeamRetrospectList(
@SerialName("reviewDay")
val reviewDay: String,
@SerialName("reviewDate")
val reviewDate: String,
@SerialName("reviewWriters")
val reviewWriters: ArrayList<ReviewWriterList>?,
@SerialName("nonReviewWriters")
val nonReviewWriters: ArrayList<NonReviewWriterList>?,
) {
@Serializable
data class ReviewWriterList(
@SerialName("memberNickname")
val memberNickname: String,
@SerialName("memberRole")
val memberRole: String,
)

@Serializable
data class NonReviewWriterList(
@SerialName("memberNickname")
val memberNickname: String,
@SerialName("memberRole")
val memberRole: String,
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.puzzling.puzzlingaos.domain.entity

data class TeamRetrospectMultiList(
var type: Int,
var reviewDay: String?,
var reviewDate: String?,
var memberNickname: String?,
var memberRole: String?
) {

companion object {
const val DO_RETROSPECT_TEXT = 0
const val DO_RETROSPECT_LIST = 1
const val DONT_RETROSPECT_TEXT = 2
const val DONT_RETROSPECT_LIST = 3
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.puzzling.puzzlingaos.domain.entity

data class ThisWeek(
var thisDay: String
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.puzzling.puzzlingaos.domain.repository

interface TeamCurrentSituationRepository {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
package com.puzzling.puzzlingaos.presentation.team.currentSituation

import android.os.Bundle
import android.view.View
import androidx.lifecycle.LiveData
import androidx.lifecycle.ViewModelProvider
import com.puzzling.puzzlingaos.R
import com.puzzling.puzzlingaos.base.BaseFragment
import com.puzzling.puzzlingaos.databinding.FragmentItemTeamRetrospectListBinding
import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectList
import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectMultiList
import com.puzzling.puzzlingaos.util.DividerItemDecoration
import com.puzzling.puzzlingaos.util.ViewModelFactory

class ItemTeamRetrospectListFragment(
private val dayPosition: Int,
) : BaseFragment<FragmentItemTeamRetrospectListBinding>(R.layout.fragment_item_team_retrospect_list) {

private lateinit var viewModel: TeamCurrentSituationViewModel

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)

viewModel = ViewModelProvider(
requireActivity(),
ViewModelFactory(requireContext()),
)[TeamCurrentSituationViewModel::class.java]

val day = viewModel.week[dayPosition]

viewModel.getTeamRetrospectList()

val retroItem = viewModel.teamRetrospectList.value

binding.rcvTeamRetrospectList.addItemDecoration(
DividerItemDecoration(R.color.gray_300, 32),
)

if (retroItem != null) {
for (item in retroItem) {
if (day == item.reviewDay) {
testItemList(viewModel.teamRetrospectList, day)
}
}
}
if (retroItem != null) {
for (item in retroItem) {
if (day == item.reviewDay) {
binding.rcvTeamRetrospectList.adapter = viewModel.teamRetrospectMultiList.value?.let {
RetrospectListAdapter(
it,
)
}
}
}
}
}

fun testItemList(itemList: LiveData<ArrayList<TeamRetrospectList>>, day: String) {
var intDay: Int = viewModel.itemRetroList.indexOfFirst { it.reviewDay == day }

viewModel.teamRetrospectMultiList.value?.clear()

if (itemList.value?.isNotEmpty() == true) {
if (itemList.value?.get(intDay)?.reviewWriters?.isNotEmpty() == true) {
viewModel.teamRetrospectMultiList.value?.add(
TeamRetrospectMultiList(
0,
null,
null,
null,
null,
),
)
for (i in 0 until (itemList.value?.get(intDay)?.reviewWriters!!.size ?: 0)) {
viewModel.teamRetrospectMultiList.value?.add(
TeamRetrospectMultiList(
1,
itemList.value?.get(intDay)?.reviewDay,
itemList.value?.get(intDay)?.reviewDate,
itemList.value?.get(intDay)?.reviewWriters?.get(i)?.memberNickname,
itemList.value?.get(intDay)?.reviewWriters?.get(i)?.memberRole,
),
)
}
}

if (itemList.value?.get(intDay)?.nonReviewWriters?.isNotEmpty() == true) {
viewModel.teamRetrospectMultiList.value?.add(
TeamRetrospectMultiList(
2,
null,
null,
null,
null,
),
)
for (i: Int in 0 until (itemList.value?.get(intDay)?.nonReviewWriters?.size ?: 0)) {
viewModel.teamRetrospectMultiList.value?.add(
TeamRetrospectMultiList(
3,
itemList.value?.get(intDay)?.reviewDay,
itemList.value?.get(intDay)?.reviewDate,
itemList.value?.get(intDay)?.nonReviewWriters?.get(i)?.memberNickname,
itemList.value?.get(intDay)?.nonReviewWriters?.get(i)?.memberRole,
),
)
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.puzzling.puzzlingaos.presentation.team.currentSituation

import android.os.Bundle
import com.puzzling.puzzlingaos.R
import com.puzzling.puzzlingaos.base.BaseActivity
import com.puzzling.puzzlingaos.databinding.ActivityMjTestBinding

class MjTestActivity : BaseActivity<ActivityMjTestBinding>(R.layout.activity_mj_test) {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

supportFragmentManager
.beginTransaction()
.replace(R.id.fcv_team_current, TeamCurrentSituationFragment())
.commit()
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.puzzling.puzzlingaos.presentation.team.currentSituation

import android.os.Bundle
import android.view.View
import com.puzzling.puzzlingaos.R
import com.puzzling.puzzlingaos.base.BaseFragment
import com.puzzling.puzzlingaos.databinding.FragmentNoItemTeamRetrospectListBinding

class NoItemTeamRetrospectListFragment : BaseFragment<FragmentNoItemTeamRetrospectListBinding>(R.layout.fragment_no_item_team_retrospect_list){
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package com.puzzling.puzzlingaos.presentation.team.currentSituation

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.puzzling.puzzlingaos.databinding.ItemTeamDoRetrospectListBinding
import com.puzzling.puzzlingaos.databinding.ItemTeamDoRetrospectTextBinding
import com.puzzling.puzzlingaos.databinding.ItemTeamDontRetrospectListBinding
import com.puzzling.puzzlingaos.databinding.ItemTeamDontRetrospectTextBinding
import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectMultiList
import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectMultiList.Companion.DONT_RETROSPECT_LIST
import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectMultiList.Companion.DONT_RETROSPECT_TEXT
import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectMultiList.Companion.DO_RETROSPECT_LIST
import com.puzzling.puzzlingaos.domain.entity.TeamRetrospectMultiList.Companion.DO_RETROSPECT_TEXT

class RetrospectListAdapter(var adapterItemList: ArrayList<TeamRetrospectMultiList> = ArrayList<TeamRetrospectMultiList>()) : RecyclerView.Adapter<RecyclerView.ViewHolder>() {

private lateinit var doRetrospectTextBinding: ItemTeamDoRetrospectTextBinding
private lateinit var dontRetrospectTextBinding: ItemTeamDontRetrospectTextBinding
private lateinit var doRetrospectListBinding: ItemTeamDoRetrospectListBinding
private lateinit var dontRetrospectListBinding: ItemTeamDontRetrospectListBinding

inner class DoRetrospectTextViewHolder(val binding: ItemTeamDoRetrospectTextBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(item: TeamRetrospectMultiList) {
binding.tvItemRetrospectText.text
}
}
inner class DontRetrospectTextViewHolder(val binding: ItemTeamDontRetrospectTextBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(item: TeamRetrospectMultiList) {
binding.tvItemRetrospectText.text
}
}
inner class DoRetrospectListViewHolder(val binding: ItemTeamDoRetrospectListBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(item: TeamRetrospectMultiList) {
binding.tvItemRetrospectNickName.text = item.memberNickname
binding.tvItemRetrospectRole.text = item.memberRole
}
}

inner class DontRetrospectListViewHolder(val binding: ItemTeamDontRetrospectListBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(item: TeamRetrospectMultiList) {
binding.tvItemRetrospectNickName.text = item.memberNickname
binding.tvItemRetrospectRole.text = item.memberRole
}
}

override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
return when (viewType) {
DO_RETROSPECT_TEXT -> {
doRetrospectTextBinding = ItemTeamDoRetrospectTextBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return DoRetrospectTextViewHolder(doRetrospectTextBinding)
}
DONT_RETROSPECT_TEXT -> {
dontRetrospectTextBinding = ItemTeamDontRetrospectTextBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return DontRetrospectTextViewHolder(dontRetrospectTextBinding)
}
DO_RETROSPECT_LIST -> {
doRetrospectListBinding = ItemTeamDoRetrospectListBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return DoRetrospectListViewHolder(doRetrospectListBinding)
}
else -> {
dontRetrospectListBinding = ItemTeamDontRetrospectListBinding.inflate(LayoutInflater.from(parent.context), parent, false)
return DontRetrospectListViewHolder(dontRetrospectListBinding)
}
}
}

override fun onBindViewHolder(holder: RecyclerView.ViewHolder, position: Int) {
when (adapterItemList[position].type) {
DO_RETROSPECT_TEXT -> {
(holder as DoRetrospectTextViewHolder).bind(adapterItemList[position])
holder.setIsRecyclable(false)
}
DONT_RETROSPECT_TEXT -> {
(holder as DontRetrospectTextViewHolder).bind(adapterItemList[position])
holder.setIsRecyclable(false)
}
DO_RETROSPECT_LIST -> {
(holder as DoRetrospectListViewHolder).bind(adapterItemList[position])
holder.setIsRecyclable(false)
}
DONT_RETROSPECT_LIST -> {
(holder as DontRetrospectListViewHolder).bind(adapterItemList[position])
holder.setIsRecyclable(false)
}
}
}

override fun getItemViewType(position: Int): Int {
return adapterItemList[position].type
}

override fun getItemCount(): Int = adapterItemList.size
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.puzzling.puzzlingaos.presentation.team.currentSituation

import androidx.fragment.app.Fragment
import androidx.viewpager2.adapter.FragmentStateAdapter

class RetrospectThisWeekAdapter(
fragment: Fragment,
private val num: MutableList<Int>,
) : FragmentStateAdapter(fragment) {
override fun getItemCount(): Int {
return 7
}

override fun createFragment(position: Int): Fragment {
return when (num[position]) {
0 -> NoItemTeamRetrospectListFragment()
1 -> ItemTeamRetrospectListFragment(position)
2 -> ItemTeamRetrospectListFragment(position)
else -> ItemTeamRetrospectListFragment(position)
}
}
}
Loading
Loading