From f153d5b933302af6665a5652d3470d9607cbdfcc Mon Sep 17 00:00:00 2001 From: Severiano Jaramillo Date: Thu, 21 Dec 2017 20:38:58 -0600 Subject: [PATCH] Cleaned SendTransactionFragment --- app/build.gradle | 2 +- .../fragments/SendTransactionFragment.java | 68 +------------------ 2 files changed, 2 insertions(+), 68 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 9f4e57d..3e7bbbe 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -35,7 +35,7 @@ dependencies { exclude group: 'com.android.support', module: 'support-annotations' }) //testCompile 'com.android.support.test:runner:1.0.1' - compile 'com.android.support:appcompat-v7:26.1.0' + compile 'com.android.support:appcompat-v7:26.1.0' compile 'com.android.support:support-v4:26.1.0' compile 'com.android.support:design:26.1.0' compile 'com.android.support.constraint:constraint-layout:1.0.2' diff --git a/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java b/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java index 4c28d12..db1b799 100644 --- a/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java +++ b/app/src/main/java/cy/agorise/crystalwallet/fragments/SendTransactionFragment.java @@ -135,34 +135,7 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat // etFrom.setText(this.grapheneAccount.getName()); } - builder.setView(view); - - /*builder.setPositiveButton("Send", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - sendTransaction(); - } - }); - builder.setNegativeButton("Cancel", new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - dialog.dismiss(); - } - });*/ - - AlertDialog dialog = builder.create(); - - /*dialog.setOnShowListener(new DialogInterface.OnShowListener() { - @Override - public void onShow(DialogInterface dialog) { - btnSend = ((AlertDialog)dialog).getButton(AlertDialog.BUTTON_POSITIVE); - btnCancel = ((AlertDialog)dialog).getButton(AlertDialog.BUTTON_NEGATIVE); - - btnSend.setEnabled(false); - } - });*/ - - return dialog; + return builder.setView(view).create(); } @Override @@ -173,45 +146,6 @@ public class SendTransactionFragment extends DialogFragment implements UIValidat getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT); } - /*public View onCreateView(LayoutInflater inflater, ViewGroup container, - Bundle savedInstanceState){ - View view = inflater.inflate(R.layout.send_transaction, container, false); - ButterKnife.bind(this, view); - - btnSend.setEnabled(false); - - this.cryptoNetAccountId = getArguments().getLong("CRYPTO_NET_ACCOUNT_ID",-1); - - if (this.cryptoNetAccountId != -1) { - db = CrystalDatabase.getAppDatabase(this.getContext()); - this.cryptoNetAccount = db.cryptoNetAccountDao().getById(this.cryptoNetAccountId); - - this.grapheneAccount = new GrapheneAccount(this.cryptoNetAccount); - this.grapheneAccount.loadInfo(db.grapheneAccountInfoDao().getByAccountId(this.cryptoNetAccountId)); - - final LiveData> balancesList = db.cryptoCoinBalanceDao().getBalancesFromAccount(cryptoNetAccountId); - balancesList.observe(this, new Observer>() { - @Override - public void onChanged(@Nullable List cryptoCoinBalances) { - ArrayList assetIds = new ArrayList(); - for (CryptoCoinBalance nextBalance : balancesList.getValue()) { - assetIds.add(nextBalance.getCryptoCurrencyId()); - } - List cryptoCurrencyList = db.cryptoCurrencyDao().getByIds(assetIds); - - CryptoCurrencyAdapter assetAdapter = new CryptoCurrencyAdapter(getContext(), android.R.layout.simple_spinner_item, cryptoCurrencyList); - spAsset.setAdapter(assetAdapter); - } - }); - - sendTransactionValidator = new SendTransactionValidator(this.getContext(), this.cryptoNetAccount, etFrom, etTo, spAsset, etAmount, etMemo); - sendTransactionValidator.setListener(this); - etFrom.setText(this.grapheneAccount.getName()); - } - - return view; - }*/ - @OnItemSelected(R.id.spFrom) public void afterFromSelected(Spinner spinner, int position) { this.sendTransactionValidator.validate();