Updated on 2026-08-14
This commit is contained in:
commit
0e11882385
3 changed files with 8 additions and 14 deletions
|
|
@ -12,12 +12,10 @@ internal class WalletDetailsButtonsRow @JvmOverloads constructor(
|
|||
attrs: AttributeSet? = null,
|
||||
defStyleAttr: Int = 0,
|
||||
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||
|
||||
private val binding = ViewWalletDetailsButtonsRowBinding.inflate(
|
||||
LayoutInflater.from(context),
|
||||
this,
|
||||
)
|
||||
|
||||
var onBuyClick: (() -> Unit)? = null
|
||||
var onSellClick: (() -> Unit)? = null
|
||||
var onTradeClick: (() -> Unit)? = null
|
||||
|
|
@ -40,16 +38,12 @@ internal class WalletDetailsButtonsRow @JvmOverloads constructor(
|
|||
sellAllowed: Boolean,
|
||||
sendAllowed: Boolean,
|
||||
) = with(binding) {
|
||||
if (exchangeServiceFeatureOn) {
|
||||
btnBuy.isVisible = (buyAllowed && !sellAllowed) || (!buyAllowed && !sellAllowed)
|
||||
btnBuy.isEnabled = buyAllowed
|
||||
btnSell.isVisible = !buyAllowed && sellAllowed
|
||||
btnTrade.isVisible = buyAllowed && sellAllowed
|
||||
} else {
|
||||
btnBuy.isVisible = false
|
||||
btnSell.isVisible = false
|
||||
btnTrade.isVisible = false
|
||||
}
|
||||
containerExchangeButtons.isVisible = exchangeServiceFeatureOn
|
||||
|
||||
btnBuy.isVisible = (buyAllowed && !sellAllowed) || (!buyAllowed && !sellAllowed)
|
||||
btnBuy.isEnabled = buyAllowed
|
||||
btnSell.isVisible = !buyAllowed && sellAllowed
|
||||
btnTrade.isVisible = buyAllowed && sellAllowed
|
||||
btnSend.isEnabled = sendAllowed
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,7 @@
|
|||
tools:parentTag="android.widget.LinearLayout">
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/container_exchange_buttons"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="6dp"
|
||||
|
|
@ -48,7 +49,6 @@
|
|||
android:id="@+id/btn_send"
|
||||
style="@style/TapButtonWithIcon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/wallet_button_send"
|
||||
app:icon="@drawable/ic_send" />
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ ext.versions = [
|
|||
kotlin : '1.6.10',
|
||||
build_gradle : '7.1.3',
|
||||
tangem_card_sdk : 'develop-159',
|
||||
tangem_blockchain_sdk: 'develop-104',
|
||||
tangem_blockchain_sdk: 'develop-105',
|
||||
// tangem_blockchain_sdk: '0.0.1',
|
||||
]
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue