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

View File

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