use of run.wallet.iota.model.QRCode in project run-wallet-android by runplay.
the class AboutFragment method onAboutDonationIotaClick.
@OnClick(R.id.about_donation_iota)
public void onAboutDonationIotaClick() {
if (Store.getCurrentWallet() != null) {
QRCode qrCode = new QRCode();
qrCode.setAddress(Constants.DONATION_ADDRESS);
qrCode.setTag(Constants.DONATION_TAG);
Bundle bundle = new Bundle();
bundle.putParcelable(Constants.QRCODE, qrCode);
Intent pickContactIntent = new Intent(Intent.ACTION_SENDTO, Uri.parse("iota://send"));
pickContactIntent.putExtra(Constants.QRCODE, qrCode);
getActivity().setResult(Constants.DONATE_NOW, pickContactIntent);
getActivity().finish();
} else
onAboutDonationIotaAddressClick();
}
use of run.wallet.iota.model.QRCode in project run-wallet-android by runplay.
the class MainActivity method onActivityResult.
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
switch(resultCode) {
case Constants.REQUEST_CODE_LOGIN:
case 0:
inputManager.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0);
navigationView.getMenu().performIdentifierAction(R.id.nav_wallet, 0);
break;
case Constants.REQUEST_RESTART_KILL_APP:
FragmentManager fragman = getFragmentManager();
FragmentTransaction fragmentTransaction = fragman.beginTransaction();
for (Class fragmentClass : fragmentsToKill) {
String tag = fragmentClass.getCanonicalName();
Fragment fragmentToKill = fragman.findFragmentByTag(tag);
if (fragmentToKill != null) {
fragmentTransaction.remove(fragmentToKill);
}
}
TaskManager.stopAndDestroyAllTasks(this);
Store.wipeAllStoreSavedData(this);
fragmentTransaction.commit();
WalletAddressCardAdapter.clear();
WalletTransfersCardAdapter.clear();
inputManager.hideSoftInputFromWindow(getWindow().getDecorView().getWindowToken(), 0);
UiManager.openFragment(this, WelcomeFragment.class);
break;
case Constants.REQUEST_GO_TOR:
UiManager.openFragmentBackStack(this, TorFragment.class);
break;
case Constants.REQUEST_GO_COLORS:
UiManager.openFragmentBackStack(this, ColorFragment.class);
break;
}
if (data != null) {
if (resultCode == Constants.DONATE_NOW) {
Bundle bundle = data.getExtras();
if (bundle != null) {
Fragment fragment = new SnTrFragment();
fragment.setArguments(bundle);
showFragment(fragment, true);
}
} else if (Intent.ACTION_VIEW.equals(data.getAction())) {
QRCode qrCode = new QRCode();
Uri uri = data.getData();
if (uri != null && uri.getQueryParameter("address:") != null && !uri.getQueryParameter("address:").isEmpty()) {
qrCode.setAddress(uri.getQueryParameter("address:"));
qrCode.setAmount(uri.getQueryParameter("amount:"));
qrCode.setMessage(uri.getQueryParameter("message:"));
Bundle bundle = new Bundle();
bundle.putParcelable(Constants.QRCODE, qrCode);
Fragment fragment = new SnTrFragment();
fragment.setArguments(bundle);
showFragment(fragment, true);
}
}
}
}
use of run.wallet.iota.model.QRCode 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;
}
}
}
use of run.wallet.iota.model.QRCode in project run-wallet-android by runplay.
the class HelpFragment method onAboutDonationIotaClick.
@OnClick(R.id.about_donation_iota)
public void onAboutDonationIotaClick() {
if (Store.getCurrentWallet() != null) {
QRCode qrCode = new QRCode();
qrCode.setAddress(Constants.DONATION_ADDRESS);
qrCode.setTag(Constants.DONATION_TAG);
Bundle bundle = new Bundle();
bundle.putParcelable(Constants.QRCODE, qrCode);
FragmentManager fragmentManager = getFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
SnTrFragment sendTransfer = new SnTrFragment();
sendTransfer.setArguments(bundle);
fragmentTransaction.replace(R.id.container, sendTransfer, SnTrFragment.class.getCanonicalName());
fragmentTransaction.commit();
} else
onAboutDonationIotaAddressClick();
}
use of run.wallet.iota.model.QRCode in project run-wallet-android by runplay.
the class GenerateQRCodeFragment method onViewCreated.
@Override
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
super.onViewCreated(view, savedInstanceState);
((AppCompatActivity) getActivity()).setSupportActionBar(generateQrCodeToolbar);
Bundle bundle = getArguments();
if (bundle != null) {
QRCode qrCode = bundle.getParcelable(Constants.QRCODE);
if (qrCode != null) {
if (qrCode.getAddress() != null)
addressEditText.setText(qrCode.getAddress());
}
}
// else
// generateNewAddress();
initUnitsSpinner();
}
Aggregations