From 42079c0915194351bc417e2396712a11400049b3 Mon Sep 17 00:00:00 2001 From: Torsten Grote Date: Mon, 13 Apr 2020 15:07:49 -0300 Subject: [wallet] hide overhead from exchange fee structure if zero --- .../java/net/taler/wallet/withdraw/SelectExchangeFragment.kt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'wallet') 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) -- cgit v1.2.3