fix focus mode

This commit is contained in:
ammarahm-ed
2020-12-19 14:38:03 +05:00
parent f52de3fa42
commit 69e3211baf
2 changed files with 76 additions and 72 deletions

View File

@@ -1,15 +1,15 @@
import React, { createRef } from 'react'; import React, {createRef} from 'react';
import { Platform, ScrollView, TouchableOpacity, View } from 'react-native'; import {Platform, ScrollView, TouchableOpacity, View} from 'react-native';
import * as RNIap from 'react-native-iap'; import * as RNIap from 'react-native-iap';
import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
import { DDS } from '../../services/DeviceDetection'; import {DDS} from '../../services/DeviceDetection';
import { eSendEvent } from '../../services/EventManager'; import {eSendEvent} from '../../services/EventManager';
import { dHeight, itemSkus } from '../../utils'; import {dHeight, itemSkus} from '../../utils';
import { db } from '../../utils/DB'; import {db} from '../../utils/DB';
import { eOpenLoginDialog } from '../../utils/Events'; import {eOpenLoginDialog} from '../../utils/Events';
import { SIZE } from '../../utils/SizeUtils'; import {SIZE} from '../../utils/SizeUtils';
import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper'; import ActionSheetWrapper from '../ActionSheetComponent/ActionSheetWrapper';
import { Button } from '../Button'; import {Button} from '../Button';
import Seperator from '../Seperator'; import Seperator from '../Seperator';
import Heading from '../Typography/Heading'; import Heading from '../Typography/Heading';
import Paragraph from '../Typography/Paragraph'; import Paragraph from '../Typography/Paragraph';
@@ -44,8 +44,6 @@ class PremiumDialog extends React.Component {
this.actionSheetRef.current?._setModalVisible(false); this.actionSheetRef.current?._setModalVisible(false);
} }
async getSkus() { async getSkus() {
try { try {
let u = await db.user.getUser(); let u = await db.user.getUser();
@@ -83,7 +81,7 @@ class PremiumDialog extends React.Component {
fwdRef={this.actionSheetRef}> fwdRef={this.actionSheetRef}>
<View <View
style={{ style={{
width: "100%", width: '100%',
backgroundColor: colors.bg, backgroundColor: colors.bg,
justifyContent: 'space-between', justifyContent: 'space-between',
paddingHorizontal: 12, paddingHorizontal: 12,

View File

@@ -88,85 +88,91 @@ export const EditorWrapper = ({dimensions}) => {
const {colors} = state; const {colors} = state;
const insets = useSafeAreaInsets(); const insets = useSafeAreaInsets();
return ( return (
<SafeAreaView <View
ref={editorRef} ref={editorRef}
style={{ style={{
width: DDS.isLargeTablet() ? dimensions.width * 0.55 : dimensions.width, width: DDS.isLargeTablet() ? dimensions.width * 0.55 : dimensions.width,
height: '100%', height: '100%',
backgroundColor: colors.bg, backgroundColor: colors.bg,
}}> }}>
<GetPremium context="editor" offset={50 + insets.top} /> <SafeAreaView
<View
style={{ style={{
position: 'absolute', width: '100%',
zIndex: 20, height: '100%',
height: insets.top, }}>
top: 0, <GetPremium context="editor" offset={50 + insets.top} />
width: dimensions.width, <View
backgroundColor: colors.bg,
}}
/>
<PanGestureHandler
minPointers={2}
onHandlerStateChange={onHandlerStateChange}
onGestureEvent={onGestureEvent}>
<AnimatedKeyboardView
behavior={Platform.OS === 'ios' ? 'padding' : null}
style={{ style={{
transform: [ position: 'absolute',
{ zIndex: 20,
translateY: anim2, height: insets.top,
}, top: 0,
], width: dimensions.width,
height: '100%', backgroundColor: colors.bg,
width: '100%', }}
}}> />
<View <PanGestureHandler
minPointers={2}
onHandlerStateChange={onHandlerStateChange}
onGestureEvent={onGestureEvent}>
<AnimatedKeyboardView
behavior={Platform.OS === 'ios' ? 'padding' : null}
style={{ style={{
height: 80,
position: 'absolute',
backgroundColor: colors.accent,
width: '100%',
justifyContent: 'center',
alignItems: 'center',
zIndex: 10,
transform: [ transform: [
{ {
translateY: -80 translateY: anim2,
}, },
], ],
height: '100%',
width: '100%',
}}> }}>
<Animated.Text <View
style={{ style={{
height: 80,
position: 'absolute', position: 'absolute',
opacity: op1, backgroundColor: colors.accent,
bottom: 10, width: '100%',
justifyContent: 'center',
alignItems: 'center',
zIndex: 10,
transform: [
{
translateY: -80,
},
],
}}> }}>
<Paragraph color="white"> <Animated.Text
Keep swiping down to start a new note. style={{
</Paragraph> position: 'absolute',
</Animated.Text> opacity: op1,
bottom: 10,
}}>
<Paragraph color="white">
Keep swiping down to start a new note.
</Paragraph>
</Animated.Text>
<Animated.Text <Animated.Text
style={{ style={{
position: 'absolute', position: 'absolute',
opacity: op3, opacity: op3,
}}> }}>
<Paragraph color="white">Release to load new note</Paragraph> <Paragraph color="white">Release to load new note</Paragraph>
</Animated.Text> </Animated.Text>
<Animated.Text <Animated.Text
style={{ style={{
position: 'absolute', position: 'absolute',
opacity: op2, opacity: op2,
}}> }}>
<Paragraph color="white">Loading a new note</Paragraph> <Paragraph color="white">Loading a new note</Paragraph>
</Animated.Text> </Animated.Text>
</View> </View>
<Editor /> <Editor />
</AnimatedKeyboardView> </AnimatedKeyboardView>
</PanGestureHandler> </PanGestureHandler>
</SafeAreaView> </SafeAreaView>
</View>
); );
}; };