feat(creator): 후원 empty 표시 위치를 보정한다
This commit is contained in:
@@ -18,7 +18,12 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
|
||||
|
||||
private val viewModel: CreatorChannelDonationViewModel by viewModel()
|
||||
private val donationAdapter = CreatorChannelDonationAdapter(
|
||||
onRankingAllClick = { host.onCreatorChannelDonationRankingAllClicked() }
|
||||
onRankingAllClick = { host.onCreatorChannelDonationRankingAllClicked() },
|
||||
onEmptyDonationClick = {
|
||||
host.onCreatorChannelDonationRequested { can, isSecret, message ->
|
||||
viewModel.postChannelDonation(can, isSecret, message)
|
||||
}
|
||||
}
|
||||
)
|
||||
private var lastContentLayoutKey: CreatorChannelDonationContentLayoutKey? = null
|
||||
private val creatorId: Long by lazy { arguments?.getLong(ARG_CREATOR_ID) ?: 0L }
|
||||
@@ -56,9 +61,7 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
|
||||
viewModel.refreshDonations()
|
||||
}
|
||||
|
||||
fun onCreatorChannelDonationViewportHeightChanged(minHeight: Int) {
|
||||
binding.root.minimumHeight = minHeight
|
||||
}
|
||||
fun onCreatorChannelDonationViewportHeightChanged(minHeight: Int) = Unit
|
||||
|
||||
fun onCreatorChannelDonationFloatingButtonClicked() {
|
||||
host.onCreatorChannelDonationRequested { can, isSecret, message ->
|
||||
@@ -75,11 +78,6 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
|
||||
btnCreatorChannelDonationRetry.setOnClickListener {
|
||||
viewModel.retryDonations()
|
||||
}
|
||||
btnCreatorChannelDonationEmptyWrite.setOnClickListener {
|
||||
host.onCreatorChannelDonationRequested { can, isSecret, message ->
|
||||
viewModel.postChannelDonation(can, isSecret, message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun observeViewModel() {
|
||||
@@ -99,8 +97,6 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
|
||||
lastContentLayoutKey = null
|
||||
layoutCreatorChannelDonationCountBar.isVisible = false
|
||||
rvCreatorChannelDonation.isVisible = false
|
||||
layoutCreatorChannelDonationEmpty.isVisible = false
|
||||
btnCreatorChannelDonationEmptyWrite.isVisible = false
|
||||
tvCreatorChannelDonationErrorMessage.isVisible = false
|
||||
btnCreatorChannelDonationRetry.isVisible = false
|
||||
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(false)
|
||||
@@ -109,16 +105,8 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
|
||||
private fun bindEmpty(state: CreatorChannelDonationUiState.Empty) = with(binding) {
|
||||
lastContentLayoutKey = null
|
||||
layoutCreatorChannelDonationCountBar.isVisible = false
|
||||
rvCreatorChannelDonation.isVisible = false
|
||||
layoutCreatorChannelDonationEmpty.isVisible = true
|
||||
btnCreatorChannelDonationEmptyWrite.isVisible = !state.isOwner
|
||||
tvCreatorChannelDonationEmptyMessage.setText(
|
||||
if (state.isOwner) {
|
||||
R.string.creator_channel_donation_empty_owner_title
|
||||
} else {
|
||||
R.string.creator_channel_donation_empty_title
|
||||
}
|
||||
)
|
||||
rvCreatorChannelDonation.isVisible = true
|
||||
donationAdapter.submitEmpty(state.rankings, state.isOwner)
|
||||
tvCreatorChannelDonationErrorMessage.isVisible = false
|
||||
btnCreatorChannelDonationRetry.isVisible = false
|
||||
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(false)
|
||||
@@ -129,8 +117,6 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
|
||||
lastContentLayoutKey = null
|
||||
layoutCreatorChannelDonationCountBar.isVisible = false
|
||||
rvCreatorChannelDonation.isVisible = false
|
||||
layoutCreatorChannelDonationEmpty.isVisible = false
|
||||
btnCreatorChannelDonationEmptyWrite.isVisible = false
|
||||
tvCreatorChannelDonationErrorMessage.isVisible = true
|
||||
tvCreatorChannelDonationErrorMessage.text = state.message ?: getString(R.string.creator_channel_donation_error_message)
|
||||
btnCreatorChannelDonationRetry.isVisible = true
|
||||
@@ -143,8 +129,6 @@ class CreatorChannelDonationFragment : BaseFragment<FragmentCreatorChannelDonati
|
||||
tvCreatorChannelDonationTotalCount.text = state.donationCount.moneyFormat()
|
||||
rvCreatorChannelDonation.isVisible = true
|
||||
donationAdapter.submitItems(state.rankings, state.donations)
|
||||
layoutCreatorChannelDonationEmpty.isVisible = false
|
||||
btnCreatorChannelDonationEmptyWrite.isVisible = false
|
||||
tvCreatorChannelDonationErrorMessage.isVisible = false
|
||||
btnCreatorChannelDonationRetry.isVisible = false
|
||||
host.onCreatorChannelDonationFloatingButtonVisibilityChanged(!state.isOwner)
|
||||
|
||||
@@ -50,63 +50,6 @@
|
||||
tools:itemCount="3"
|
||||
tools:listitem="@layout/item_creator_channel_donation" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_creator_channel_donation_empty"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:paddingHorizontal="@dimen/spacing_14"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:visibility="visible">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_creator_channel_donation_empty_message"
|
||||
style="@style/Typography.Body3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:includeFontPadding="false"
|
||||
android:lineSpacingMultiplier="1.45"
|
||||
android:text="@string/creator_channel_donation_empty_title"
|
||||
android:textColor="@color/gray_500" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_creator_channel_donation_empty_write"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="@dimen/spacing_14"
|
||||
android:background="@drawable/bg_creator_channel_donation_empty_button"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/spacing_12"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_creator_channel_donation_empty_write"
|
||||
android:layout_width="@dimen/spacing_20"
|
||||
android:layout_height="@dimen/spacing_20"
|
||||
android:contentDescription="@null"
|
||||
android:src="@drawable/ic_new_donation"
|
||||
app:tint="@color/white" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_creator_channel_donation_empty_write"
|
||||
style="@style/Typography.Body2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="@dimen/spacing_6"
|
||||
android:gravity="center"
|
||||
android:text="@string/creator_channel_donation_action"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_creator_channel_donation_error_message"
|
||||
style="@style/Typography.Body3"
|
||||
|
||||
Reference in New Issue
Block a user