FIX: Use old modal style for Android

This commit is contained in:
marcosrdz 2020-05-31 14:33:48 -04:00
parent 9381366538
commit 9b0b43723c
4 changed files with 48 additions and 28 deletions

View file

@ -427,8 +427,8 @@ export const BlueNavigationStyle = (navigation, withNavigationCloseButton = fals
fontWeight: '600', fontWeight: '600',
color: BlueApp.settings.foregroundColor, color: BlueApp.settings.foregroundColor,
}, },
headerTintColor: BlueApp.settings.foregroundColor,
headerRight, headerRight,
headerTintColor: BlueApp.settings.foregroundColor,
// headerBackTitle: null, // headerBackTitle: null,
headerBackTitleVisible: false, headerBackTitleVisible: false,
}; };
@ -2270,6 +2270,12 @@ export class BlueBitcoinAmount extends Component {
unit: BitcoinUnit.BTC, unit: BitcoinUnit.BTC,
}; };
textInput = React.createRef();
handleTextInputOnPress = () => {
this.textInput.current.focus();
};
render() { render() {
const amount = this.props.amount || '0'; const amount = this.props.amount || '0';
let localCurrency = loc.formatBalanceWithoutSuffix(amount, BitcoinUnit.LOCAL_CURRENCY, false); let localCurrency = loc.formatBalanceWithoutSuffix(amount, BitcoinUnit.LOCAL_CURRENCY, false);
@ -2282,7 +2288,7 @@ export class BlueBitcoinAmount extends Component {
} }
if (amount === BitcoinUnit.MAX) localCurrency = ''; // we dont want to display NaN if (amount === BitcoinUnit.MAX) localCurrency = ''; // we dont want to display NaN
return ( return (
<TouchableWithoutFeedback disabled={this.props.pointerEvents === 'none'} onPress={() => this.textInput.focus()}> <TouchableWithoutFeedback disabled={this.props.pointerEvents === 'none'} onPress={this.handleTextInputOnPress}>
<View> <View>
<View style={{ flexDirection: 'row', justifyContent: 'center', paddingTop: 16, paddingBottom: 2 }}> <View style={{ flexDirection: 'row', justifyContent: 'center', paddingTop: 16, paddingBottom: 2 }}>
<TextInput <TextInput
@ -2318,7 +2324,7 @@ export class BlueBitcoinAmount extends Component {
}} }}
placeholder="0" placeholder="0"
maxLength={10} maxLength={10}
ref={textInput => (this.textInput = textInput)} ref={this.textInput}
editable={!this.props.isLoading && !this.props.disabled} editable={!this.props.isLoading && !this.props.disabled}
value={amount} value={amount}
placeholderTextColor={this.props.disabled ? BlueApp.settings.buttonDisabledTextColor : BlueApp.settings.alternativeTextColor2} placeholderTextColor={this.props.disabled ? BlueApp.settings.buttonDisabledTextColor : BlueApp.settings.alternativeTextColor2}

View file

@ -56,21 +56,27 @@ import LNDViewInvoice from './screen/lnd/lndViewInvoice';
import LNDViewAdditionalInvoiceInformation from './screen/lnd/lndViewAdditionalInvoiceInformation'; import LNDViewAdditionalInvoiceInformation from './screen/lnd/lndViewAdditionalInvoiceInformation';
import { Platform } from 'react-native'; import { Platform } from 'react-native';
const defaultScreenOptions = ({ route, navigation }) => ({ const defaultScreenOptions =
gestureEnabled: true, Platform.OS === 'ios'
cardOverlayEnabled: true, ? ({ route, navigation }) => ({
headerStatusBarHeight: navigation.dangerouslyGetState().routes.indexOf(route) > 0 ? 10 : undefined, gestureEnabled: true,
...(Platform.OS === 'ios' ? TransitionPresets.ModalPresentationIOS : TransitionPresets.ModalTransition), cardOverlayEnabled: true,
}); headerStatusBarHeight: navigation.dangerouslyGetState().routes.indexOf(route) > 0 ? 10 : undefined,
const defaultStackScreenOptions = { ...TransitionPresets.ModalPresentationIOS,
gestureEnabled: true, })
cardOverlayEnabled: true, : undefined;
headerStatusBarHeight: 10, const defaultStackScreenOptions =
}; Platform.OS === 'ios'
? {
gestureEnabled: true,
cardOverlayEnabled: true,
headerStatusBarHeight: 10,
}
: undefined;
const WalletsStack = createStackNavigator(); const WalletsStack = createStackNavigator();
const WalletsRoot = () => ( const WalletsRoot = () => (
<WalletsStack.Navigator screenOptions={{ headerTitle: null, headerBackTitleVisible: false }}> <WalletsStack.Navigator>
<WalletsStack.Screen name="WalletsList" component={WalletsList} options={{ headerShown: false }} /> <WalletsStack.Screen name="WalletsList" component={WalletsList} options={WalletsList.navigationOptions} />
<WalletsStack.Screen name="WalletTransactions" component={WalletTransactions} options={WalletTransactions.navigationOptions} /> <WalletsStack.Screen name="WalletTransactions" component={WalletTransactions} options={WalletTransactions.navigationOptions} />
<WalletsStack.Screen name="WalletDetails" component={WalletDetails} options={WalletDetails.navigationOptions} /> <WalletsStack.Screen name="WalletDetails" component={WalletDetails} options={WalletDetails.navigationOptions} />
<WalletsStack.Screen name="TransactionDetails" component={TransactionDetails} options={TransactionDetails.navigationOptions} /> <WalletsStack.Screen name="TransactionDetails" component={TransactionDetails} options={TransactionDetails.navigationOptions} />
@ -87,7 +93,10 @@ const WalletsRoot = () => (
backgroundColor: '#FFFFFF', backgroundColor: '#FFFFFF',
borderBottomWidth: 0, borderBottomWidth: 0,
elevation: 0, elevation: 0,
shadowColor: 'transparent',
}, },
title: '',
headerBackTitleVisible: false,
headerTintColor: '#0c2550', headerTintColor: '#0c2550',
}} }}
/> />

