feat(creator): 후원 탭 Activity 연결을 추가한다
This commit is contained in:
@@ -42,6 +42,7 @@ import kr.co.vividnext.sodalive.explorer.profile.creator_community.all.CreatorCo
|
||||
import kr.co.vividnext.sodalive.explorer.profile.creator_community.modify.CreatorCommunityModifyActivity
|
||||
import kr.co.vividnext.sodalive.explorer.profile.creator_community.modify.ModifyCommunityPostRequest
|
||||
import kr.co.vividnext.sodalive.explorer.profile.creator_community.write.CreatorCommunityWriteActivity
|
||||
import kr.co.vividnext.sodalive.explorer.profile.donation.UserProfileDonationAllViewActivity
|
||||
import kr.co.vividnext.sodalive.extensions.dpToPx
|
||||
import kr.co.vividnext.sodalive.extensions.loadUrl
|
||||
import kr.co.vividnext.sodalive.extensions.moneyFormat
|
||||
@@ -64,6 +65,7 @@ import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelLiveRespon
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelScheduleResponse
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.data.CreatorChannelSeriesResponse
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.fantalk.CreatorChannelFanTalkFragment
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.donation.CreatorChannelDonationFragment
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.live.CreatorChannelLiveFragment
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelHeaderUiModel
|
||||
import kr.co.vividnext.sodalive.v2.creator.channel.model.CreatorChannelScrollState
|
||||
@@ -85,7 +87,8 @@ class CreatorChannelActivity :
|
||||
CreatorChannelAudioFragment.Host,
|
||||
CreatorChannelSeriesFragment.Host,
|
||||
CreatorChannelCommunityFragment.Host,
|
||||
CreatorChannelFanTalkFragment.Host {
|
||||
CreatorChannelFanTalkFragment.Host,
|
||||
CreatorChannelDonationFragment.Host {
|
||||
|
||||
private val liveViewModel: LiveViewModel by inject()
|
||||
private val myPageViewModel: MyPageViewModel by inject()
|
||||
@@ -435,6 +438,9 @@ class CreatorChannelActivity :
|
||||
CreatorChannelTab.FanTalk.ordinal -> binding.viewPager.post {
|
||||
findFanTalkFragment()?.onCreatorChannelFanTalkTabSelected()
|
||||
}
|
||||
CreatorChannelTab.Donation.ordinal -> binding.viewPager.post {
|
||||
findDonationFragment()?.onCreatorChannelDonationTabSelected()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -468,6 +474,11 @@ class CreatorChannelActivity :
|
||||
findFanTalkFragment()?.onCreatorChannelFanTalkTabSelected()
|
||||
}
|
||||
}
|
||||
if (binding.viewPager.currentItem == CreatorChannelTab.Donation.ordinal) {
|
||||
binding.viewPager.post {
|
||||
findDonationFragment()?.onCreatorChannelDonationTabSelected()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreatorChannelFollowProgressChanged(inProgress: Boolean) {
|
||||
@@ -548,6 +559,31 @@ class CreatorChannelActivity :
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreatorChannelDonationContentChanged() {
|
||||
updateViewPagerHeight {
|
||||
postCheckCreatorChannelCurrentTabNeedsMore()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCreatorChannelDonationRequested(
|
||||
onSubmit: (can: Int, isSecret: Boolean, message: String) -> Unit
|
||||
) {
|
||||
if (currentHeader?.isOwner == true) return
|
||||
showCreatorChannelDonationDialog(onSubmit)
|
||||
}
|
||||
|
||||
override fun onCreatorChannelDonationRankingAllClicked() {
|
||||
startActivity(
|
||||
Intent(this, UserProfileDonationAllViewActivity::class.java).apply {
|
||||
putExtra(Constants.EXTRA_USER_ID, creatorId)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
override fun onCreatorChannelDonationCompleted() {
|
||||
homeActionDelegate?.refreshHome()
|
||||
}
|
||||
|
||||
override fun onCreatorChannelFanTalkDeleteClicked(fanTalkId: Long) {
|
||||
SodaDialog(
|
||||
activity = this,
|
||||
@@ -809,6 +845,14 @@ class CreatorChannelActivity :
|
||||
val header = currentHeader ?: return
|
||||
if (header.isOwner) return
|
||||
|
||||
showCreatorChannelDonationDialog { can, isSecret, message ->
|
||||
homeActionDelegate?.postChannelDonation(can = can, isSecret = isSecret, message = message)
|
||||
}
|
||||
}
|
||||
|
||||
private fun showCreatorChannelDonationDialog(
|
||||
onSubmit: (can: Int, isSecret: Boolean, message: String) -> Unit
|
||||
) {
|
||||
val dialog = LiveRoomDonationDialog(
|
||||
this,
|
||||
LayoutInflater.from(this),
|
||||
@@ -817,7 +861,7 @@ class CreatorChannelActivity :
|
||||
secretToggleLabelResId = R.string.screen_user_profile_channel_donation_secret,
|
||||
applySecretMissionMessageHint = false
|
||||
) { can, message, isSecret ->
|
||||
homeActionDelegate?.postChannelDonation(can = can, isSecret = isSecret, message = message)
|
||||
onSubmit(can, isSecret, message)
|
||||
}
|
||||
dialog.show(screenWidth - 26.7f.dpToPx().toInt())
|
||||
}
|
||||
@@ -857,6 +901,11 @@ class CreatorChannelActivity :
|
||||
return supportFragmentManager.findFragmentByTag(fragmentTag) as? CreatorChannelFanTalkFragment
|
||||
}
|
||||
|
||||
private fun findDonationFragment(): CreatorChannelDonationFragment? {
|
||||
val fragmentTag = "f${CreatorChannelTab.Donation.ordinal}"
|
||||
return supportFragmentManager.findFragmentByTag(fragmentTag) as? CreatorChannelDonationFragment
|
||||
}
|
||||
|
||||
private fun notifyCurrentCreatorChannelTabScrolledToBottom() {
|
||||
when (binding.viewPager.currentItem) {
|
||||
CreatorChannelTab.Live.ordinal -> findLiveFragment()?.onCreatorChannelLiveScrolledToBottom()
|
||||
@@ -864,6 +913,7 @@ class CreatorChannelActivity :
|
||||
CreatorChannelTab.Series.ordinal -> findSeriesFragment()?.onCreatorChannelSeriesScrolledToBottom()
|
||||
CreatorChannelTab.Community.ordinal -> findCommunityFragment()?.onCreatorChannelCommunityScrolledToBottom()
|
||||
CreatorChannelTab.FanTalk.ordinal -> findFanTalkFragment()?.onCreatorChannelFanTalkScrolledToBottom()
|
||||
CreatorChannelTab.Donation.ordinal -> findDonationFragment()?.onCreatorChannelDonationScrolledToBottom()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -872,7 +922,8 @@ class CreatorChannelActivity :
|
||||
position == CreatorChannelTab.Audio.ordinal ||
|
||||
position == CreatorChannelTab.Series.ordinal ||
|
||||
position == CreatorChannelTab.Community.ordinal ||
|
||||
position == CreatorChannelTab.FanTalk.ordinal
|
||||
position == CreatorChannelTab.FanTalk.ordinal ||
|
||||
position == CreatorChannelTab.Donation.ordinal
|
||||
}
|
||||
|
||||
private fun ensureLoginAndAdultAuth(isAdult: Boolean, onAuthed: () -> Unit) {
|
||||
@@ -971,6 +1022,7 @@ class CreatorChannelActivity :
|
||||
CreatorChannelTab.Audio.ordinal -> findAudioFragment()?.onCreatorChannelAudioViewportHeightChanged(minHeight)
|
||||
CreatorChannelTab.Series.ordinal -> findSeriesFragment()?.onCreatorChannelSeriesViewportHeightChanged(minHeight)
|
||||
CreatorChannelTab.FanTalk.ordinal -> findFanTalkFragment()?.onCreatorChannelFanTalkViewportHeightChanged(minHeight)
|
||||
CreatorChannelTab.Donation.ordinal -> findDonationFragment()?.onCreatorChannelDonationViewportHeightChanged(minHeight)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user