Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
SafeAreaView changes
Browse files Browse the repository at this point in the history
  • Loading branch information
tugrul committed May 20, 2021
1 parent 68ff872 commit 548907f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions ios/BluecherryDvr.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -805,6 +805,7 @@
CODE_SIGN_ENTITLEMENTS = BluecherryDvr/BluecherryDvr.entitlements;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 642TR6YWHA;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = BluecherryDvr/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
10 changes: 5 additions & 5 deletions screens/CameraScreen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import React, {useEffect, useState, useCallback, useContext} from 'react';
import {View, Text, TouchableOpacity, FlatList, ActivityIndicator} from 'react-native';
import {View, Text, TouchableOpacity, FlatList, ActivityIndicator, SafeAreaView} from 'react-native';
import Icon from 'react-native-vector-icons/MaterialIcons';
import SplashScreen from 'react-native-splash-screen';

Expand Down Expand Up @@ -191,19 +191,19 @@ function SetCameraScreen({route: {params: {index, type}}, navigation}) {

}, []);

return <View style={{flex: 1, justifyContent: 'center'}}>
return <SafeAreaView style={{flex: 1, justifyContent: 'center'}}>
{loading ? <ActivityIndicator size="large" color="white" /> : <FlatList data={state.deviceList} keyExtractor={({id}) => '' + id} renderItem={({item: {id, device_name}}) =>
<TouchableOpacity style={{marginTop: 5, paddingLeft: 10, paddingRight: 10, paddingTop: 15,
paddingBottom: 15, backgroundColor: '#333333'}} onPress={() => onSelectCamera(id)}>
<Text style={{color: 'white'}}>#{id} - {device_name}</Text></TouchableOpacity>} />}
</View>;
</SafeAreaView>;
}

function ShowCameraScreen({navigation}) {

const {state} = useContext(SessionContext);

return <View style={{flex: 1, justifyContent: 'center'}}>
return <SafeAreaView style={{flex: 1, justifyContent: 'center'}}>
<FlatList data={state.deviceList} keyExtractor={({id}) => '' + id} renderItem={({item: {id, device_name}}) =>
<TouchableOpacity style={{marginTop: 5, paddingLeft: 10, paddingRight: 10, paddingTop: 15,
paddingBottom: 15, backgroundColor: '#333333'}} onPress={() => {
Expand All @@ -212,7 +212,7 @@ function ShowCameraScreen({navigation}) {
})
}}>
<Text style={{color: 'white'}}>#{id} - {device_name}</Text></TouchableOpacity>} />
</View>;
</SafeAreaView>;
}

export function CameraScreen() {
Expand Down
8 changes: 4 additions & 4 deletions screens/EventScreen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

import React, {useEffect, useState, useCallback, useContext, useRef} from 'react';
import {View, Text, FlatList, TouchableOpacity} from 'react-native';
import {View, Text, FlatList, TouchableOpacity, SafeAreaView} from 'react-native';
import { createStackNavigator } from '@react-navigation/stack';
import {getEvents} from '../lib/api';

Expand Down Expand Up @@ -67,7 +67,7 @@ function EventList({navigation}) {
onRefresh();
}, []);

return (<View style={{flex: 1}}>
return (<SafeAreaView style={{flex: 1}}>
{lastUpdate && (<View style={{flexDirection: 'row', padding: 10, backgroundColor: '#333333'}}>
<Text style={{color: 'white'}}>Last Update:</Text><Text style={{color: 'white', marginLeft: 10}}>{lastUpdate}</Text>
</View>)}
Expand All @@ -79,7 +79,7 @@ function EventList({navigation}) {
renderItem={({item}) => (<TouchableOpacity onPress={() =>
navigation.navigate('EventVideoPlayer', {eventId: item.content})}>
<EventButton {...item} /></TouchableOpacity>)}/></View>
</View>);
</SafeAreaView>);
}

function EventVideoPlayer({route: {params: {eventId}}, navigation}) {
Expand Down Expand Up @@ -109,4 +109,4 @@ export default function EventScreen() {
<Stack.Screen name="EventList" options={{title: 'Events'}} component={EventList} />
<Stack.Screen name="EventVideoPlayer" options={{headerShown: false}} component={EventVideoPlayer} />
</Stack.Navigator>);
}
}

0 comments on commit 548907f

Please sign in to comment.