0.5.1: Accessibility fixes for sending transactions

This commit is contained in:
pokkst 2023-12-06 20:19:27 -06:00
parent 36ab440bf5
commit c407b4f69d
No known key found for this signature in database
GPG key ID: EC4FAAA66859FAA4
4 changed files with 20 additions and 6 deletions

View file

@ -10,8 +10,8 @@ android {
applicationId "net.mynero.wallet" applicationId "net.mynero.wallet"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 34 targetSdkVersion 34
versionCode 50000 versionCode 50100
versionName "0.5.0 'Fluorine Fermi'" versionName "0.5.1 'Fluorine Fermi'"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
externalNativeBuild { externalNativeBuild {
cmake { cmake {

View file

@ -16,6 +16,7 @@ import android.widget.TextView
import android.widget.Toast import android.widget.Toast
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.constraintlayout.widget.ConstraintLayout import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.view.ViewCompat
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import com.google.zxing.client.android.Intents import com.google.zxing.client.android.Intents
@ -142,12 +143,23 @@ class SendFragment : Fragment() {
sendTxSlider?.onSlideCompleteListener = sendTxSlider?.onSlideCompleteListener =
object : OnSlideCompleteListener { object : OnSlideCompleteListener {
override fun onSlideComplete(view: SlideToActView) { override fun onSlideComplete(view: SlideToActView) {
val pendingTx = mViewModel?.pendingTransaction?.value ?: return confirmSlider()
Toast.makeText(activity, getString(R.string.sending_tx), Toast.LENGTH_SHORT)
.show()
sendTx(pendingTx)
} }
} }
sendTxSlider?.let { slideToActView ->
ViewCompat.addAccessibilityAction(slideToActView, getString(R.string.approve_the_transaction)) { _, _ ->
confirmSlider()
return@addAccessibilityAction true
}
}
}
private fun confirmSlider() {
val pendingTx = mViewModel?.pendingTransaction?.value ?: return
Toast.makeText(activity, getString(R.string.sending_tx), Toast.LENGTH_SHORT)
.show()
sendTx(pendingTx)
} }
private fun checkDestsValidity(sendAll: Boolean): Boolean { private fun checkDestsValidity(sendAll: Boolean): Boolean {

View file

@ -213,6 +213,7 @@
android:layout_marginBottom="24dp" android:layout_marginBottom="24dp"
android:elevation="6dp" android:elevation="6dp"
android:visibility="gone" android:visibility="gone"
android:importantForAccessibility="yes"
app:area_margin="10dp" app:area_margin="10dp"
app:border_radius="20dp" app:border_radius="20dp"
app:inner_color="@android:color/white" app:inner_color="@android:color/white"

View file

@ -155,5 +155,6 @@
<string name="copy_transaction_addr">Copy transaction address</string> <string name="copy_transaction_addr">Copy transaction address</string>
<string name="seed_desc_polyseed">16 words instead of 25; just as secure, but not supported in as many wallets right now. In Mysu, seed passphrase is enforced for these wallets.</string> <string name="seed_desc_polyseed">16 words instead of 25; just as secure, but not supported in as many wallets right now. In Mysu, seed passphrase is enforced for these wallets.</string>
<string name="seed_desc_legacy">Older, 25 word seed; supported in all Monero wallets. In Mysu, seed passphrase is not enforced for these wallets.</string> <string name="seed_desc_legacy">Older, 25 word seed; supported in all Monero wallets. In Mysu, seed passphrase is not enforced for these wallets.</string>
<string name="approve_the_transaction">Send transaction</string>
</resources> </resources>