diff options
author | Torsten Grote <t@grobox.de> | 2020-04-13 15:07:49 -0300 |
---|---|---|
committer | Torsten Grote <t@grobox.de> | 2020-04-13 15:07:49 -0300 |
commit | 42079c0915194351bc417e2396712a11400049b3 (patch) | |
tree | 5d7bac203c0ada39586cde6395c5cda0b22ab55e /wallet/src/main/java | |
parent | 02a4a056fd8255ac8e3147822f842ed8c49a1674 (diff) | |
download | taler-android-42079c0915194351bc417e2396712a11400049b3.tar.gz taler-android-42079c0915194351bc417e2396712a11400049b3.tar.bz2 taler-android-42079c0915194351bc417e2396712a11400049b3.zip |
[wallet] hide overhead from exchange fee structure if zero
Diffstat (limited to 'wallet/src/main/java')
-rw-r--r-- | wallet/src/main/java/net/taler/wallet/withdraw/SelectExchangeFragment.kt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/wallet/src/main/java/net/taler/wallet/withdraw/SelectExchangeFragment.kt b/wallet/src/main/java/net/taler/wallet/withdraw/SelectExchangeFragment.kt index 78eba53..1e7ee3a 100644 --- a/wallet/src/main/java/net/taler/wallet/withdraw/SelectExchangeFragment.kt +++ b/wallet/src/main/java/net/taler/wallet/withdraw/SelectExchangeFragment.kt @@ -19,6 +19,7 @@ package net.taler.wallet.withdraw import android.os.Bundle import android.view.LayoutInflater import android.view.View +import android.view.View.GONE import android.view.ViewGroup import android.widget.TextView import androidx.core.content.ContextCompat.getColor @@ -49,8 +50,14 @@ class SelectExchangeFragment : Fragment() { override fun onViewCreated(view: View, savedInstanceState: Bundle?) { val fees = withdrawManager.exchangeFees ?: throw IllegalStateException() - withdrawFeeView.setAmount(fees.withdrawFee) - overheadView.setAmount(fees.overhead) + if (fees.withdrawFee.isZero()) { + withdrawFeeLabel.visibility = GONE + withdrawFeeView.visibility = GONE + } else withdrawFeeView.setAmount(fees.withdrawFee) + if (fees.overhead.isZero()) { + overheadLabel.visibility = GONE + overheadView.visibility = GONE + } else overheadView.setAmount(fees.overhead) expirationView.text = fees.earliestDepositExpiration.ms.toRelativeTime(requireContext()) coinFeesList.adapter = CoinFeeAdapter(fees.coinFees) wireFeesList.adapter = WireFeeAdapter(fees.wireFees) |