View file

@ -408,4 +408,3 @@ WalletsAdd.propTypes = {
goBack: PropTypes.func, goBack: PropTypes.func,
}), }),
}; };

View file

@ -22,6 +22,7 @@ import { AppStorage, PlaceholderWallet } from '../../class';
import WalletImport from '../../class/wallet-import'; import WalletImport from '../../class/wallet-import';
import ActionSheet from '../ActionSheet'; import ActionSheet from '../ActionSheet';
import ImagePicker from 'react-native-image-picker'; import ImagePicker from 'react-native-image-picker';
import NavigationService from '../../NavigationService';
const EV = require('../../events'); const EV = require('../../events');
const A = require('../../analytics'); const A = require('../../analytics');
let BlueApp: AppStorage = require('../../BlueApp'); let BlueApp: AppStorage = require('../../BlueApp');
@ -148,6 +149,22 @@ const styles = StyleSheet.create({
}); });
export default class WalletsList extends Component { export default class WalletsList extends Component {
static navigationOptions = ({ navigation, route }) => {
return {
title: '',
headerRight: () => (
<TouchableOpacity testID="SettingsButton" style={styles.headerTouch} onPress={() => NavigationService.navigate('Settings')}>
<Icon size={22} name="kebab-horizontal" type="octicon" color={BlueApp.settings.foregroundColor} />
</TouchableOpacity>
),
headerStyle: {
shadowColor: 'transparent',
elevation: 0,
shadowOpacity: 0,
},
};
};
walletsCarousel = React.createRef(); walletsCarousel = React.createRef();
constructor(props) { constructor(props) {
@ -413,16 +430,6 @@ export default class WalletsList extends Component {
); );
}; };
renderNavigationHeader = () => {
return (
<View style={styles.headerStyle}>
<TouchableOpacity testID="SettingsButton" style={styles.headerTouch} onPress={() => this.props.navigation.navigate('Settings')}>
<Icon size={22} name="kebab-horizontal" type="octicon" color={BlueApp.settings.foregroundColor} />
</TouchableOpacity>
</View>
);
};
renderLocalTrader = () => { renderLocalTrader = () => {
if (BlueApp.getWallets().length > 0 && !BlueApp.getWallets().some(wallet => wallet.type === PlaceholderWallet.type)) { if (BlueApp.getWallets().length > 0 && !BlueApp.getWallets().some(wallet => wallet.type === PlaceholderWallet.type)) {
return ( return (
@ -641,7 +648,6 @@ export default class WalletsList extends Component {
return ( return (
<View style={styles.root}> <View style={styles.root}>
<View style={styles.walletsListWrapper}> <View style={styles.walletsListWrapper}>
{this.renderNavigationHeader()}
<SectionList <SectionList
refreshControl={<RefreshControl onRefresh={this.refreshTransactions} refreshing={!this.state.isFlatListRefreshControlHidden} />} refreshControl={<RefreshControl onRefresh={this.refreshTransactions} refreshing={!this.state.isFlatListRefreshControlHidden} />}
renderItem={this.renderSectionItem} renderItem={this.renderSectionItem}