feat(creator): 후원 floating button 위치를 조정한다

This commit is contained in:
2026-06-22 23:22:26 +09:00
parent 4d79cb65cd
commit 9b19be7775
6 changed files with 79 additions and 24 deletions
@@ -103,6 +103,7 @@ class CreatorChannelActivity :
private var lastSelectedCreatorChannelTabPosition: Int? = null
private var isOwnerFabExpanded: Boolean = false
private var isOwnerFabAnimating: Boolean = false
private var isDonationFloatingButtonVisible: Boolean = false
private lateinit var loadingDialog: LoadingDialog
private val baseTitleBarHeight: Int by lazy { 60.dpToPx().toInt() }
private val liveCoordinator: CreatorChannelLiveCoordinator by lazy {
@@ -189,6 +190,9 @@ class CreatorChannelActivity :
binding.ownerFabCommunityButton.setOnClickListener { onOwnerFabCommunityClicked() }
binding.ownerFabAudioButton.setOnClickListener { onOwnerFabAudioClicked() }
binding.ownerFabLiveButton.setOnClickListener { onOwnerFabLiveClicked() }
binding.btnCreatorChannelDonationWrite.setOnClickListener {
findDonationFragment()?.onCreatorChannelDonationFloatingButtonClicked()
}
binding.btnCreatorChannelOwnerCta.setOnClickListener { onOwnerCtaClicked() }
binding.tvChatButton.setOnClickListener {
currentHeader?.characterId?.let { characterId -> homeActionDelegate?.createChatRoom(characterId) }
@@ -419,6 +423,7 @@ class CreatorChannelActivity :
collapseOwnerFab(animate = false)
}
updateOwnerFabVisibility()
updateDonationFloatingButtonVisibility()
updateOwnerCtaVisibility()
updateCreatorChannelTabViewportHeight()
updateViewPagerHeight()
@@ -453,6 +458,7 @@ class CreatorChannelActivity :
bindHeader(header)
bindTitleBar(header)
updateOwnerFabVisibility()
updateDonationFloatingButtonVisibility()
updateOwnerCtaVisibility()
if (binding.viewPager.currentItem == CreatorChannelTab.Audio.ordinal) {
binding.viewPager.post {
@@ -565,6 +571,11 @@ class CreatorChannelActivity :
}
}
override fun onCreatorChannelDonationFloatingButtonVisibilityChanged(isVisible: Boolean) {
isDonationFloatingButtonVisible = isVisible
updateDonationFloatingButtonVisibility()
}
override fun onCreatorChannelDonationRequested(
onSubmit: (can: Int, isSecret: Boolean, message: String) -> Unit
) {
@@ -817,6 +828,14 @@ class CreatorChannelActivity :
}
}
private fun updateDonationFloatingButtonVisibility() {
val shouldShowDonationFloatingButton =
isDonationFloatingButtonVisible &&
currentHeader?.isOwner != true &&
binding.viewPager.currentItem == CreatorChannelTab.Donation.ordinal
binding.btnCreatorChannelDonationWrite.isVisible = shouldShowDonationFloatingButton
}
private fun onOwnerFabCommunityClicked() {
collapseOwnerFab(animate = false)
communityWriteLauncher.launch(Intent(this, CreatorCommunityWriteActivity::class.java))
@@ -34,6 +34,9 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
}
override fun onDestroyView() {
if (isAdded) {
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(false)
}
lastContentLayoutKey = null
binding.rvCreatorChannelDonation.adapter = null
super.onDestroyView()
@@ -57,6 +60,12 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
binding.root.minimumHeight = minHeight
}
fun onCreatorChannelDonationFloatingButtonClicked() {
host.onCreatorChannelDonationRequested { can, isSecret, message ->
viewModel.postChannelDonation(can, isSecret, message)
}
}
private fun setupDonationList() = with(binding.rvCreatorChannelDonation) {
layoutManager = LinearLayoutManager(requireContext())
adapter = donationAdapter
@@ -66,11 +75,6 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
btnCreatorChannelDonationRetry.setOnClickListener {
viewModel.retryDonations()
}
btnCreatorChannelDonationWrite.setOnClickListener {
host.onCreatorChannelDonationRequested { can, isSecret, message ->
viewModel.postChannelDonation(can, isSecret, message)
}
}
btnCreatorChannelDonationEmptyWrite.setOnClickListener {
host.onCreatorChannelDonationRequested { can, isSecret, message ->
viewModel.postChannelDonation(can, isSecret, message)
@@ -99,7 +103,7 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
btnCreatorChannelDonationEmptyWrite.isVisible = false
tvCreatorChannelDonationErrorMessage.isVisible = false
btnCreatorChannelDonationRetry.isVisible = false
btnCreatorChannelDonationWrite.isVisible = false
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(false)
}
private fun bindEmpty(state: CreatorChannelDonationUiState.Empty) = with(binding) {
@@ -117,7 +121,7 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
)
tvCreatorChannelDonationErrorMessage.isVisible = false
btnCreatorChannelDonationRetry.isVisible = false
btnCreatorChannelDonationWrite.isVisible = false
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(false)
host.onCreatorChannelDonationContentChanged()
}
@@ -130,7 +134,7 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
tvCreatorChannelDonationErrorMessage.isVisible = true
tvCreatorChannelDonationErrorMessage.text = state.message ?: getString(R.string.creator_channel_donation_error_message)
btnCreatorChannelDonationRetry.isVisible = true
btnCreatorChannelDonationWrite.isVisible = false
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(false)
host.onCreatorChannelDonationContentChanged()
}
@@ -143,7 +147,7 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
btnCreatorChannelDonationEmptyWrite.isVisible = false
tvCreatorChannelDonationErrorMessage.isVisible = false
btnCreatorChannelDonationRetry.isVisible = false
btnCreatorChannelDonationWrite.isVisible = !state.isOwner
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(!state.isOwner)
notifyContentChangedIfLayoutChanged(state)
state.paginationErrorMessage?.let {
Toast.makeText(requireContext(), it, Toast.LENGTH_SHORT).show()
@@ -179,6 +183,7 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
interface Host {
fun isCreatorChannelOwner(): Boolean
fun onCreatorChannelDonationContentChanged()
fun onCreatorChannelDonationFloatingButtonVisibilityChanged(isVisible: Boolean)
fun onCreatorChannelDonationRequested(onSubmit: (can: Int, isSecret: Boolean, message: String) -> Unit)
fun onCreatorChannelDonationRankingAllClicked()
fun onCreatorChannelDonationCompleted()