use of run.wallet.iota.ui.fragment.GenerateQRCodeFragment in project run-wallet-android by runplay.
the class WalletAddressesItemDialog method onClick.
@Override
public void onClick(DialogInterface dialogInterface, int which) {
ClipboardManager clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
Fragment fragment;
final Bundle bundle = new Bundle();
if (address != null) {
switch(which) {
case 0:
ClipData clipAddress = ClipData.newPlainText(getActivity().getString(R.string.address), addressChecksum);
clipboard.setPrimaryClip(clipAddress);
break;
case 1:
if (!isAddressUsed) {
QRCode qrCode = new QRCode();
qrCode.setAddress(addressChecksum);
bundle.putParcelable(Constants.QRCODE, qrCode);
fragment = new GenerateQRCodeFragment();
fragment.setArguments(bundle);
getActivity().getFragmentManager().beginTransaction().setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).replace(R.id.container, fragment, null).addToBackStack(null).commit();
} else {
Snackbar.make(getActivity().findViewById(R.id.drawer_layout), getString(R.string.messages_address_used), Snackbar.LENGTH_LONG).show();
}
break;
case 2:
if (isPig == 1) {
Snackbar.make(getActivity().findViewById(R.id.drawer_layout), getString(R.string.help_aw_piglock_no_unlock), Snackbar.LENGTH_LONG).show();
} else {
if (isPig > 1) {
// Log.e("SET-PIG","set to false");
Store.setCurrentAddressPig(getActivity(), address, false);
} else {
// Log.e("SET-PIG","set to true");
Store.setCurrentAddressPig(getActivity(), address, true);
}
AppService.refreshEvent();
}
break;
case 3:
Address useaddress = Store.isAlreadyAddress(address, Store.getAddresses());
if (useaddress != null) {
Store.setCacheAddress(useaddress);
UiManager.openFragmentBackStack(getActivity(), AddressSecurityFragment.class);
}
break;
}
}
}
Aggregations