diff --git a/BlueComponents.js b/BlueComponents.js index eeda4b79a..acef6514c 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -11,6 +11,7 @@ import { Animated, ActivityIndicator, View, + KeyboardAvoidingView, UIManager, StyleSheet, Dimensions, @@ -765,30 +766,35 @@ export class BlueUseAllFundsButton extends Component { }; render() { - return ( - - - - - Total: {this.props.wallet.getBalance()} {BitcoinUnit.BTC} - - {this.props.wallet.allowSendMax() && } - - - - + const inputView = ( + + + + Total: {this.props.wallet.getBalance()} {BitcoinUnit.BTC} + + {this.props.wallet.allowSendMax() && this.props.wallet.balance > 0 && ( + + )} - + + + + ); + if (Platform.OS === 'ios') { + return {inputView}; + } else { + return {inputView}; + } } } diff --git a/package-lock.json b/package-lock.json index fba4ae4cb..17cf8929f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3956,8 +3956,8 @@ "integrity": "sha512-SfD7WfmueKrtKeHUESLczuANgnpdnfrSz3ZzerLdtmZf2UBZmAB3z9Q525zI5p3n9I7ii/lllUlyKHm2pIG7QQ==" }, "electrum-client": { - "version": "git+https://github.com/Overtorment/rn-electrum-client.git#d194ff69195ccc86f72088ea3712179b4be9cbb4", - "from": "git+https://github.com/Overtorment/rn-electrum-client.git" + "version": "git+https://github.com/BlueWallet/rn-electrum-client.git#d194ff69195ccc86f72088ea3712179b4be9cbb4", + "from": "git+https://github.com/BlueWallet/rn-electrum-client.git" }, "elliptic": { "version": "6.5.0", diff --git a/screen/send/details.js b/screen/send/details.js index 3d2bc86f4..3a1d28f12 100644 --- a/screen/send/details.js +++ b/screen/send/details.js @@ -22,7 +22,6 @@ import { BlueAddressInput, BlueDismissKeyboardInputAccessory, BlueLoading, - BlueButtonLink, BlueUseAllFundsButton, } from '../../BlueComponents'; import Slider from '@react-native-community/slider'; @@ -73,7 +72,7 @@ export default class SendDetails extends Component { fromSecret = fromWallet.getSecret(); } this.state = { - isLoading: true, + isLoading: false, showSendMax: false, isFeeSelectionModalVisible: false, fromAddress, @@ -636,6 +635,8 @@ export default class SendDetails extends Component { amount={this.state.amount.toString()} onChangeText={text => this.setState({ amount: text })} inputAccessoryViewID={this.state.fromWallet.allowSendMax() ? BlueUseAllFundsButton.InputAccessoryViewID : null} + onFocus={() => this.setState({ isAmountToolbarVisibleForAndroid: true })} + onBlur={() => this.setState({ isAmountToolbarVisibleForAndroid: false })} /> { @@ -720,13 +721,29 @@ export default class SendDetails extends Component { - { - this.setState({ amount: 'MAX' }); - Keyboard.dismiss(); - }} - wallet={this.state.fromWallet} - /> + {Platform.select({ + ios: ( + { + this.setState({ amount: 'MAX' }); + Keyboard.dismiss(); + }} + wallet={this.state.fromWallet} + visi + /> + ), + android: this.state.isAmountToolbarVisibleForAndroid && ( + { + this.setState({ amount: 'MAX' }); + Keyboard.dismiss(); + }} + wallet={this.state.fromWallet} + visi + /> + ), + })} + {this.renderWalletSelectionButton()}