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:
parent
cf4b1f038d
commit
85b1015e9f
3 changed files with 58 additions and 0 deletions
|
@ -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()) {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -186,6 +186,21 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
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
|
||||
android:id="@+id/ivCamera"
|
||||
android:layout_width="180dp"
|
||||
|
|
Loading…
Reference in a new issue