Skip to content

Commit

Permalink
๐ŸŽจ Design: ๋ชจ์ž„ ์ผ์ • ์ฐธ์„์ž x ํ‘œ์‹œ ์‚ญ์ œ
Browse files Browse the repository at this point in the history
- ์ด๋ฏธ ์ดˆ๋Œ€ํ•œ ์นœ๊ตฌ๋Š” ์‚ญ์ œ๊ฐ€ ๋ถˆ๊ฐ€๋Šฅํ•จ
- ์ •์ฑ… ๋ณ€๊ฒฝ์— ๋”ฐ๋ฅธ ์ˆ˜์ • ์‚ฌํ•ญ

Related to: #347
  • Loading branch information
nahy-512 committed Feb 14, 2025
1 parent 0bf6b90 commit 6d73b5d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,6 @@ class MoimScheduleActivity : BaseActivity<ActivityMoimScheduleBinding>(R.layout.
}
}

viewModel.isCurrentUserOwner.observe(this) { isOwner ->
if (isOwner) {
participantAdapter.updateIsOwner(isOwner)
}
}

viewModel.successState.observe(this) { successState ->
Log.e("MoimScheduleACT", "API ์š”์ฒญ ์„ฑ๊ณต ์—ฌ๋ถ€: ${successState.isSuccess}")
if (successState.isSuccess) { // ์š”์ฒญ์ด ์„ฑ๊ณตํ•œ ๊ฒฝ์šฐ
Expand Down Expand Up @@ -361,7 +355,6 @@ class MoimScheduleActivity : BaseActivity<ActivityMoimScheduleBinding>(R.layout.
flexDirection = FlexDirection.ROW
}
}
Log.d("MoimScheduleAct", "isOwner: ${viewModel.isCurrentUserOwner.value!!}")
}

//TODO: ๊ฒŒ์ŠคํŠธ ๋ฆฌ์‚ฌ์ดํด๋Ÿฌ๋ทฐ ์—ฐ๊ฒฐ
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
package com.mongmong.namo.presentation.ui.community.moim.schedule.adapter

import android.annotation.SuppressLint
import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView
import com.mongmong.namo.databinding.ItemMoimParticipantBinding
import com.mongmong.namo.domain.model.Participant

class MoimParticipantRVAdapter(private val participantList : List<Participant>) : RecyclerView.Adapter<MoimParticipantRVAdapter.ViewHolder>() {

var isOwner: Boolean = false

@SuppressLint("NotifyDataSetChanged")
fun updateIsOwner(isOwner: Boolean) {
this.isOwner = isOwner
notifyDataSetChanged()
}

override fun onCreateViewHolder(
parent: ViewGroup,
viewType: Int
Expand All @@ -35,7 +25,6 @@ class MoimParticipantRVAdapter(private val participantList : List<Participant>)
inner class ViewHolder(val binding: ItemMoimParticipantBinding) : RecyclerView.ViewHolder(binding.root) {
fun bind(participant : Participant) {
binding.participant = participant
binding.isCurrentUserOwner = isOwner
}
}
}
5 changes: 1 addition & 4 deletions app/src/main/res/layout/item_moim_participant.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@
<data>
<import type="com.mongmong.namo.presentation.enums.CategoryColor"/>
<import type="android.view.View"/>
<variable
name="isCurrentUserOwner"
type="Boolean" />
<variable
name="participant"
type="com.mongmong.namo.domain.model.Participant" />
Expand Down Expand Up @@ -72,7 +69,7 @@
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:src="@drawable/ic_close"
android:visibility="@{!isCurrentUserOwner ? View.GONE : ( participant.isOwner ? View.GONE : View.VISIBLE ) }"/>
android:visibility="gone"/>

</LinearLayout>

Expand Down

0 comments on commit 6d73b5d

Please sign in to comment.