mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-21 14:34:55 +01:00
FIX: better android support
This commit is contained in:
parent
c7cfe200a1
commit
0f6f3d69ca
7 changed files with 77 additions and 31 deletions
|
@ -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 ? (
|
||||
<TouchableOpacity style={{ marginHorizontal: 16 }} onPress={() => navigation.goBack(null)}>
|
||||
<Image source={require('./img/close.png')} />
|
||||
<TouchableOpacity style={{ width: 40, height: 40, padding: 14 }} onPress={() => navigation.goBack(null)}>
|
||||
<Image style={{ alignSelf: 'center' }} source={require('./img/close.png')} />
|
||||
</TouchableOpacity>
|
||||
) : 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 }}
|
||||
>
|
||||
<LinearGradient
|
||||
colors={['#eef0f4', '#eef0f4']}
|
||||
start={[0, 0]}
|
||||
end={[1, 1]}
|
||||
style={{
|
||||
padding: 15,
|
||||
borderRadius: 10,
|
||||
|
@ -956,7 +962,7 @@ export class WalletsCarousel extends Component {
|
|||
}
|
||||
|
||||
return (
|
||||
<View style={{ paddingRight: 10 }}>
|
||||
<View style={{ paddingRight: 10, marginVertical: 17 }}>
|
||||
<TouchableOpacity
|
||||
activeOpacity={1}
|
||||
onPress={() => {
|
||||
|
@ -966,12 +972,19 @@ export class WalletsCarousel extends Component {
|
|||
}}
|
||||
>
|
||||
<LinearGradient
|
||||
shadowOpacity={18 / 100}
|
||||
shadowOpacity={20 / 100}
|
||||
shadowOffset={{ width: 0, height: 4 }}
|
||||
shadowRadius={10}
|
||||
shadowColor="#000000"
|
||||
colors={[gradient1, gradient2]}
|
||||
style={{ padding: 15, borderRadius: 10, height: 164 }}
|
||||
style={{
|
||||
padding: 15,
|
||||
borderRadius: 10,
|
||||
height: 164,
|
||||
elevation: 5,
|
||||
}}
|
||||
start={[0, 0]}
|
||||
end={[1, 1]}
|
||||
>
|
||||
<Image
|
||||
source={
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { AppStorage } from './class';
|
||||
import Expo from 'expo';
|
||||
import { Accelerometer } from 'expo';
|
||||
import { AsyncStorage } from 'react-native';
|
||||
const bitcoin = require('bitcoinjs-lib');
|
||||
const REQUIRE_NUM_CHUNKS = 16;
|
||||
|
@ -31,7 +31,7 @@ let listener = function(accelerometerData) {
|
|||
|
||||
if (chunks.length >= 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);
|
||||
|
|
28
package-lock.json
generated
28
package-lock.json
generated
|
@ -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",
|
||||
|
|
|
@ -481,7 +481,6 @@ export default class SendDetails extends Component {
|
|||
<Text style={{ color: '#FFFFFF' }}>{loc.send.details.scan}</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
)}
|
||||
<View
|
||||
hide={!this.state.showMemoRow}
|
||||
style={{
|
||||
|
@ -508,7 +507,6 @@ export default class SendDetails extends Component {
|
|||
editable={!this.state.isLoading}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
<TouchableOpacity
|
||||
onPress={() => this.setState({ isFeeSelectionModalVisible: true })}
|
||||
disabled={this.state.isLoading}
|
||||
|
@ -531,7 +529,6 @@ export default class SendDetails extends Component {
|
|||
<Text style={{ color: '#37c0a1', paddingRight: 4, textAlign: 'left' }}>sat/b</Text>
|
||||
</View>
|
||||
</TouchableOpacity>
|
||||
)}
|
||||
{this.renderCreateButton()}
|
||||
{this.renderFeeSelectionModal()}
|
||||
</KeyboardAvoidingView>
|
||||
|
|
|
@ -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 (
|
||||
<React.Fragment>
|
||||
<BlueTextCentered>Version code: {Constants.platform.android.versionCode}</BlueTextCentered>
|
||||
<BlueSpacing20 />
|
||||
</React.Fragment>
|
||||
);
|
||||
} else if (Platform.OS === 'ios') {
|
||||
return (
|
||||
<React.Fragment>
|
||||
<BlueTextCentered>
|
||||
{Constants.platform.ios.model} ({Constants.platform.ios.platform})
|
||||
</BlueTextCentered>
|
||||
<BlueSpacing20 />
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
if (this.state.isLoading) {
|
||||
return <BlueLoading />;
|
||||
|
@ -113,11 +133,7 @@ export default class About extends Component {
|
|||
<BlueTextCentered>
|
||||
w, h = {width}, {height}
|
||||
</BlueTextCentered>
|
||||
<BlueTextCentered>
|
||||
{Constants.platform.ios.model} ({Constants.platform.ios.platform})
|
||||
</BlueTextCentered>
|
||||
<BlueSpacing20 />
|
||||
|
||||
{this.platformSpecificInformation()}
|
||||
<BlueTextCentered>
|
||||
{pkg.name} v{pkg.version} (build {appjson.expo.ios.buildNumber})
|
||||
</BlueTextCentered>
|
||||
|
|
|
@ -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: (
|
||||
<Button
|
||||
color="#0c2550"
|
||||
title={loc.wallets.details.save}
|
||||
<TouchableOpacity
|
||||
style={{ marginHorizontal: 16 }}
|
||||
onPress={() => {
|
||||
navigation.getParam('saveAction')();
|
||||
}}
|
||||
/>
|
||||
>
|
||||
<Text style={{ color: '#0c2550' }}>{loc.wallets.details.save}</Text>
|
||||
</TouchableOpacity>
|
||||
),
|
||||
});
|
||||
|
||||
|
|
|
@ -215,7 +215,12 @@ export default class WalletTransactions extends Component {
|
|||
|
||||
renderWalletHeader = () => {
|
||||
return (
|
||||
<LinearGradient colors={[this.state.gradientColors[0], this.state.gradientColors[1]]} style={{ padding: 15, height: 164 }}>
|
||||
<LinearGradient
|
||||
start={[0, 0]}
|
||||
end={[1, 1]}
|
||||
colors={[this.state.gradientColors[0], this.state.gradientColors[1]]}
|
||||
style={{ padding: 15, height: 164 }}
|
||||
>
|
||||
<Image
|
||||
source={
|
||||
(new LightningCustodianWallet().type === this.state.wallet.type && require('../../img/lnd-shape.png')) ||
|
||||
|
|
Loading…
Add table
Reference in a new issue