Updated on 2026-08-14

This commit is contained in:
Tangem 2020-09-02 22:16:51 +03:00
parent 14f4b46e19
commit 44f6871822
7 changed files with 19 additions and 18 deletions

View file

@ -10,5 +10,5 @@ interface SendAction : Action
sealed class FeeLayout : SendAction {
object ToggleFeeLayoutVisibility : FeeLayout()
data class ChangeSelectedFee(val id: Int) : FeeLayout()
class ChangeLoremState(val isChecked: Boolean) : FeeLayout()
class ChangeIncludeFee(val isChecked: Boolean) : FeeLayout()
}

View file

@ -31,8 +31,8 @@ class SendReducer {
val result = state.copy(selectedFeeId = action.id)
updateLastState(sendState.copy(feeLayoutState = result), result)
}
is FeeLayout.ChangeLoremState -> {
val result = state.copy(swLoremIsChecked = action.isChecked)
is FeeLayout.ChangeIncludeFee -> {
val result = state.copy(includeFeeIsChecked = action.isChecked)
updateLastState(sendState.copy(feeLayoutState = result), result)
}
}

View file

@ -17,5 +17,5 @@ class NoneState : StateType
data class FeeLayoutState(
val visibility: Int = View.GONE,
val selectedFeeId: Int = R.id.chipNormal,
val swLoremIsChecked: Boolean = false
val includeFeeIsChecked: Boolean = false
) : StateType

View file

@ -27,8 +27,8 @@ class SendFragment : BaseStoreFragment(R.layout.fragment_send) {
chipGroup.setOnCheckedChangeListener { group, checkedId ->
store.dispatch(FeeLayout.ChangeSelectedFee(checkedId))
}
swLorem.setOnCheckedChangeListener { btn, isChecked ->
store.dispatch(FeeLayout.ChangeLoremState(isChecked))
swIncludeFee.setOnCheckedChangeListener { btn, isChecked ->
store.dispatch(FeeLayout.ChangeIncludeFee(isChecked))
}
}

View file

@ -30,8 +30,8 @@ class SendStateSubscriber(fragment: Fragment) : FragmentStateSubscriber<SendStat
fg.llFeeContainer.visibility = layoutState.visibility
}
if (fg.swLorem.isChecked != layoutState.swLoremIsChecked) {
fg.swLorem.isChecked = layoutState.swLoremIsChecked
if (fg.swIncludeFee.isChecked != layoutState.includeFeeIsChecked) {
fg.swIncludeFee.isChecked = layoutState.includeFeeIsChecked
}
if (fg.chipGroup.checkedChipId != layoutState.selectedFeeId) {

View file

@ -11,7 +11,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:text="@string/send_network_fee"
android:text="@string/send_fee"
android:textSize="13sp"
app:layout_constraintBottom_toBottomOf="@+id/flExpandCollapse"
app:layout_constraintStart_toStartOf="parent"
@ -51,31 +51,31 @@
style="@style/ChipNetworkFee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_network_chip_fee_low" />
android:text="@string/send_fee_low" />
<com.google.android.material.chip.Chip
android:id="@+id/chipNormal"
style="@style/ChipNetworkFee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_network_chip_fee_normal" />
android:text="@string/send_fee_normal" />
<com.google.android.material.chip.Chip
android:id="@+id/chipPriority"
style="@style/ChipNetworkFee"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/send_network_chip_fee_priority" />
android:text="@string/send_fee_priority" />
</com.google.android.material.chip.ChipGroup>
<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/swLorem"
android:id="@+id/swIncludeFee"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
android:layout_marginEnd="8dp"
android:text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. At tristique ornare auctor in." />
android:text="" />
</LinearLayout>

View file

@ -33,10 +33,11 @@
<string name="send_title">Send</string>
<string name="send_address_or_payid">Address or PayID</string>
<string name="send_network_fee">Network fee</string>
<string name="send_network_chip_fee_low">Low</string>
<string name="send_network_chip_fee_normal">Normal</string>
<string name="send_network_chip_fee_priority">Priority</string>
<string name="send_fee">Network fee</string>
<string name="send_fee_include">Include fee</string>
<string name="send_fee_low">Low</string>
<string name="send_fee_normal">Normal</string>
<string name="send_fee_priority">Priority</string>
<string name="send_btn_send">Send</string>
<string name="send_total">Total</string>
<string name="send_total_amount">Amount</string>