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

This commit is contained in:
dtvv 2018-10-06 23:54:53 -05:00
parent cf4b1f038d
commit 85b1015e9f
3 changed files with 58 additions and 0 deletions

View file

@ -4,6 +4,7 @@ import android.arch.lifecycle.LiveData;
import android.arch.lifecycle.Observer; import android.arch.lifecycle.Observer;
import android.os.Bundle; import android.os.Bundle;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.app.AppCompatActivity; import android.support.v7.app.AppCompatActivity;
import android.text.Editable; import android.text.Editable;
import android.widget.Button; import android.widget.Button;
@ -62,6 +63,9 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali
//@BindView(R.id.btnCancel) //@BindView(R.id.btnCancel)
Button btnCancel; Button btnCancel;
@BindView(R.id.fabCloseCamera)
FloatingActionButton btnCloseCamera;
private long cryptoNetAccountId; private long cryptoNetAccountId;
private CryptoNetAccount cryptoNetAccount; private CryptoNetAccount cryptoNetAccount;
private GrapheneAccount grapheneAccount; private GrapheneAccount grapheneAccount;
@ -146,6 +150,15 @@ public class SendTransactionActivity extends AppCompatActivity implements UIVali
this.finish(); this.finish();
} }
@OnClick(R.id.fabCloseCamera)
public void onClicCloseCamera(){
}
//@OnClick(R.id.btnSend) //@OnClick(R.id.btnSend)
public void importSend(){ public void importSend(){
if (this.sendTransactionValidator.isValid()) { if (this.sendTransactionValidator.isValid()) {

View file

@ -124,6 +124,9 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat
@BindView(R.id.gravatar) @BindView(R.id.gravatar)
CircularImageView userImg; CircularImageView userImg;
@BindView(R.id.viewCamera)
View viewCamera;
Button btnScanQrCode; Button btnScanQrCode;
private long cryptoNetAccountId; 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, @OnTextChanged(value = R.id.etMemo,
callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED) callback = OnTextChanged.Callback.AFTER_TEXT_CHANGED)
void afterMemoChanged(Editable editable) { void afterMemoChanged(Editable editable) {

View file

@ -186,6 +186,21 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvMemoError" /> app:layout_constraintTop_toBottomOf="@id/tvMemoError" />
<View
android:id="@+id/viewCamera"
android:background="@color/black"
android:layout_width="180dp"
android:layout_height="180dp"
android:layout_marginBottom="24dp"
android:layout_marginStart="24dp"
android:layout_marginTop="8dp"
android:visibility="gone"
android:src="#666"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvScan">
</View>
<me.dm7.barcodescanner.zxing.ZXingScannerView <me.dm7.barcodescanner.zxing.ZXingScannerView
android:id="@+id/ivCamera" android:id="@+id/ivCamera"
android:layout_width="180dp" android:layout_width="180dp"