Skip to content

Commit

Permalink
fix: remove checkbox on topup confirm
Browse files Browse the repository at this point in the history
  • Loading branch information
HashEngineering committed Jan 9, 2025
1 parent 3751a0d commit 12a58f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 33 deletions.
16 changes: 0 additions & 16 deletions wallet/res/layout/dialog_confirm_topup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,22 +100,6 @@

</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginVertical="8dp"
android:gravity="center_horizontal">
<CheckBox
android:id="@+id/user_accepts"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/request_username_confirm" />
</LinearLayout>

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2023 Dash Core Group.
* Copyright 2024 Dash Core Group.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand All @@ -26,6 +26,7 @@ import androidx.lifecycle.lifecycleScope
import dagger.hilt.android.AndroidEntryPoint
import de.schildbach.wallet.ui.send.SendCoinsViewModel
import de.schildbach.wallet_test.R
import de.schildbach.wallet_test.databinding.DialogConfirmTopupBinding
import de.schildbach.wallet_test.databinding.DialogConfirmUsernameRequestBinding
import kotlinx.coroutines.launch
import org.bitcoinj.core.Coin
Expand All @@ -36,30 +37,22 @@ import org.dash.wallet.common.util.observe

@AndroidEntryPoint
class ConfirmTopUpDialogFragment: OffsetDialogFragment(R.layout.dialog_confirm_topup) {
private val binding by viewBinding(DialogConfirmUsernameRequestBinding::bind)
private val binding by viewBinding(DialogConfirmTopupBinding::bind)

private val viewModel by viewModels<ConfirmTopupDialogViewModel>()
private val sendViewModel by activityViewModels<SendCoinsViewModel>()
private var onConfirmAction: ((Boolean) -> Unit)? = null

//private val requestUserNameViewModel by activityViewModels<RequestUserNameViewModel>()
//private val args by navArgs<ConfirmUsernameRequestDialogFragmentArgs>()
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
viewModel.amount = sendViewModel.currentAmount
binding.confirmBtn.setOnClickListener {
// requestUserNameViewModel.logEvent(AnalyticsConstants.UsersContacts.CREATE_USERNAME_CONFIRM)
//requestUserNameViewModel.submit()
// requestUserNameViewModel.logEvent(AnalyticsConstants.UsersContacts.TOPUP_CONFIRM)
lifecycleScope.launch {
onConfirmAction?.invoke(true)
dismiss()
}
}
binding.confirmBtn.isEnabled = false
binding.userAccepts.setOnClickListener {
binding.confirmBtn.isEnabled = binding.userAccepts.isChecked
}

binding.dismissBtn.setOnClickListener { dismiss() }

viewModel.uiState.observe(viewLifecycleOwner) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ import org.dash.wallet.common.util.GenericUtils
import javax.inject.Inject


data class ConfirmUserNameUIState(
data class ConfirmTopUpUIState(
val amountStr: String = "",
val fiatSymbol: String = "",
val fiatAmountStr: String = "",
val usernameSubmittedSuccess: Boolean = false,
val usernameSubmittedError: Boolean = false
val fiatAmountStr: String = ""
)

@HiltViewModel
Expand All @@ -53,8 +51,8 @@ class ConfirmTopupDialogViewModel @Inject constructor(
private val walletUIConfig: WalletUIConfig
) : ViewModel() {

private val _uiState = MutableStateFlow(ConfirmUserNameUIState())
val uiState: StateFlow<ConfirmUserNameUIState> = _uiState.asStateFlow()
private val _uiState = MutableStateFlow(ConfirmTopUpUIState())
val uiState: StateFlow<ConfirmTopUpUIState> = _uiState.asStateFlow()
val exchangeRate: ExchangeRate? = null
var amount: Coin = Coin.ZERO
set(value) {
Expand Down

0 comments on commit 12a58f5

Please sign in to comment.