From 2643b0af4db3aa01868f3cd16a6ffd0ef25888fd Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 3 Jan 2019 10:47:58 -0600 Subject: [PATCH] When the send button is disabled in SendTransactionFragment the background view is also 'disabled' changing its color to a lighter gray. --- .../fragments/SendTransactionFragment.kt | 7 +++++-- app/src/main/res/drawable/send_fab_background_disabled.xml | 7 +++++++ app/src/main/res/layout/fragment_send_transaction.xml | 2 +- app/src/main/res/values/colors.xml | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/drawable/send_fab_background_disabled.xml diff --git a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt index e453c46..46a42cc 100644 --- a/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt +++ b/app/src/main/java/cy/agorise/bitsybitshareswallet/fragments/SendTransactionFragment.kt @@ -400,10 +400,13 @@ class SendTransactionFragment : Fragment(), ZXingScannerView.ResultHandler, Serv } private fun enableDisableSendFAB() { - if (isToAccountCorrect && isAmountCorrect) + if (isToAccountCorrect && isAmountCorrect) { fabSendTransaction.enable(R.color.colorSend) - else + vSend.setBackgroundResource(R.drawable.send_fab_background) + } else { fabSendTransaction.disable(R.color.lightGray) + vSend.setBackgroundResource(R.drawable.send_fab_background_disabled) + } } private fun startSendTransferOperation() { diff --git a/app/src/main/res/drawable/send_fab_background_disabled.xml b/app/src/main/res/drawable/send_fab_background_disabled.xml new file mode 100644 index 0000000..a4b4821 --- /dev/null +++ b/app/src/main/res/drawable/send_fab_background_disabled.xml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_send_transaction.xml b/app/src/main/res/layout/fragment_send_transaction.xml index de4a86c..fcab76b 100644 --- a/app/src/main/res/layout/fragment_send_transaction.xml +++ b/app/src/main/res/layout/fragment_send_transaction.xml @@ -172,7 +172,7 @@ android:layout_width="120dp" android:layout_height="120dp" android:layout_marginEnd="0dp" - android:background="@drawable/send_fab_background" + android:background="@drawable/send_fab_background_disabled" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="@id/viewCamera" app:layout_constraintBottom_toBottomOf="@id/viewCamera"/> diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index 69942f8..cb1f062 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -11,7 +11,7 @@ #888 #139657 #aaa - #e0e0e0 + #d0d0d0 #616161 #669900 #DC473A