Memo Hide for T address transaction
Memo and reply-to hide during T address transaction
This commit is contained in:
parent
93a6d7c7a2
commit
484fecc0f0
|
@ -140,8 +140,14 @@ class SendFragment : BaseFragment<FragmentSendBinding>(),
|
|||
val validation = sendViewModel.validateAddress(address)
|
||||
binding.buttonSend.isActivated = !validation.isNotValid
|
||||
var type = when (validation) {
|
||||
is AddressType.Transparent -> R.string.send_validation_address_valid_taddr to R.color.zcashGreen
|
||||
is AddressType.Shielded -> R.string.send_validation_address_valid_zaddr to R.color.zcashGreen
|
||||
is AddressType.Transparent -> {
|
||||
updateAddressUI(isTAddress = true)
|
||||
R.string.send_validation_address_valid_taddr to R.color.zcashGreen
|
||||
}
|
||||
is AddressType.Shielded -> {
|
||||
updateAddressUI(isTAddress = false)
|
||||
R.string.send_validation_address_valid_zaddr to R.color.zcashGreen
|
||||
}
|
||||
is AddressType.Invalid -> R.string.send_validation_address_invalid to R.color.zcashRed
|
||||
}
|
||||
if (address == sendViewModel.synchronizer.getAddress()) type =
|
||||
|
@ -168,6 +174,21 @@ class SendFragment : BaseFragment<FragmentSendBinding>(),
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* To hide input Memo and reply-to option for T type address and show a info message about memo option availability
|
||||
* */
|
||||
private fun updateAddressUI(isTAddress: Boolean) {
|
||||
if (isTAddress) {
|
||||
binding.textLayoutMemo.gone()
|
||||
binding.checkIncludeAddress.gone()
|
||||
binding.textNoZAddress.visible()
|
||||
} else {
|
||||
binding.textLayoutMemo.visible()
|
||||
binding.checkIncludeAddress.visible()
|
||||
binding.textNoZAddress.gone()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private fun onSubmit(unused: EditText? = null) {
|
||||
sendViewModel.toAddress = binding.inputZcashAddress.text.toString()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
|
@ -50,10 +49,10 @@
|
|||
android:gravity="bottom|center_horizontal"
|
||||
android:includeFontPadding="false"
|
||||
android:maxLines="1"
|
||||
android:paddingBottom="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingStart="16dp"
|
||||
android:paddingTop="0dp"
|
||||
android:paddingEnd="16dp"
|
||||
android:paddingBottom="0dp"
|
||||
android:textAppearance="@style/Zcash.TextAppearance.Zec"
|
||||
android:textSize="200sp"
|
||||
app:autoSizeMaxTextSize="40sp"
|
||||
|
@ -134,8 +133,8 @@
|
|||
android:layout_height="38dp"
|
||||
android:backgroundTint="@color/selector_primary_button_activatable"
|
||||
android:maxLines="1"
|
||||
android:paddingEnd="2dp"
|
||||
android:paddingStart="2dp"
|
||||
android:paddingEnd="2dp"
|
||||
android:text="@string/send_button_primary"
|
||||
android:textColor="@color/text_dark"
|
||||
app:autoSizeMinTextSize="6sp"
|
||||
|
@ -154,8 +153,8 @@
|
|||
android:fontFamily="@font/inconsolata"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:paddingEnd="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingEnd="8dp"
|
||||
android:textColor="@color/zcashRed"
|
||||
android:textSize="14sp"
|
||||
app:autoSizeMaxTextSize="12sp"
|
||||
|
@ -187,7 +186,7 @@
|
|||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHeight_percent="0.04"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/check_include_address" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/text_no_z_address" />
|
||||
|
||||
<!-- Input: Address -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
|
@ -286,6 +285,27 @@
|
|||
app:layout_constraintEnd_toEndOf="@id/text_layout_memo"
|
||||
app:layout_constraintTop_toBottomOf="@id/space_checkbox" />
|
||||
|
||||
<androidx.constraintlayout.widget.Barrier
|
||||
android:id="@+id/barrier_address_layout_check_include"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
app:barrierDirection="bottom"
|
||||
app:constraint_referenced_ids="text_layout_address, check_include_address" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_no_z_address"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="4dp"
|
||||
android:text="@string/send_no_z_address_message"
|
||||
android:textAppearance="@style/TextAppearance.MaterialComponents.Caption"
|
||||
android:textColor="@color/text_light"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/barrier_address_layout_check_include"
|
||||
app:layout_constraintWidth_percent="0.84" />
|
||||
|
||||
|
||||
<!-- -->
|
||||
<!-- Clipboard items -->
|
||||
|
@ -318,8 +338,8 @@
|
|||
android:id="@+id/container_clipboard"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@id/divider_clipboard">
|
||||
|
@ -480,10 +500,10 @@
|
|||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:contentDescription="@string/content_description_send_scan_qr"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:paddingStart="6dp"
|
||||
android:paddingTop="10dp"
|
||||
android:paddingEnd="1dp"
|
||||
android:paddingBottom="24dp"
|
||||
android:tint="@color/zcashWhite"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="@id/text_layout_address"
|
||||
|
|
|
@ -133,6 +133,7 @@
|
|||
<string name="send_validation_error_no_available_funds" tools:ignore="MissingTranslation">@string/translated_balance_nofunds</string>
|
||||
<string name="send_validation_error_too_much">Please go back and enter no more than %1$s ZEC.</string>
|
||||
<string name="send_validation_error_unknown_funds">Available funds not found. Please try again in a moment.</string>
|
||||
<string name="send_no_z_address_message">To add a memo, enter a shielded address.</string>
|
||||
|
||||
<!-- Screen: Settings-->
|
||||
<string name="settings_buttons_restore">Restore Defaults</string>
|
||||
|
|
Loading…
Reference in New Issue