FIX: Multiple android layout issues

This commit is contained in:
Marcos Rodriguez Vélez 2019-01-24 14:31:30 -05:00
parent 1b0fea1c06
commit a270ffc898
5 changed files with 80 additions and 90 deletions

View file

@ -44,30 +44,27 @@ if (aspectRatio > 1.6) {
export class BlueButton extends Component { export class BlueButton extends Component {
render() { render() {
// eslint-disable-next-line
this.props.buttonStyle = this.props.buttonStyle || {};
return ( return (
<Button <TouchableOpacity
activeOpacity={0.1}
delayPressIn={0}
style={{ style={{
flex: 1,
borderWidth: 0.7, borderWidth: 0.7,
borderColor: 'transparent', borderColor: 'transparent',
backgroundColor: '#ccddf9',
minHeight: 45,
height: 45,
borderRadius: 25,
minWidth: width / 1.5,
justifyContent: 'center',
alignItems: 'center',
}} }}
buttonStyle={Object.assign(
{
backgroundColor: '#ccddf9',
minHeight: 45,
height: 45,
borderWidth: 0,
borderRadius: 25,
},
this.props.buttonStyle,
)}
color="#0c2550"
{...this.props} {...this.props}
/> >
<View style={{ flexDirection: 'row', justifyContent: 'center', alignItems: 'center' }}>
{this.props.icon && <Icon name={this.props.icon.name} type={this.props.icon.type} color={this.props.icon.color} />}
<Text style={{ marginHorizontal: 8, fontSize: 16, color: '#0c2550' }}>{this.props.title}</Text>
</View>
</TouchableOpacity>
); );
} }
} }

View file

@ -51,11 +51,7 @@ export default class LNDCreateInvoice extends Component {
{this.state.isLoading ? ( {this.state.isLoading ? (
<ActivityIndicator /> <ActivityIndicator />
) : ( ) : (
<BlueButton <BlueButton disabled={!this.state.amount > 0} onPress={() => this.createInvoice()} title={loc.send.details.create} />
disabled={!(this.state.description.length > 0 && this.state.amount > 0)}
onPress={() => this.createInvoice()}
title={loc.send.details.create}
/>
)} )}
</View> </View>
); );

View file

