From 0f6f3d69ca2fc124f2f4e3572bc20bc0800abc65 Mon Sep 17 00:00:00 2001 From: Overtorment Date: Fri, 9 Nov 2018 23:44:34 +0000 Subject: [PATCH] FIX: better android support --- BlueComponents.js | 25 +++++++++++++++++++------ entropy.js | 6 +++--- package-lock.json | 28 +++++++++++++++++++++------- screen/send/details.js | 3 --- screen/settings/about.js | 28 ++++++++++++++++++++++------ screen/wallets/details.js | 11 ++++++----- screen/wallets/transactions.js | 7 ++++++- 7 files changed, 77 insertions(+), 31 deletions(-) diff --git a/BlueComponents.js b/BlueComponents.js index bac781f2..c8be967d 100644 --- a/BlueComponents.js +++ b/BlueComponents.js @@ -3,7 +3,7 @@ import React, { Component } from 'react'; import Ionicons from 'react-native-vector-icons/Ionicons'; import { LinearGradient, Constants } from 'expo'; import { Icon, Button, FormLabel, FormInput, Text, Header, List, ListItem } from 'react-native-elements'; -import { TouchableOpacity, ActivityIndicator, View, StyleSheet, Dimensions, Image, SafeAreaView, Clipboard } from 'react-native'; +import { TouchableOpacity, ActivityIndicator, View, StyleSheet, Dimensions, Image, SafeAreaView, Clipboard, Platform } from 'react-native'; import { WatchOnlyWallet, LegacyWallet } from './class'; import Carousel from 'react-native-snap-carousel'; import { HDLegacyP2PKHWallet } from './class/hd-legacy-p2pkh-wallet'; @@ -157,8 +157,8 @@ export const BlueNavigationStyle = (navigation, withNavigationCloseButton = fals }, headerTintColor: '#0c2550', headerRight: withNavigationCloseButton ? ( - navigation.goBack(null)}> - + navigation.goBack(null)}> + ) : null, headerBackTitle: null, @@ -446,6 +446,9 @@ export class is { } static iphone8() { + if (Platform.OS !== 'ios') { + return false; + } return Constants.platform.ios.platform === 'iPhone10,4'; } } @@ -849,9 +852,12 @@ export class NewWalletPannel extends Component { this.handleClick(); } }} + style={{ marginVertical: 17 }} > + { @@ -966,12 +972,19 @@ export class WalletsCarousel extends Component { }} > = REQUIRE_NUM_CHUNKS) { console.log('got enough entropy, saving to storage'); - Expo.Accelerometer.removeAllListeners(); + Accelerometer.removeAllListeners(); runningListeners--; AsyncStorage.setItem(AppStorage.ENTROPY, JSON.stringify(chunks)); } @@ -50,7 +50,7 @@ async function start() { setInterval(() => { if (chunks.length < REQUIRE_NUM_CHUNKS && runningListeners === 0) { console.log('not enough entropy, starting listener to gather'); - Expo.Accelerometer.addListener(listener); + Accelerometer.addListener(listener); runningListeners++; } }, 1000); diff --git a/package-lock.json b/package-lock.json index f19b0f33..5c5f313d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5845,11 +5845,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -5862,15 +5864,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -5973,7 +5978,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -5983,6 +5989,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -5995,17 +6002,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -6022,6 +6032,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -6094,7 +6105,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -6104,6 +6116,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -6209,6 +6222,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", diff --git a/screen/send/details.js b/screen/send/details.js index 1d2a35d8..2d5a9bb0 100644 --- a/screen/send/details.js +++ b/screen/send/details.js @@ -481,7 +481,6 @@ export default class SendDetails extends Component { {loc.send.details.scan} - )} - )} this.setState({ isFeeSelectionModalVisible: true })} disabled={this.state.isLoading} @@ -531,7 +529,6 @@ export default class SendDetails extends Component { sat/b - )} {this.renderCreateButton()} {this.renderFeeSelectionModal()} diff --git a/screen/settings/about.js b/screen/settings/about.js index a1ba2e53..01e3fae0 100644 --- a/screen/settings/about.js +++ b/screen/settings/about.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { Constants } from 'expo'; -import { ScrollView, Linking, Dimensions } from 'react-native'; +import { ScrollView, Linking, Dimensions, Platform } from 'react-native'; import { BlueTextCentered, BlueLoading, @@ -38,6 +38,26 @@ export default class About extends Component { }); } + platformSpecificInformation() { + if (Platform.OS === 'android') { + return ( + + Version code: {Constants.platform.android.versionCode} + + + ); + } else if (Platform.OS === 'ios') { + return ( + + + {Constants.platform.ios.model} ({Constants.platform.ios.platform}) + + + + ); + } + } + render() { if (this.state.isLoading) { return ; @@ -113,11 +133,7 @@ export default class About extends Component { w, h = {width}, {height} - - {Constants.platform.ios.model} ({Constants.platform.ios.platform}) - - - + {this.platformSpecificInformation()} {pkg.name} v{pkg.version} (build {appjson.expo.ios.buildNumber}) diff --git a/screen/wallets/details.js b/screen/wallets/details.js index 0a1544dc..68d59fce 100644 --- a/screen/wallets/details.js +++ b/screen/wallets/details.js @@ -1,6 +1,6 @@ /* global alert */ import React, { Component } from 'react'; -import { ActivityIndicator, View, Button, Text, TextInput, Alert, TouchableOpacity } from 'react-native'; +import { ActivityIndicator, View, Text, TextInput, Alert, TouchableOpacity } from 'react-native'; import { BlueButton, SafeBlueArea, BlueCard, BlueSpacing20, BlueNavigationStyle } from '../../BlueComponents'; import PropTypes from 'prop-types'; import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; @@ -14,13 +14,14 @@ export default class WalletDetails extends Component { ...BlueNavigationStyle(), title: loc.wallets.details.title, headerRight: ( -