diff --git a/android/app/src/main/AndroidManifestBase.xml b/android/app/src/main/AndroidManifestBase.xml index b3556301c..5d0c41846 100644 --- a/android/app/src/main/AndroidManifestBase.xml +++ b/android/app/src/main/AndroidManifestBase.xml @@ -42,4 +42,11 @@ android:name="flutterEmbedding" android:value="2" /> + + + + + + + diff --git a/cw_core/lib/transaction_info.dart b/cw_core/lib/transaction_info.dart index 9d72fa843..ae6bddbe2 100644 --- a/cw_core/lib/transaction_info.dart +++ b/cw_core/lib/transaction_info.dart @@ -1,5 +1,4 @@ import 'package:cw_core/transaction_direction.dart'; -//import 'package:cake_wallet/utils/mobx.dart'; import 'package:cw_core/keyable.dart'; abstract class TransactionInfo extends Object with Keyable { @@ -18,4 +17,6 @@ abstract class TransactionInfo extends Object with Keyable { @override dynamic get keyIndex => id; + + Map additionalInfo; } \ No newline at end of file diff --git a/cw_monero/lib/monero_transaction_info.dart b/cw_monero/lib/monero_transaction_info.dart index 83dd65390..9677c1341 100644 --- a/cw_monero/lib/monero_transaction_info.dart +++ b/cw_monero/lib/monero_transaction_info.dart @@ -23,7 +23,13 @@ class MoneroTransactionInfo extends TransactionInfo { accountIndex = int.parse(map['accountIndex'] as String), addressIndex = map['addressIndex'] as int, key = getTxKey((map['hash'] ?? '') as String), - fee = map['fee'] as int ?? 0; + fee = map['fee'] as int ?? 0 { + additionalInfo = { + 'key': key, + 'accountIndex': accountIndex, + 'addressIndex': addressIndex + }; + } MoneroTransactionInfo.fromRow(TransactionInfoRow row) : id = row.getHash(), @@ -36,7 +42,13 @@ class MoneroTransactionInfo extends TransactionInfo { accountIndex = row.subaddrAccount, addressIndex = row.subaddrIndex, key = getTxKey(row.getHash()), - fee = row.fee; + fee = row.fee { + additionalInfo = { + 'key': key, + 'accountIndex': accountIndex, + 'addressIndex': addressIndex + }; + } final String id; final int height; diff --git a/lib/monero/cw_monero.dart b/lib/monero/cw_monero.dart index 97433773b..f17e4b6ed 100644 --- a/lib/monero/cw_monero.dart +++ b/lib/monero/cw_monero.dart @@ -288,4 +288,9 @@ class CWMonero extends Monero { WalletService createMoneroWalletService(Box walletInfoSource) { return MoneroWalletService(walletInfoSource); } + + String getTransactionAddress(Object wallet, int accountIndex, int addressIndex) { + final moneroWallet = wallet as MoneroWallet; + return moneroWallet.getTransactionAddress(accountIndex, addressIndex); + } } diff --git a/lib/src/screens/exchange/exchange_template_page.dart b/lib/src/screens/exchange/exchange_template_page.dart index 653ec9d13..7d98594d5 100644 --- a/lib/src/screens/exchange/exchange_template_page.dart +++ b/lib/src/screens/exchange/exchange_template_page.dart @@ -3,9 +3,13 @@ import 'package:cake_wallet/exchange/exchange_provider.dart'; import 'package:cake_wallet/exchange/exchange_template.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart'; +import 'package:cake_wallet/src/widgets/keyboard_done_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; +import 'package:keyboard_actions/keyboard_actions.dart'; +import 'package:keyboard_actions/keyboard_actions_config.dart'; +import 'package:keyboard_actions/keyboard_actions_item.dart'; import 'package:mobx/mobx.dart'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cw_core/crypto_currency.dart'; @@ -28,6 +32,8 @@ class ExchangeTemplatePage extends BasePage { final depositKey = GlobalKey(); final receiveKey = GlobalKey(); final _formKey = GlobalKey(); + final _depositAmountFocus = FocusNode(); + final _receiveAmountFocus = FocusNode(); var _isReactionsSet = false; @override @@ -36,9 +42,6 @@ class ExchangeTemplatePage extends BasePage { @override Color get titleColor => Colors.white; - @override - bool get resizeToAvoidBottomInset => false; - @override bool get extendBodyBehindAppBar => true; @@ -74,7 +77,22 @@ class ExchangeTemplatePage extends BasePage { WidgetsBinding.instance .addPostFrameCallback((_) => _setReactions(context, exchangeViewModel)); - return Container( + return KeyboardActions( + disableScroll: true, + config: KeyboardActionsConfig( + keyboardActionsPlatform: KeyboardActionsPlatform.IOS, + keyboardBarColor: + Theme.of(context).accentTextTheme.body2.backgroundColor, + nextFocus: false, + actions: [ + KeyboardActionsItem( + focusNode: _depositAmountFocus, + toolbarButtons: [(_) => KeyboardDoneButton()]), + KeyboardActionsItem( + focusNode: _receiveAmountFocus, + toolbarButtons: [(_) => KeyboardDoneButton()]) + ]), + child: Container( color: Theme.of(context).backgroundColor, child: Form( key: _formKey, @@ -121,6 +139,7 @@ class ExchangeTemplatePage extends BasePage { padding: EdgeInsets.fromLTRB(24, 90, 24, 32), child: Observer( builder: (_) => ExchangeCard( + amountFocusNode: _depositAmountFocus, key: depositKey, title: S.of(context).you_will_send, initialCurrency: @@ -160,6 +179,7 @@ class ExchangeTemplatePage extends BasePage { padding: EdgeInsets.only(top: 29, left: 24, right: 24), child: Observer( builder: (_) => ExchangeCard( + amountFocusNode: _receiveAmountFocus, key: receiveKey, title: S.of(context).you_will_get, initialCurrency: @@ -244,6 +264,7 @@ class ExchangeTemplatePage extends BasePage { textColor: Colors.white), ]), )) + ) ); } diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index cdf7de566..71fff8914 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -197,7 +197,6 @@ class SendPage extends BasePage { itemCount: itemCount, itemBuilder: (context, index) { final template = templates[index]; - return TemplateTile( key: UniqueKey(), to: template.name, diff --git a/lib/view_model/send/send_view_model.dart b/lib/view_model/send/send_view_model.dart index 9de6eefc8..fb753e876 100644 --- a/lib/view_model/send/send_view_model.dart +++ b/lib/view_model/send/send_view_model.dart @@ -29,8 +29,11 @@ part 'send_view_model.g.dart'; class SendViewModel = SendViewModelBase with _$SendViewModel; abstract class SendViewModelBase with Store { - SendViewModelBase(this._wallet, this._settingsStore, - this.sendTemplateViewModel, this._fiatConversationStore, + SendViewModelBase( + this._wallet, + this._settingsStore, + this.sendTemplateViewModel, + this._fiatConversationStore, this.transactionDescriptionBox) : state = InitialExecutionState() { final priority = _settingsStore.priority[_wallet.type]; @@ -127,15 +130,17 @@ abstract class SendViewModelBase with Store { bool get isReadyForSend => _wallet.syncStatus is SyncedSyncStatus; @computed - ObservableList