From 85b1015e9fe7d44660777da82916160d39ab4450 Mon Sep 17 00:00:00 2001 From: dtvv Date: Sat, 6 Oct 2018 23:54:53 -0500 Subject: [PATCH] In the screen of send assets, when you Press the cross button to stop the camera for the qr actually that button does not work, but now it does, stop the camera and clear the animation --- .../activities/SendTransactionActivity.java | 13 ++++++++ .../fragments/SendTransactionFragment.java | 30 +++++++++++++++++++ app/src/main/res/layout/send_transaction.xml | 15 ++++++++++ 3 files changed, 58 insertions(+) diff --git a/app/src/main/java/cy/agorise/crystalwallet/activities/SendTransactionActivity.java b/app/src/main/java/cy/agorise/crystalwallet/activities/SendTransactionActivity.java index f34db62..adfa17c 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/activities/SendTransactionActivity.java +++ b/app/src/main/java/cy/agorise/crystalwallet/activities/SendTransactionActivity.java @@ -4,6 +4,7 @@ import android.arch.lifecycle.LiveData; import android.arch.lifecycle.Observer; import android.os.Bundle; import android.support.annotation.Nullable; +import android.support.design.widget.FloatingActionButton; import android.support.v7.app.AppCompatActivity; import android.text.Editable; import android.widget.Button; @@ -62,6 +63,9 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali //@BindView(R.id.btnCancel) Button btnCancel; + @BindView(R.id.fabCloseCamera) + FloatingActionButton btnCloseCamera; + private long cryptoNetAccountId; private CryptoNetAccount cryptoNetAccount; private GrapheneAccount grapheneAccount; @@ -146,6 +150,15 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali this.finish(); } + + + @OnClick(R.id.fabCloseCamera) + public void onClicCloseCamera(){ + + + } + + //@OnClick(R.id.btnSend) public void importSend(){ if (this.sendTransactionValidator.isValid()) { diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java index 14bc512..ccad716 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java @@ -124,6 +124,9 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat @BindView(R.id.gravatar) CircularImageView userImg; + @BindView(R.id.viewCamera) + View viewCamera; + Button btnScanQrCode; private long cryptoNetAccountId; @@ -356,6 +359,33 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat } + @OnClick(R.id.fabCloseCamera) + public void onClicCloseCamera(){ + mScannerView.stopCamera(); + + /* + * Hide the camera + * */ + hideCamera(); + } + + /* + * Show the camera and hide the black background + * */ + private void showCamera(){ + viewCamera.setVisibility(View.GONE); + mScannerView.setVisibility(View.VISIBLE); + } + + + /* + * Hide the camera and show the black background + * */ + private void hideCamera(){ + viewCamera.setVisibility(View.VISIBLE); + mScannerView.setVisibility(View.INVISIBLE); + } + @OnTextChanged(value = R.id.etMemo, callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED) void afterMemoChanged(Editable editable) { diff --git a/app/src/main/res/layout/send_transaction.xml b/app/src/main/res/layout/send_transaction.xml index 584e511..6223254 100644 --- a/app/src/main/res/layout/send_transaction.xml +++ b/app/src/main/res/layout/send_transaction.xml @@ -186,6 +186,21 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/tvMemoError" /> + + + +