From f5d7d2af45e7a18c2a600e3713335aa77ae0ce71 Mon Sep 17 00:00:00 2001 From: Tangem Date: Tue, 22 Aug 2023 19:07:12 +0300 Subject: [PATCH] Updated on 2026-08-14 --- .../stateSubscribers/SendStateSubscriber.kt | 37 +++++++++++++------ 1 file changed, 26 insertions(+), 11 deletions(-) diff --git a/app/src/main/java/com/tangem/tap/features/send/ui/stateSubscribers/SendStateSubscriber.kt b/app/src/main/java/com/tangem/tap/features/send/ui/stateSubscribers/SendStateSubscriber.kt index 7c12e82496..6de86eba68 100644 --- a/app/src/main/java/com/tangem/tap/features/send/ui/stateSubscribers/SendStateSubscriber.kt +++ b/app/src/main/java/com/tangem/tap/features/send/ui/stateSubscribers/SendStateSubscriber.kt @@ -261,19 +261,34 @@ class SendStateSubscriber(fragment: BaseStoreFragment) : FragmentStateSubscriber } @Suppress("MagicNumber") - private fun handleFeeState(fg: SendFragment, state: FeeState) = with(fg.binding.clNetworkFee) { - fg.view?.findViewById(R.id.clNetworkFee)?.show(state.mainLayoutIsVisible) - flExpandCollapse.imvExpandCollapse.rotation = if (state.controlsLayoutIsVisible) 0f else 180f - llFeeControlsContainer.show(state.controlsLayoutIsVisible) - chipGroup.show(state.feeChipGroupIsVisible) + private fun handleFeeState(fg: SendFragment, state: FeeState) { + with(fg.binding.clNetworkFee) { + fg.view?.findViewById(R.id.clNetworkFee)?.show(state.mainLayoutIsVisible) + flExpandCollapse.imvExpandCollapse.rotation = if (state.controlsLayoutIsVisible) 0f else 180f + llFeeControlsContainer.show(state.controlsLayoutIsVisible) + chipGroup.show(state.feeChipGroupIsVisible) - swIncludeFee.isEnabled = state.includeFeeSwitcherIsEnabled - if (swIncludeFee.isChecked != state.feeIsIncluded) { - swIncludeFee.isChecked = state.feeIsIncluded + swIncludeFee.isEnabled = state.includeFeeSwitcherIsEnabled + if (swIncludeFee.isChecked != state.feeIsIncluded) { + swIncludeFee.isChecked = state.feeIsIncluded + } + + val chipId = FeeUiHelper.toId(state.selectedFeeType) + if (chipGroup.checkedChipId != chipId && chipId != View.NO_ID) chipGroup.check(chipId) + } + with(fg.binding.clReceiptContainer) { + when (state.progressState) { + ProgressState.Loading -> { + tvReceiptFeeValue.hide() + pbReceiptFee.show() + } + ProgressState.Done -> { + pbReceiptFee.hide() + tvReceiptFeeValue.show() + } + else -> {} + } } - - val chipId = FeeUiHelper.toId(state.selectedFeeType) - if (chipGroup.checkedChipId != chipId && chipId != View.NO_ID) chipGroup.check(chipId) } @Suppress("LongMethod", "ComplexMethod")