taler-android

Android apps for GNU Taler (wallet, PoS, cashier)
Log | Files | Refs | README | LICENSE

commit 42079c0915194351bc417e2396712a11400049b3
parent 02a4a056fd8255ac8e3147822f842ed8c49a1674
Author: Torsten Grote <t@grobox.de>
Date:   Mon, 13 Apr 2020 15:07:49 -0300

[wallet] hide overhead from exchange fee structure if zero

Diffstat:
Mwallet/src/main/java/net/taler/wallet/withdraw/SelectExchangeFragment.kt | 11+++++++++--
1 file 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 @@ -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)