From 25fe07291cda1a5be43015dec696b42efd83a13b Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Mon, 7 Dec 2020 14:45:44 +0500 Subject: [PATCH] fix --- .../src/components/DialogManager/index.js | 3 ++- .../mobile/src/components/SimpleList/index.js | 21 +++++++++++-------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/mobile/src/components/DialogManager/index.js b/apps/mobile/src/components/DialogManager/index.js index 89d29503d..644ebae4e 100644 --- a/apps/mobile/src/components/DialogManager/index.js +++ b/apps/mobile/src/components/DialogManager/index.js @@ -7,6 +7,7 @@ import { eUnSubscribeEvent, openVault } from '../../services/EventManager'; +import { dWidth } from '../../utils'; import { hexToRGBA } from '../../utils/ColorUtils'; import { eCloseActionSheet, @@ -344,7 +345,7 @@ export class DialogManager extends Component { bounceOnOpen={false} gestureEnabled={true} onClose={() => { - translatePrem.setValue(-800); + translatePrem.setValue(-dWidth * 5); this.onActionSheetHide(); this.setState({ actionSheetVisible: false, diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js index ed310c52d..7aa949482 100644 --- a/apps/mobile/src/components/SimpleList/index.js +++ b/apps/mobile/src/components/SimpleList/index.js @@ -21,6 +21,7 @@ import { eScrollEvent, } from '../../utils/Events'; import {SIZE} from '../../utils/SizeUtils'; +import { sleep } from '../../utils/TimeUtils'; import {Button} from '../Button'; import {HeaderMenu} from '../Header/HeaderMenu'; import Seperator from '../Seperator'; @@ -48,15 +49,15 @@ const SimpleList = ({ loading, }) => { const [state, dispatch] = useTracked(); - const {colors} = state; - const searchResults = {...state.searchResults}; + const {colors,searchResults} = state; const [refreshing, setRefreshing] = useState(false); - const insets = useSafeAreaInsets(); const [dataProvider, setDataProvider] = useState( new DataProvider((r1, r2) => { return r1 !== r2; }).cloneWithRows([header, {type: 'empty'}]), ); + const insets = useSafeAreaInsets(); + const {width, fontScale} = useWindowDimensions(); const listData = data; @@ -72,10 +73,12 @@ const SimpleList = ({ }, [listData, searchResults.results]); const loadData = () => { - let mainData = [header, {type: 'empty'}]; - mainData = - !listData || listData.length === 0 ? mainData : [header, ...listData]; - setDataProvider(dataProvider.cloneWithRows(mainData)); + sleep(500).then(()=> { + let mainData = [header, {type: 'empty'}]; + mainData = + !listData || listData.length === 0 ? mainData : [header, ...listData]; + setDataProvider(dataProvider.cloneWithRows(mainData)); + }) }; const RenderSectionHeader = ({item, index}) => ( @@ -209,7 +212,7 @@ const SimpleList = ({ break; case 'empty': dim.width = width; - dim.height = 600; + dim.height = dHeight - 250 - insets.top; break; case 'topic': dim.width = width; @@ -280,7 +283,7 @@ const SimpleList = ({ dataProvider={dataProvider} rowRenderer={_renderRow} onScroll={_onScroll} - canChangeSize + canChangeSize={true} forceNonDeterministicRendering renderFooter={() => } scrollViewProps={{