@ -51,73 +51,71 @@ export default class About extends Component {
<BlueTextCentered h4>Always backup your keys</BlueTextCentered> <BlueTextCentered h4>Always backup your keys</BlueTextCentered>
<BlueSpacing20 /> <BlueSpacing20 />
</BlueCard>
<BlueButton <BlueButton
icon={{ icon={{
name: 'mark-github', name: 'mark-github',
type: 'octicon', type: 'octicon',
color: BlueApp.settings.buttonTextColor, color: BlueApp.settings.buttonTextColor,
}} }}
onPress={() => { onPress={() => {
Linking.openURL('https://github.com/BlueWallet/BlueWallet'); Linking.openURL('https://github.com/BlueWallet/BlueWallet');
}} }}
title="github.com/BlueWallet/BlueWallet" title="github.com/BlueWallet/BlueWallet"
/> />
<BlueSpacing20 /> <BlueSpacing20 />
<BlueButton <BlueButton
icon={{ icon={{
name: 'twitter', name: 'twitter',
type: 'font-awesome', type: 'font-awesome',
color: BlueApp.settings.buttonTextColor, color: BlueApp.settings.buttonTextColor,
}} }}
onPress={() => { onPress={() => {
Linking.openURL('https://twitter.com/bluewalletio'); Linking.openURL('https://twitter.com/bluewalletio');
}} }}
title="Follow us on Twitter" title="Follow us on Twitter"
/> />
<BlueSpacing20 /> <BlueSpacing20 />
<BlueButton <BlueButton
icon={{ icon={{
name: 'telegram', name: 'telegram',
type: 'font-awesome', type: 'font-awesome',
color: BlueApp.settings.buttonTextColor, color: BlueApp.settings.buttonTextColor,
}} }}
onPress={() => { onPress={() => {
Linking.openURL('https://t.me/bluewallet'); Linking.openURL('https://t.me/bluewallet');
}} }}
title="Join Telegram chat" title="Join Telegram chat"
/> />
<BlueSpacing20 /> <BlueSpacing20 />
<BlueButton <BlueButton
icon={{ icon={{
name: 'thumbsup', name: 'thumbsup',
type: 'octicon', type: 'octicon',
color: BlueApp.settings.buttonTextColor, color: BlueApp.settings.buttonTextColor,
}} }}
onPress={() => { onPress={() => {
let options = { let options = {
AppleAppID: '1376878040', AppleAppID: '1376878040',
GooglePackageName: 'io.bluewallet.bluewallet', GooglePackageName: 'io.bluewallet.bluewallet',
preferredAndroidMarket: AndroidMarket.Google, preferredAndroidMarket: AndroidMarket.Google,
preferInApp: true, preferInApp: true,
openAppStoreIfInAppFails: true, openAppStoreIfInAppFails: true,
fallbackPlatformURL: 'https://bluewallet.io', fallbackPlatformURL: 'https://bluewallet.io',
}; };
Rate.rate(options, success => { Rate.rate(options, success => {
if (success) { if (success) {
console.log('User Rated.'); console.log('User Rated.');
} }
}); });
}} }}
title="Rate Blue Wallet" title="Rate Blue Wallet"
/> />
<BlueSpacing20 /> <BlueSpacing20 />
<BlueCard>
<BlueText h3>Built with awesome:</BlueText> <BlueText h3>Built with awesome:</BlueText>
<BlueSpacing20 /> <BlueSpacing20 />
<BlueText h4>* React Native</BlueText> <BlueText h4>* React Native</BlueText>

View file

@ -3,6 +3,7 @@ import { AsyncStorage, View, TextInput, Linking } from 'react-native';
import { AppStorage } from '../../class'; import { AppStorage } from '../../class';
import { BlueLoading, BlueSpacing20, BlueButton, SafeBlueArea, BlueCard, BlueNavigationStyle, BlueText } from '../../BlueComponents'; import { BlueLoading, BlueSpacing20, BlueButton, SafeBlueArea, BlueCard, BlueNavigationStyle, BlueText } from '../../BlueComponents';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Button } from 'react-native-elements';
import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet'; import { LightningCustodianWallet } from '../../class/lightning-custodian-wallet';
/** @type {AppStorage} */ /** @type {AppStorage} */
let BlueApp = require('../../BlueApp'); let BlueApp = require('../../BlueApp');
@ -56,7 +57,7 @@ export default class LightningSettings extends Component {
<BlueText>{loc.settings.lightning_settings_explain}</BlueText> <BlueText>{loc.settings.lightning_settings_explain}</BlueText>
</BlueCard> </BlueCard>
<BlueButton <Button
icon={{ icon={{
name: 'mark-github', name: 'mark-github',
type: 'octicon', type: 'octicon',
@ -67,6 +68,7 @@ export default class LightningSettings extends Component {
Linking.openURL('https://github.com/BlueWallet/LndHub'); Linking.openURL('https://github.com/BlueWallet/LndHub');
}} }}
title="github.com/BlueWallet/LndHub" title="github.com/BlueWallet/LndHub"
color={BlueApp.settings.buttonTextColor}
buttonStyle={{ buttonStyle={{
backgroundColor: '#FFFFFF', backgroundColor: '#FFFFFF',
}} }}
@ -92,7 +94,7 @@ export default class LightningSettings extends Component {
value={this.state.URI} value={this.state.URI}
onChangeText={text => this.setState({ URI: text })} onChangeText={text => this.setState({ URI: text })}
numberOfLines={1} numberOfLines={1}
style={{ flex: 1, marginHorizontal: 8, minHeight: 33, height: 33 }} style={{ flex: 1, marginHorizontal: 8, minHeight: 36, height: 36 }}
editable={!this.state.isLoading} editable={!this.state.isLoading}
underlineColorAndroid="transparent" underlineColorAndroid="transparent"
/> />

View file

@ -182,9 +182,6 @@ export default class WalletsAdd extends Component {
{!this.state.isLoading ? ( {!this.state.isLoading ? (
<BlueButton <BlueButton
title={loc.wallets.add.create} title={loc.wallets.add.create}
buttonStyle={{
width: width / 1.5,
}}
onPress={() => { onPress={() => {
this.setState( this.setState(
{ isLoading: true }, { isLoading: true },