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