use of com.samourai.wallet.fragments.CameraFragmentBottomSheet in project samourai-wallet-android by Samourai-Wallet.
the class SendActivity method doScan.
private void doScan() {
CameraFragmentBottomSheet cameraFragmentBottomSheet = new CameraFragmentBottomSheet();
cameraFragmentBottomSheet.show(getSupportFragmentManager(), cameraFragmentBottomSheet.getTag());
cameraFragmentBottomSheet.setQrCodeScanLisenter(code -> {
cameraFragmentBottomSheet.dismissAllowingStateLoss();
processScan(code);
});
}
use of com.samourai.wallet.fragments.CameraFragmentBottomSheet in project samourai-wallet-android by Samourai-Wallet.
the class BalanceActivity method doSweepViaScan.
private void doSweepViaScan() {
CameraFragmentBottomSheet cameraFragmentBottomSheet = new CameraFragmentBottomSheet();
cameraFragmentBottomSheet.show(getSupportFragmentManager(), cameraFragmentBottomSheet.getTag());
cameraFragmentBottomSheet.setQrCodeScanLisenter(code -> {
cameraFragmentBottomSheet.dismissAllowingStateLoss();
PrivKeyReader privKeyReader = new PrivKeyReader(new CharSequenceX(code.trim()));
try {
if (privKeyReader.getFormat() != null) {
doPrivKey(code.trim());
} else if (Cahoots.isCahoots(code.trim())) {
Intent cahootIntent = new Intent(this, ManualCahootsActivity.class);
cahootIntent.putExtra("payload", code.trim());
cahootIntent.putExtra("_account", account);
startActivity(cahootIntent);
} else if (FormatsUtil.getInstance().isPSBT(code.trim())) {
CahootsUtil.getInstance(BalanceActivity.this).doPSBT(code.trim());
} else if (DojoUtil.getInstance(BalanceActivity.this).isValidPairingPayload(code.trim())) {
Toast.makeText(BalanceActivity.this, "Samourai Dojo full node coming soon.", Toast.LENGTH_SHORT).show();
} else {
Intent intent = new Intent(BalanceActivity.this, SendActivity.class);
intent.putExtra("uri", code.trim());
intent.putExtra("_account", account);
startActivity(intent);
}
} catch (Exception e) {
}
});
}
use of com.samourai.wallet.fragments.CameraFragmentBottomSheet in project samourai-wallet-android by Samourai-Wallet.
the class NetworkDashboard method doScan.
private void doScan() {
CameraFragmentBottomSheet cameraFragmentBottomSheet = new CameraFragmentBottomSheet();
cameraFragmentBottomSheet.show(getSupportFragmentManager(), cameraFragmentBottomSheet.getTag());
cameraFragmentBottomSheet.setQrCodeScanLisenter(code -> {
cameraFragmentBottomSheet.dismissAllowingStateLoss();
try {
if (DojoUtil.getInstance(NetworkDashboard.this).isValidPairingPayload(code.trim())) {
DojoUtil.getInstance(NetworkDashboard.this).clear();
strPairingParams = code.trim();
enableDojoConfigure(strPairingParams);
} else {
;
}
} catch (Exception e) {
}
});
}
use of com.samourai.wallet.fragments.CameraFragmentBottomSheet in project samourai-wallet-android by Samourai-Wallet.
the class WhirlpoolMain method onOptionsItemSelected.
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == android.R.id.home)
finish();
if (id == R.id.action_utxo) {
Intent intent = new Intent(WhirlpoolMain.this, UTXOSActivity.class);
intent.putExtra("_account", WhirlpoolMeta.getInstance(WhirlpoolMain.this).getWhirlpoolPostmix());
startActivity(intent);
} else if (id == R.id.action_menu_view_post_mix) {
Intent intent = new Intent(WhirlpoolMain.this, BalanceActivity.class);
intent.putExtra("_account", WhirlpoolMeta.getInstance(WhirlpoolMain.this).getWhirlpoolPostmix());
startActivity(intent);
} else if (id == R.id.action_scode) {
doSCODE();
} else if (id == R.id.action_scan_qr) {
CameraFragmentBottomSheet cameraFragmentBottomSheet = new CameraFragmentBottomSheet();
cameraFragmentBottomSheet.show(getSupportFragmentManager(), cameraFragmentBottomSheet.getTag());
cameraFragmentBottomSheet.setQrCodeScanLisenter(code -> {
cameraFragmentBottomSheet.dismissAllowingStateLoss();
try {
if (Cahoots.isCahoots(code.trim())) {
Intent cahootIntent = new Intent(this, ManualCahootsActivity.class);
cahootIntent.putExtra("payload", code.trim());
cahootIntent.putExtra("_account", WhirlpoolMeta.getInstance(getApplication()).getWhirlpoolPostmix());
startActivity(cahootIntent);
} else if (FormatsUtil.getInstance().isPSBT(code.trim())) {
CahootsUtil.getInstance(getApplication()).doPSBT(code.trim());
} else if (DojoUtil.getInstance(getApplication()).isValidPairingPayload(code.trim())) {
Intent intent = new Intent(getApplication(), NetworkDashboard.class);
intent.putExtra("params", code.trim());
startActivity(intent);
} else {
Intent intent = new Intent(getApplication(), SendActivity.class);
intent.putExtra("uri", code.trim());
intent.putExtra("_account", WhirlpoolMeta.getInstance(getApplication()).getWhirlpoolPostmix());
startActivity(intent);
}
} catch (Exception e) {
}
});
}
return super.onOptionsItemSelected(item);
}
use of com.samourai.wallet.fragments.CameraFragmentBottomSheet in project samourai-wallet-android by Samourai-Wallet.
the class CahootsStepFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
TextView stepText = view.findViewById(R.id.cahoots_step_text);
showQRBtn = view.findViewById(R.id.cahoots_step_show_qr_btn);
scanQRbtn = view.findViewById(R.id.cahoots_step_scan_qr_btn);
stoneWallx2TotalFee = view.findViewById(R.id.stonewall_splitup_total_fee);
stoneWallx2SplitFee = view.findViewById(R.id.stonewall_collab_fee);
feeSplitUpContainer = view.findViewById(R.id.stonewall_fee_splitup_container);
step = getArguments().getInt("step");
stepText.setText("Step ".concat(String.valueOf(step + 1)));
scanQRbtn.setOnClickListener(view1 -> {
CameraFragmentBottomSheet cameraFragmentBottomSheet = new CameraFragmentBottomSheet();
cameraFragmentBottomSheet.show(getActivity().getSupportFragmentManager(), cameraFragmentBottomSheet.getTag());
cameraFragmentBottomSheet.setQrCodeScanLisenter(code -> {
cameraFragmentBottomSheet.dismissAllowingStateLoss();
if (cahootsFragmentListener != null) {
cahootsFragmentListener.onScan(step, code);
}
});
});
showQRBtn.setOnClickListener(view1 -> {
if (cahootsFragmentListener != null) {
cahootsFragmentListener.onShare(step);
}
});
feeSplitUpContainer.setVisibility(View.GONE);
if (this.stowaway != null) {
if (stowaway.getStep() == 2) {
feeSplitUpContainer.post(() -> {
feeSplitUpContainer.setVisibility(View.VISIBLE);
});
stoneWallx2TotalFee.setText(formatForBtc(this.stowaway.getFeeAmount()));
stoneWallx2SplitFee.setText(formatForBtc(this.stowaway.getFeeAmount() / 2));
}
}
}
Aggregations