parent
7ab2779805
commit
489b968ea3
|
@ -51,6 +51,7 @@ import kr.co.vividnext.sodalive.live.room.dialog.LiveCancelDialog
|
|||
import kr.co.vividnext.sodalive.live.room.dialog.LivePaymentDialog
|
||||
import kr.co.vividnext.sodalive.live.room.dialog.LiveRoomPasswordDialog
|
||||
import kr.co.vividnext.sodalive.live.room.update.LiveRoomEditActivity
|
||||
import kr.co.vividnext.sodalive.main.MainActivity
|
||||
import kr.co.vividnext.sodalive.message.MessageActivity
|
||||
import kr.co.vividnext.sodalive.settings.event.EventDetailActivity
|
||||
import kr.co.vividnext.sodalive.settings.notification.MemberRole
|
||||
|
@ -105,11 +106,15 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
setupCommunityPost()
|
||||
|
||||
binding.llReviewLive.setOnClickListener {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(
|
||||
Intent(requireContext(), AudioContentAllByThemeActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_THEME_ID, 7L)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
}
|
||||
|
||||
message = "라이브를 불러오고 있습니다."
|
||||
|
@ -155,8 +160,20 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
|
||||
@SuppressLint("NotifyDataSetChanged")
|
||||
private fun setupRecommendLive() {
|
||||
binding.layoutRecommendLive.ivMessage.visibility = if (
|
||||
SharedPreferenceManager.token.isNotBlank()
|
||||
) {
|
||||
View.VISIBLE
|
||||
} else {
|
||||
View.GONE
|
||||
}
|
||||
|
||||
binding.layoutRecommendLive.ivMessage.setOnClickListener {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(Intent(requireContext(), MessageActivity::class.java))
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
}
|
||||
|
||||
val layoutParams = binding
|
||||
|
@ -176,11 +193,15 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
|
||||
binding.layoutRecommendLive.pager.apply {
|
||||
adapter = RecommendLiveAdapter(requireContext(), pagerWidth.roundToInt(), pagerHeight) {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(
|
||||
Intent(requireContext(), UserProfileActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_USER_ID, it)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
} as BaseBannerAdapter<Any>
|
||||
|
||||
setLifecycleRegistry(lifecycle)
|
||||
|
@ -215,14 +236,22 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
private fun setupRecommendChannel() {
|
||||
liveRecommendChannelAdapter = LiveRecommendChannelAdapter(
|
||||
onClick = {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(
|
||||
Intent(requireContext(), UserProfileActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_USER_ID, it)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
},
|
||||
onClickMore = {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(Intent(requireContext(), FollowingCreatorActivity::class.java))
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -264,9 +293,17 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
})
|
||||
|
||||
binding.layoutRecommendChannel.rvRecommendChannel.adapter = liveRecommendChannelAdapter
|
||||
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
binding.layoutRecommendChannel.tvFollowingChannel.visibility = View.VISIBLE
|
||||
binding.layoutRecommendChannel.ivSwitch.visibility = View.VISIBLE
|
||||
binding.layoutRecommendChannel.ivSwitch.setOnClickListener {
|
||||
viewModel.toggleIsFollowedCreatorLive()
|
||||
}
|
||||
} else {
|
||||
binding.layoutRecommendChannel.tvFollowingChannel.visibility = View.GONE
|
||||
binding.layoutRecommendChannel.ivSwitch.visibility = View.GONE
|
||||
}
|
||||
|
||||
viewModel.recommendChannelLiveData.observe(viewLifecycleOwner) {
|
||||
binding.layoutRecommendChannel.root.visibility = View.VISIBLE
|
||||
|
@ -297,7 +334,11 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
.layoutLiveNow
|
||||
.tvAllView
|
||||
.setOnClickListener {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(Intent(requireContext(), LiveNowAllActivity::class.java))
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
}
|
||||
|
||||
binding
|
||||
|
@ -389,6 +430,7 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
.rvSudaReservation
|
||||
|
||||
liveReservationAdapter = LiveReservationAdapter(isMain = true) {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
val detailFragment = LiveRoomDetailFragment(
|
||||
it.roomId,
|
||||
onClickParticipant = {},
|
||||
|
@ -403,6 +445,9 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
requireActivity().supportFragmentManager,
|
||||
detailFragment.tag
|
||||
)
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
}
|
||||
|
||||
recyclerView.layoutManager = LinearLayoutManager(
|
||||
|
@ -465,9 +510,16 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
}
|
||||
|
||||
binding.layoutLiveReservation.tvAllView.setOnClickListener {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(
|
||||
Intent(requireContext(), LiveReservationAllActivity::class.java)
|
||||
Intent(
|
||||
requireContext(),
|
||||
LiveReservationAllActivity::class.java
|
||||
)
|
||||
)
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -480,6 +532,7 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
|
||||
binding.eventBannerSlider.apply {
|
||||
adapter = EventBannerAdapter(requireContext()) {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
if (it.detailImageUrl != null) {
|
||||
val intent = Intent(requireActivity(), EventDetailActivity::class.java)
|
||||
intent.putExtra(Constants.EXTRA_EVENT, it)
|
||||
|
@ -492,6 +545,9 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
)
|
||||
)
|
||||
}
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
} as BaseBannerAdapter<Any>
|
||||
setLifecycleRegistry(lifecycle)
|
||||
setScrollDuration(800)
|
||||
|
@ -558,6 +614,7 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
})
|
||||
|
||||
creatorCommunityAdapter = CreatorCommunityAdapter {
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
startActivity(
|
||||
Intent(
|
||||
requireActivity(),
|
||||
|
@ -566,17 +623,20 @@ class LiveFragment : BaseFragment<FragmentLiveBinding>(FragmentLiveBinding::infl
|
|||
putExtra(Constants.EXTRA_COMMUNITY_CREATOR_ID, it)
|
||||
}
|
||||
)
|
||||
} else {
|
||||
(requireActivity() as MainActivity).showLoginActivity()
|
||||
}
|
||||
binding.rvCommunityPost.adapter = creatorCommunityAdapter
|
||||
}
|
||||
recyclerView.adapter = creatorCommunityAdapter
|
||||
|
||||
viewModel.communityPostItemLiveData.observe(viewLifecycleOwner) {
|
||||
if (it.isNotEmpty()) {
|
||||
binding.rvCommunityPost.visibility = View.VISIBLE
|
||||
recyclerView.visibility = View.VISIBLE
|
||||
creatorCommunityAdapter.items.clear()
|
||||
creatorCommunityAdapter.items.addAll(it)
|
||||
creatorCommunityAdapter.notifyDataSetChanged()
|
||||
} else {
|
||||
binding.rvCommunityPost.visibility = View.GONE
|
||||
recyclerView.visibility = View.GONE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,7 +179,10 @@ class LiveViewModel(
|
|||
} else {
|
||||
getRecommendChannelList()
|
||||
}
|
||||
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
getLatestPostListFromCreatorsYouFollow()
|
||||
}
|
||||
|
||||
val liveNow = repository.roomList(
|
||||
status = LiveRoomStatus.NOW,
|
||||
|
|
|
@ -188,8 +188,11 @@ class MainActivity : BaseActivity<ActivityMainBinding>(ActivityMainBinding::infl
|
|||
|
||||
override fun onNewIntent(intent: Intent) {
|
||||
super.onNewIntent(intent)
|
||||
|
||||
if (SharedPreferenceManager.token.isNotBlank()) {
|
||||
executeDeeplink(intent)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
|
|
@ -75,7 +75,8 @@
|
|||
android:id="@+id/rv_community_post"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="40dp" />
|
||||
android:layout_marginTop="40dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<include
|
||||
android:id="@+id/layout_live_reservation"
|
||||
|
|
|
@ -60,6 +60,7 @@
|
|||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_following_channel"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
|
|
Loading…
Reference in New Issue