라이브 상단 UI 변경
This commit is contained in:
@@ -27,7 +27,6 @@ import androidx.activity.OnBackPressedCallback
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.appcompat.widget.PopupMenu
|
||||
import androidx.core.content.ContextCompat
|
||||
import androidx.recyclerview.widget.GridLayoutManager
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.load
|
||||
@@ -111,7 +110,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
private var isSpeakerMute = false
|
||||
private var isMicrophoneMute = false
|
||||
private var isSpeaker = false
|
||||
private var isSpeakerFold = false
|
||||
|
||||
private var isNoChatting = false
|
||||
private var remainingNoChattingTime = noChattingTime
|
||||
@@ -456,31 +454,6 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}
|
||||
binding.ivNotification.setOnClickListener { viewModel.toggleShowNotice() }
|
||||
binding.rlNotice.setOnClickListener { viewModel.toggleExpandNotice() }
|
||||
binding.tvSpeakerFold.setOnClickListener {
|
||||
isSpeakerFold = !isSpeakerFold
|
||||
|
||||
if (isSpeakerFold) {
|
||||
binding.rlSpeaker.visibility = View.VISIBLE
|
||||
binding.rvSpeakers.visibility = View.VISIBLE
|
||||
binding.tvSpeakerFold.text = "접기"
|
||||
binding.tvSpeakerFold.setCompoundDrawablesWithIntrinsicBounds(
|
||||
R.drawable.ic_live_detail_top,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
)
|
||||
} else {
|
||||
binding.rlSpeaker.visibility = View.GONE
|
||||
binding.rvSpeakers.visibility = View.GONE
|
||||
binding.tvSpeakerFold.text = "펼치기"
|
||||
binding.tvSpeakerFold.setCompoundDrawablesWithIntrinsicBounds(
|
||||
R.drawable.ic_live_detail_bottom,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
binding.tvBgSwitch.setOnClickListener { viewModel.toggleBackgroundImage() }
|
||||
binding.llDonation.setOnClickListener {
|
||||
@@ -626,7 +599,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
)
|
||||
)
|
||||
binding.tvBgSwitch
|
||||
.setBackgroundResource(R.drawable.bg_round_corner_13_3_transparent_3bb9f1)
|
||||
.setBackgroundResource(R.drawable.bg_round_corner_5_3_transparent_3bb9f1)
|
||||
} else {
|
||||
binding.ivCover.visibility = View.GONE
|
||||
binding.tvBgSwitch.text = "배경 OFF"
|
||||
@@ -637,7 +610,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
)
|
||||
)
|
||||
binding.tvBgSwitch
|
||||
.setBackgroundResource(R.drawable.bg_round_corner_13_3_transparent_bbbbbb)
|
||||
.setBackgroundResource(R.drawable.bg_round_corner_5_3_transparent_bbbbbb)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -715,7 +688,11 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
}
|
||||
|
||||
speakerListAdapter.managerId = response.creatorId
|
||||
speakerListAdapter.updateList(response.speakerList)
|
||||
speakerListAdapter.updateList(
|
||||
response.speakerList.filter {
|
||||
it.id != response.creatorId
|
||||
}
|
||||
)
|
||||
|
||||
if (response.creatorId == SharedPreferenceManager.userId) {
|
||||
binding.ivEdit.setOnClickListener {
|
||||
@@ -804,7 +781,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
if (response.creatorId != SharedPreferenceManager.userId) {
|
||||
binding.ivCreatorFollow.visibility = View.VISIBLE
|
||||
if (response.isFollowing) {
|
||||
binding.ivCreatorFollow.setImageResource(R.drawable.btn_following)
|
||||
binding.ivCreatorFollow.setImageResource(R.drawable.btn_select_checked)
|
||||
binding.ivCreatorFollow.setOnClickListener {
|
||||
viewModel.creatorUnFollow(
|
||||
creatorId = response.creatorId,
|
||||
@@ -812,7 +789,7 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
)
|
||||
}
|
||||
} else {
|
||||
binding.ivCreatorFollow.setImageResource(R.drawable.btn_follow)
|
||||
binding.ivCreatorFollow.setImageResource(R.drawable.btn_plus_round)
|
||||
binding.ivCreatorFollow.setOnClickListener {
|
||||
viewModel.creatorFollow(
|
||||
creatorId = response.creatorId,
|
||||
@@ -999,7 +976,11 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
val rvSpeakers = binding.rvSpeakers
|
||||
speakerListAdapter = LiveRoomProfileListAdapter()
|
||||
|
||||
rvSpeakers.layoutManager = GridLayoutManager(applicationContext, 5)
|
||||
rvSpeakers.layoutManager = LinearLayoutManager(
|
||||
applicationContext,
|
||||
LinearLayoutManager.HORIZONTAL,
|
||||
false
|
||||
)
|
||||
rvSpeakers.addItemDecoration(object : RecyclerView.ItemDecoration() {
|
||||
override fun getItemOffsets(
|
||||
outRect: Rect,
|
||||
@@ -1009,8 +990,8 @@ class LiveRoomActivity : BaseActivity<ActivityLiveRoomBinding>(ActivityLiveRoomB
|
||||
) {
|
||||
super.getItemOffsets(outRect, view, parent, state)
|
||||
|
||||
outRect.top = 5f.dpToPx().toInt()
|
||||
outRect.bottom = 5f.dpToPx().toInt()
|
||||
outRect.left = 4f.dpToPx().toInt()
|
||||
outRect.right = 4f.dpToPx().toInt()
|
||||
}
|
||||
})
|
||||
rvSpeakers.adapter = speakerListAdapter
|
||||
|
@@ -188,7 +188,7 @@ data class LiveRoomNormalChat(
|
||||
}
|
||||
|
||||
-1 -> {
|
||||
itemBinding.ivBg.setImageResource(R.drawable.bg_circle_6f3dec_9970ff)
|
||||
itemBinding.ivBg.setImageResource(R.drawable.bg_circle_3bb9f1)
|
||||
itemBinding.ivCrown.setImageResource(R.drawable.ic_crown)
|
||||
itemBinding.ivCrown.visibility = View.VISIBLE
|
||||
}
|
||||
@@ -227,7 +227,7 @@ data class LiveRoomNormalChat(
|
||||
)
|
||||
|
||||
if (SharedPreferenceManager.userId == userId) {
|
||||
itemBinding.llMessageBg.setBackgroundResource(R.drawable.bg_round_corner_3_3_999970ff)
|
||||
itemBinding.llMessageBg.setBackgroundResource(R.drawable.bg_round_corner_3_3_553bb9f1)
|
||||
} else {
|
||||
itemBinding.llMessageBg.setBackgroundResource(R.drawable.bg_round_corner_3_3_99000000)
|
||||
}
|
||||
|
@@ -5,8 +5,7 @@ import android.view.View
|
||||
import android.view.ViewGroup
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
import coil.load
|
||||
import coil.transform.RoundedCornersTransformation
|
||||
import coil.transform.CircleCropTransformation
|
||||
import kr.co.vividnext.sodalive.R
|
||||
import kr.co.vividnext.sodalive.databinding.ItemLiveRoomProfileBinding
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
@@ -21,7 +20,7 @@ class LiveRoomProfileListAdapter : RecyclerView.Adapter<LiveRoomProfileListAdapt
|
||||
binding.ivProfile.loadUrl(item.profileImage) {
|
||||
crossfade(true)
|
||||
placeholder(R.drawable.ic_place_holder)
|
||||
transformations(RoundedCornersTransformation(23.3f.dpToPx()))
|
||||
transformations(CircleCropTransformation())
|
||||
|
||||
if (activeSpeakers.contains(item.id.toInt())) {
|
||||
binding.ivBg.visibility = View.VISIBLE
|
||||
@@ -36,15 +35,9 @@ class LiveRoomProfileListAdapter : RecyclerView.Adapter<LiveRoomProfileListAdapt
|
||||
}
|
||||
|
||||
val ivMuteLp = binding.ivMute.layoutParams
|
||||
ivMuteLp.width = 51.7f.dpToPx().toInt()
|
||||
ivMuteLp.height = 51.7f.dpToPx().toInt()
|
||||
ivMuteLp.width = 30f.dpToPx().toInt()
|
||||
ivMuteLp.height = 30f.dpToPx().toInt()
|
||||
binding.ivMute.layoutParams = ivMuteLp
|
||||
|
||||
if (managerId == item.id) {
|
||||
binding.ivCrown.visibility = View.VISIBLE
|
||||
} else {
|
||||
binding.ivCrown.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
|
||||
binding.tvNickname.text = item.nickname
|
||||
|
Reference in New Issue
Block a user