YoonyoungL

Replace project

Showing 42 changed files with 341 additions and 373 deletions
1 -import React, {Component} from 'react' 1 +import React, { Component } from 'react';
2 +import { StyleSheet, Text, View } from 'react-native';
2 import { createAppContainer } from 'react-navigation'; 3 import { createAppContainer } from 'react-navigation';
3 -import { createStackNavigator } from 'react-navigation-stack'; 4 +import { createStackNavigator } from 'react-navigation-stack'
5 +// import MainScreen from './components/MainScreen';
4 import Login from './source/Login'; 6 import Login from './source/Login';
5 import MainScreen from './source/MainScreen'; 7 import MainScreen from './source/MainScreen';
6 8
9 +// const AppStackNavigator = createStackNavigator({
10 +// Main:{
11 +// screen: MainScreen // MainScreen 컴포넌트를 네비게이터에 등록
12 +// }
13 +// });
14 +
15 +// export default createAppContainer(AppStackNavigator);
16 +
7 const MainNavigator = createStackNavigator({ 17 const MainNavigator = createStackNavigator({
8 Login : {screen: Login}, 18 Login : {screen: Login},
9 MainScreen : {screen:MainScreen}, 19 MainScreen : {screen:MainScreen},
......
...@@ -35,12 +35,12 @@ android_library( ...@@ -35,12 +35,12 @@ android_library(
35 35
36 android_build_config( 36 android_build_config(
37 name = "build_config", 37 name = "build_config",
38 - package = "com.fwiot", 38 + package = "com.testproject",
39 ) 39 )
40 40
41 android_resource( 41 android_resource(
42 name = "res", 42 name = "res",
43 - package = "com.fwiot", 43 + package = "com.testproject",
44 res = "src/main/res", 44 res = "src/main/res",
45 ) 45 )
46 46
......
...@@ -128,7 +128,7 @@ android { ...@@ -128,7 +128,7 @@ android {
128 } 128 }
129 129
130 defaultConfig { 130 defaultConfig {
131 - applicationId "com.fwiot" 131 + applicationId "com.testproject"
132 minSdkVersion rootProject.ext.minSdkVersion 132 minSdkVersion rootProject.ext.minSdkVersion
133 targetSdkVersion rootProject.ext.targetSdkVersion 133 targetSdkVersion rootProject.ext.targetSdkVersion
134 versionCode 1 134 versionCode 1
...@@ -189,11 +189,6 @@ dependencies { ...@@ -189,11 +189,6 @@ dependencies {
189 } else { 189 } else {
190 implementation jscFlavor 190 implementation jscFlavor
191 } 191 }
192 -
193 - compile project(':react-native-push-notification')
194 - compile ('com.google.android.gms:play-services-gcm:8.1.0') {
195 - force = true;
196 - }
197 } 192 }
198 193
199 // Run this once to be able to run the application with BUCK 194 // Run this once to be able to run the application with BUCK
......
1 <manifest xmlns:android="http://schemas.android.com/apk/res/android" 1 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
2 - package="com.fwiot"> 2 + package="com.testproject">
3 3
4 <uses-permission android:name="android.permission.INTERNET" /> 4 <uses-permission android:name="android.permission.INTERNET" />
5 - <uses-permission android:name="android.permission.WAKE_LOCK" />
6 - <permission
7 - android:name="${applicationId}.permission.C2D_MESSAGE"
8 - android:protectionLevel="signature" />
9 - <uses-permission android:name="${applicationId}.permission.C2D_MESSAGE" />
10 - <uses-permission android:name="android.permission.VIBRATE" />
11 - <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
12 5
13 <application 6 <application
14 android:name=".MainApplication" 7 android:name=".MainApplication"
...@@ -17,32 +10,6 @@ ...@@ -17,32 +10,6 @@
17 android:roundIcon="@mipmap/ic_launcher_round" 10 android:roundIcon="@mipmap/ic_launcher_round"
18 android:allowBackup="false" 11 android:allowBackup="false"
19 android:theme="@style/AppTheme"> 12 android:theme="@style/AppTheme">
20 -
21 - <receiver
22 - android:name="com.google.android.gms.gcm.GcmReceiver"
23 - android:exported="true"
24 - android:permission="com.google.android.c2dm.permission.SEND" >
25 - <intent-filter>
26 - <action android:name="com.google.android.c2dm.intent.RECEIVE" />
27 - <category android:name="${applicationId}" />
28 - </intent-filter>
29 - </receiver>
30 -
31 - <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationPublisher" />
32 - <receiver android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationBootEventReceiver">
33 - <intent-filter>
34 - <action android:name="android.intent.action.BOOT_COMPLETED" />
35 - </intent-filter>
36 - </receiver>
37 - <service android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationRegistrationService"/>
38 - <service
39 - android:name="com.dieam.reactnativepushnotification.modules.RNPushNotificationListenerService"
40 - android:exported="false" >
41 - <intent-filter>
42 - <action android:name="com.google.android.c2dm.intent.RECEIVE" />
43 - </intent-filter>
44 - </service>
45 -
46 <activity 13 <activity
47 android:name=".MainActivity" 14 android:name=".MainActivity"
48 android:label="@string/app_name" 15 android:label="@string/app_name"
...@@ -54,9 +21,6 @@ ...@@ -54,9 +21,6 @@
54 </intent-filter> 21 </intent-filter>
55 </activity> 22 </activity>
56 <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" /> 23 <activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
57 -
58 </application> 24 </application>
59 25
60 -
61 -
62 </manifest> 26 </manifest>
......
1 -package com.fwiot; 1 +package com.testproject;
2 2
3 import com.facebook.react.ReactActivity; 3 import com.facebook.react.ReactActivity;
4 -import com.dieam.reactnativepushnotification.ReactNativePushNotificationPackage;
5 4
6 -public class MainActivity extends ReactActivity implements ReactApplication { 5 +public class MainActivity extends ReactActivity {
7 6
8 - private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
9 - @Override
10 - protected boolean getUseDeveloperSupport() {
11 - return BuildConfig.DEBUG;
12 - }
13 -
14 - @Override
15 - protected List<ReactPackage> getPackages() {
16 -
17 - return Arrays.<ReactPackage>asList(
18 - new MainReactPackage(),
19 - new ReactNativePushNotificationPackage() // <---- Add the Package
20 - );
21 - }
22 - };
23 /** 7 /**
24 * Returns the name of the main component registered from JavaScript. This is used to schedule 8 * Returns the name of the main component registered from JavaScript. This is used to schedule
25 * rendering of the component. 9 * rendering of the component.
26 */ 10 */
27 @Override 11 @Override
28 protected String getMainComponentName() { 12 protected String getMainComponentName() {
29 - return "FWIoT"; 13 + return "TestProject";
30 } 14 }
31 } 15 }
......
1 -package com.fwiot; 1 +package com.testproject;
2 2
3 import android.app.Application; 3 import android.app.Application;
4 import android.content.Context; 4 import android.content.Context;
......
1 <resources> 1 <resources>
2 - <string name="app_name">FWIoT</string> 2 + <string name="app_name">TestProject</string>
3 </resources> 3 </resources>
......
1 -rootProject.name = 'FWIoT' 1 +rootProject.name = 'TestProject'
2 apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 2 apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
3 include ':app' 3 include ':app'
4 -include ':react-native-push-notification'
5 -project(':react-native-push-notification').projectDir = file('../node_modules/react-native-push-notification/android')
......
1 { 1 {
2 - "name": "FWIoT", 2 + "name": "TestProject",
3 - "displayName": "FWIoT" 3 + "displayName": "TestProject"
4 } 4 }
...\ No newline at end of file ...\ No newline at end of file
......
No preview for this file type
1 -{"web":{"client_id":"978869138601-u3euf0c04sbdor68r30m599gilvjn91e.apps.googleusercontent.com","project_id":"reminder-talk","auth_uri":"https://accounts.google.com/o/oauth2/auth","token_uri":"https://oauth2.googleapis.com/token","auth_provider_x509_cert_url":"https://www.googleapis.com/oauth2/v1/certs","client_secret":"N7Uh_oVQZt-almzA4DkM4bm_"}}
...\ No newline at end of file ...\ No newline at end of file
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +
4 +export default class HomeTab extends Component {
5 + render() {
6 + return (
7 + <View style={style.container}>
8 + <Text>HistoryTab</Text>
9 + </View>
10 + );
11 + }
12 +}
13 +
14 +const style = StyleSheet.create({
15 + container: {
16 + flex: 1,
17 + alignItems: 'center',
18 + justifyContent: 'center',
19 + }
20 +});
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +import WasteDetail from '../WasteDetail'
4 +
5 +export default class HomeTab extends Component {
6 + render() {
7 + return (
8 + <View style={style.container}>
9 + <Text>HomeTab</Text>
10 + <WasteDetail></WasteDetail>
11 + </View>
12 + );
13 + }
14 +}
15 +
16 +const style = StyleSheet.create({
17 + container: {
18 + flex: 1,
19 + }
20 +});
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +
4 +export default class HomeTab extends Component {
5 + render() {
6 + return (
7 + <View style={style.container}>
8 + <Text>SettingTab</Text>
9 + </View>
10 + );
11 + }
12 +}
13 +
14 +const style = StyleSheet.create({
15 + container: {
16 + flex: 1,
17 + alignItems: 'center',
18 + justifyContent: 'center',
19 + }
20 +});
1 +import React, { Component } from 'react';
2 +import { StyleSheet, Platform, View, Text } from 'react-native';
3 +import { createAppContainer } from 'react-navigation';
4 +import { createMaterialTopTabNavigator } from 'react-navigation-tabs'
5 +import HomeTab from './AppTabNavigator/HomeTab'
6 +import HistoryTab from './AppTabNavigator/HistoryTab'
7 +import SettingTab from './AppTabNavigator/SettingTab'
8 +
9 +// 하단 탭 네비게이터 생성
10 +const AppTabNavigator = createMaterialTopTabNavigator({
11 + Home: { screen: HomeTab },
12 + History: { screen: HistoryTab },
13 + Setting: { screen: SettingTab }
14 +},{
15 + animationEnabled: true,
16 + swipeEnabled: true,
17 + tabBarPosition: "bottom",
18 + tabBarOptions: {
19 + style: {
20 + ...Platform.select({
21 + android:{
22 + backgroundColor:'white',
23 + }
24 + })
25 + },
26 + iconStyle: { height: 10 },
27 + activeTintColor: '#000',
28 + inactiveTintColor: '#d1cece',
29 + upperCaseLabel: true,
30 + showLabel: true,
31 + showIcon: true,
32 + }
33 +});
34 +
35 +const AppTabContainet = createAppContainer(AppTabNavigator);
36 +
37 +export default class MainScreen extends Component {
38 +
39 + static navigationOptions = {
40 + title: 'FW IOT' }
41 +
42 + render() {
43 + return <AppTabContainet/>; // AppTabContainet 컴포넌트를 리턴한다.
44 + }
45 +}
46 +
47 +const styles = StyleSheet.create({
48 + container: {
49 + flex: 1,
50 + alignItems: 'center',
51 + justifyContent: 'center',
52 + },
53 +});
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +
4 +export default class HomeTab extends Component {
5 + render() {
6 + return (
7 + <View style={style.container}>
8 + <Text> 3.8kg 추가</Text>
9 + </View>
10 + );
11 + }
12 +}
13 +
14 +const style = StyleSheet.create({
15 + container: {
16 + flex: 1,
17 + backgroundColor: "rgba(230,230,230,0.5)"
18 + }
19 +});
1 platform :ios, '9.0' 1 platform :ios, '9.0'
2 require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 2 require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
3 3
4 -target 'FWIoT' do 4 +target 'TestProject' do
5 - # Pods for FWIoT 5 + # Pods for TestProject
6 pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" 6 pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector"
7 pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" 7 pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec"
8 pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" 8 pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired"
...@@ -34,7 +34,8 @@ target 'FWIoT' do ...@@ -34,7 +34,8 @@ target 'FWIoT' do
34 pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 34 pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec'
35 pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 35 pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
36 36
37 - target 'FWIoTTests' do 37 +
38 + target 'TestProjectTests' do
38 inherit! :search_paths 39 inherit! :search_paths
39 # Pods for testing 40 # Pods for testing
40 end 41 end
...@@ -42,10 +43,10 @@ target 'FWIoT' do ...@@ -42,10 +43,10 @@ target 'FWIoT' do
42 use_native_modules! 43 use_native_modules!
43 end 44 end
44 45
45 -target 'FWIoT-tvOS' do 46 +target 'TestProject-tvOS' do
46 - # Pods for FWIoT-tvOS 47 + # Pods for TestProject-tvOS
47 48
48 - target 'FWIoT-tvOSTests' do 49 + target 'TestProject-tvOSTests' do
49 inherit! :search_paths 50 inherit! :search_paths
50 # Pods for testing 51 # Pods for testing
51 end 52 end
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
29 <BuildableReference 29 <BuildableReference
30 BuildableIdentifier = "primary" 30 BuildableIdentifier = "primary"
31 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" 31 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
32 - BuildableName = "FWIoT-tvOS.app" 32 + BuildableName = "TestProject-tvOS.app"
33 - BlueprintName = "FWIoT-tvOS" 33 + BlueprintName = "TestProject-tvOS"
34 - ReferencedContainer = "container:FWIoT.xcodeproj"> 34 + ReferencedContainer = "container:TestProject.xcodeproj">
35 </BuildableReference> 35 </BuildableReference>
36 </BuildActionEntry> 36 </BuildActionEntry>
37 <BuildActionEntry 37 <BuildActionEntry
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
43 <BuildableReference 43 <BuildableReference
44 BuildableIdentifier = "primary" 44 BuildableIdentifier = "primary"
45 BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7" 45 BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
46 - BuildableName = "FWIoT-tvOSTests.xctest" 46 + BuildableName = "TestProject-tvOSTests.xctest"
47 - BlueprintName = "FWIoT-tvOSTests" 47 + BlueprintName = "TestProject-tvOSTests"
48 - ReferencedContainer = "container:FWIoT.xcodeproj"> 48 + ReferencedContainer = "container:TestProject.xcodeproj">
49 </BuildableReference> 49 </BuildableReference>
50 </BuildActionEntry> 50 </BuildActionEntry>
51 </BuildActionEntries> 51 </BuildActionEntries>
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
61 <BuildableReference 61 <BuildableReference
62 BuildableIdentifier = "primary" 62 BuildableIdentifier = "primary"
63 BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7" 63 BlueprintIdentifier = "2D02E48F1E0B4A5D006451C7"
64 - BuildableName = "FWIoT-tvOSTests.xctest" 64 + BuildableName = "TestProject-tvOSTests.xctest"
65 - BlueprintName = "FWIoT-tvOSTests" 65 + BlueprintName = "TestProject-tvOSTests"
66 - ReferencedContainer = "container:FWIoT.xcodeproj"> 66 + ReferencedContainer = "container:TestProject.xcodeproj">
67 </BuildableReference> 67 </BuildableReference>
68 </TestableReference> 68 </TestableReference>
69 </Testables> 69 </Testables>
...@@ -71,9 +71,9 @@ ...@@ -71,9 +71,9 @@
71 <BuildableReference 71 <BuildableReference
72 BuildableIdentifier = "primary" 72 BuildableIdentifier = "primary"
73 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" 73 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
74 - BuildableName = "FWIoT-tvOS.app" 74 + BuildableName = "TestProject-tvOS.app"
75 - BlueprintName = "FWIoT-tvOS" 75 + BlueprintName = "TestProject-tvOS"
76 - ReferencedContainer = "container:FWIoT.xcodeproj"> 76 + ReferencedContainer = "container:TestProject.xcodeproj">
77 </BuildableReference> 77 </BuildableReference>
78 </MacroExpansion> 78 </MacroExpansion>
79 <AdditionalOptions> 79 <AdditionalOptions>
...@@ -94,9 +94,9 @@ ...@@ -94,9 +94,9 @@
94 <BuildableReference 94 <BuildableReference
95 BuildableIdentifier = "primary" 95 BuildableIdentifier = "primary"
96 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" 96 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
97 - BuildableName = "FWIoT-tvOS.app" 97 + BuildableName = "TestProject-tvOS.app"
98 - BlueprintName = "FWIoT-tvOS" 98 + BlueprintName = "TestProject-tvOS"
99 - ReferencedContainer = "container:FWIoT.xcodeproj"> 99 + ReferencedContainer = "container:TestProject.xcodeproj">
100 </BuildableReference> 100 </BuildableReference>
101 </BuildableProductRunnable> 101 </BuildableProductRunnable>
102 <AdditionalOptions> 102 <AdditionalOptions>
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
113 <BuildableReference 113 <BuildableReference
114 BuildableIdentifier = "primary" 114 BuildableIdentifier = "primary"
115 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7" 115 BlueprintIdentifier = "2D02E47A1E0B4A5D006451C7"
116 - BuildableName = "FWIoT-tvOS.app" 116 + BuildableName = "TestProject-tvOS.app"
117 - BlueprintName = "FWIoT-tvOS" 117 + BlueprintName = "TestProject-tvOS"
118 - ReferencedContainer = "container:FWIoT.xcodeproj"> 118 + ReferencedContainer = "container:TestProject.xcodeproj">
119 </BuildableReference> 119 </BuildableReference>
120 </BuildableProductRunnable> 120 </BuildableProductRunnable>
121 </ProfileAction> 121 </ProfileAction>
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
29 <BuildableReference 29 <BuildableReference
30 BuildableIdentifier = "primary" 30 BuildableIdentifier = "primary"
31 BlueprintIdentifier = "13B07F861A680F5B00A75B9A" 31 BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
32 - BuildableName = "FWIoT.app" 32 + BuildableName = "TestProject.app"
33 - BlueprintName = "FWIoT" 33 + BlueprintName = "TestProject"
34 - ReferencedContainer = "container:FWIoT.xcodeproj"> 34 + ReferencedContainer = "container:TestProject.xcodeproj">
35 </BuildableReference> 35 </BuildableReference>
36 </BuildActionEntry> 36 </BuildActionEntry>
37 <BuildActionEntry 37 <BuildActionEntry
...@@ -43,9 +43,9 @@ ...@@ -43,9 +43,9 @@
43 <BuildableReference 43 <BuildableReference
44 BuildableIdentifier = "primary" 44 BuildableIdentifier = "primary"
45 BlueprintIdentifier = "00E356ED1AD99517003FC87E" 45 BlueprintIdentifier = "00E356ED1AD99517003FC87E"
46 - BuildableName = "FWIoTTests.xctest" 46 + BuildableName = "TestProjectTests.xctest"
47 - BlueprintName = "FWIoTTests" 47 + BlueprintName = "TestProjectTests"
48 - ReferencedContainer = "container:FWIoT.xcodeproj"> 48 + ReferencedContainer = "container:TestProject.xcodeproj">
49 </BuildableReference> 49 </BuildableReference>
50 </BuildActionEntry> 50 </BuildActionEntry>
51 </BuildActionEntries> 51 </BuildActionEntries>
...@@ -61,9 +61,9 @@ ...@@ -61,9 +61,9 @@
61 <BuildableReference 61 <BuildableReference
62 BuildableIdentifier = "primary" 62 BuildableIdentifier = "primary"
63 BlueprintIdentifier = "00E356ED1AD99517003FC87E" 63 BlueprintIdentifier = "00E356ED1AD99517003FC87E"
64 - BuildableName = "FWIoTTests.xctest" 64 + BuildableName = "TestProjectTests.xctest"
65 - BlueprintName = "FWIoTTests" 65 + BlueprintName = "TestProjectTests"
66 - ReferencedContainer = "container:FWIoT.xcodeproj"> 66 + ReferencedContainer = "container:TestProject.xcodeproj">
67 </BuildableReference> 67 </BuildableReference>
68 </TestableReference> 68 </TestableReference>
69 </Testables> 69 </Testables>
...@@ -71,9 +71,9 @@ ...@@ -71,9 +71,9 @@
71 <BuildableReference 71 <BuildableReference
72 BuildableIdentifier = "primary" 72 BuildableIdentifier = "primary"
73 BlueprintIdentifier = "13B07F861A680F5B00A75B9A" 73 BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
74 - BuildableName = "FWIoT.app" 74 + BuildableName = "TestProject.app"
75 - BlueprintName = "FWIoT" 75 + BlueprintName = "TestProject"
76 - ReferencedContainer = "container:FWIoT.xcodeproj"> 76 + ReferencedContainer = "container:TestProject.xcodeproj">
77 </BuildableReference> 77 </BuildableReference>
78 </MacroExpansion> 78 </MacroExpansion>
79 <AdditionalOptions> 79 <AdditionalOptions>
...@@ -94,9 +94,9 @@ ...@@ -94,9 +94,9 @@
94 <BuildableReference 94 <BuildableReference
95 BuildableIdentifier = "primary" 95 BuildableIdentifier = "primary"
96 BlueprintIdentifier = "13B07F861A680F5B00A75B9A" 96 BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
97 - BuildableName = "FWIoT.app" 97 + BuildableName = "TestProject.app"
98 - BlueprintName = "FWIoT" 98 + BlueprintName = "TestProject"
99 - ReferencedContainer = "container:FWIoT.xcodeproj"> 99 + ReferencedContainer = "container:TestProject.xcodeproj">
100 </BuildableReference> 100 </BuildableReference>
101 </BuildableProductRunnable> 101 </BuildableProductRunnable>
102 <AdditionalOptions> 102 <AdditionalOptions>
...@@ -113,9 +113,9 @@ ...@@ -113,9 +113,9 @@
113 <BuildableReference 113 <BuildableReference
114 BuildableIdentifier = "primary" 114 BuildableIdentifier = "primary"
115 BlueprintIdentifier = "13B07F861A680F5B00A75B9A" 115 BlueprintIdentifier = "13B07F861A680F5B00A75B9A"
116 - BuildableName = "FWIoT.app" 116 + BuildableName = "TestProject.app"
117 - BlueprintName = "FWIoT" 117 + BlueprintName = "TestProject"
118 - ReferencedContainer = "container:FWIoT.xcodeproj"> 118 + ReferencedContainer = "container:TestProject.xcodeproj">
119 </BuildableReference> 119 </BuildableReference>
120 </BuildableProductRunnable> 120 </BuildableProductRunnable>
121 </ProfileAction> 121 </ProfileAction>
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 { 17 {
18 RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 18 RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions];
19 RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 19 RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge
20 - moduleName:@"FWIoT" 20 + moduleName:@"TestProject"
21 initialProperties:nil]; 21 initialProperties:nil];
22 22
23 rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 23 rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
18 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 18 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
19 <nil key="highlightedColor"/> 19 <nil key="highlightedColor"/>
20 </label> 20 </label>
21 - <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="FWIoT" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX"> 21 + <label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="TestProject" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="kId-c2-rCX">
22 <rect key="frame" x="20" y="140" width="441" height="43"/> 22 <rect key="frame" x="20" y="140" width="441" height="43"/>
23 <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/> 23 <fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
24 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/> 24 <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
5 <key>CFBundleDevelopmentRegion</key> 5 <key>CFBundleDevelopmentRegion</key>
6 <string>en</string> 6 <string>en</string>
7 <key>CFBundleDisplayName</key> 7 <key>CFBundleDisplayName</key>
8 - <string>FWIoT</string> 8 + <string>TestProject</string>
9 <key>CFBundleExecutable</key> 9 <key>CFBundleExecutable</key>
10 <string>$(EXECUTABLE_NAME)</string> 10 <string>$(EXECUTABLE_NAME)</string>
11 <key>CFBundleIdentifier</key> 11 <key>CFBundleIdentifier</key>
...@@ -54,8 +54,6 @@ ...@@ -54,8 +54,6 @@
54 <key>UIViewControllerBasedStatusBarAppearance</key> 54 <key>UIViewControllerBasedStatusBarAppearance</key>
55 <false/> 55 <false/>
56 <key>UIAppFonts</key> 56 <key>UIAppFonts</key>
57 - <array> 57 + <array/>
58 - <string>BMJUA_ttf.ttf</string>
59 - </array>
60 </dict> 58 </dict>
61 </plist> 59 </plist>
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
14 #define TIMEOUT_SECONDS 600 14 #define TIMEOUT_SECONDS 600
15 #define TEXT_TO_LOOK_FOR @"Welcome to React" 15 #define TEXT_TO_LOOK_FOR @"Welcome to React"
16 16
17 -@interface FWIoTTests : XCTestCase 17 +@interface TestProjectTests : XCTestCase
18 18
19 @end 19 @end
20 20
21 -@implementation FWIoTTests 21 +@implementation TestProjectTests
22 22
23 - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 23 - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
24 { 24 {
......
This diff could not be displayed because it is too large.
1 { 1 {
2 - "name": "FWIoT", 2 + "name": "TestProject",
3 "version": "0.0.1", 3 "version": "0.0.1",
4 "private": true, 4 "private": true,
5 "scripts": { 5 "scripts": {
...@@ -11,20 +11,24 @@ ...@@ -11,20 +11,24 @@
11 }, 11 },
12 "dependencies": { 12 "dependencies": {
13 "react": "16.9.0", 13 "react": "16.9.0",
14 - "react-native": "0.61.5", 14 + "react-native": "0.61.4",
15 - "react-native-gesture-handler": "^1.5.2", 15 + "react-native-gesture-handler": "^1.5.0",
16 - "react-native-push-notification": "^3.1.9", 16 + "react-native-reanimated": "^1.4.0",
17 + "react-native-screens": "^2.0.0-alpha.8",
18 + "react-native-vector-icons": "^6.6.0",
17 "react-navigation": "^4.0.10", 19 "react-navigation": "^4.0.10",
18 - "react-navigation-stack": "^1.10.3" 20 + "react-navigation-drawer": "^2.3.3",
21 + "react-navigation-stack": "^1.10.3",
22 + "react-navigation-tabs": "^2.5.6"
19 }, 23 },
20 "devDependencies": { 24 "devDependencies": {
21 - "@babel/core": "^7.6.2", 25 + "@babel/core": "^7.7.2",
22 - "@babel/runtime": "^7.6.2", 26 + "@babel/runtime": "^7.7.2",
23 "@react-native-community/eslint-config": "^0.0.5", 27 "@react-native-community/eslint-config": "^0.0.5",
24 "babel-jest": "^24.9.0", 28 "babel-jest": "^24.9.0",
25 - "eslint": "^6.5.1", 29 + "eslint": "^6.6.0",
26 "jest": "^24.9.0", 30 "jest": "^24.9.0",
27 - "metro-react-native-babel-preset": "^0.56.0", 31 + "metro-react-native-babel-preset": "^0.57.0",
28 "react-test-renderer": "16.9.0" 32 "react-test-renderer": "16.9.0"
29 }, 33 },
30 "jest": { 34 "jest": {
......
1 -var fs = require('fs');
2 -var readline = require('readline');
3 -var google = require('googleapis');
4 -var googleAuth = require('google-auth-library');
5 -
6 -var SCOPES = [
7 - 'https://www.googleapis.com/auth/calendar.readonly', // 캘린더 정보의 읽기 권한? 입니다.
8 - 'https://www.googleapis.com/auth/calendar' // 캘린더 정보의 편집 권한? 입니다.
9 - ];
10 -
11 -var TOKEN_DIR = (process.env.HOME || process.env.HOMEPATH ||
12 - process.env.USERPROFILE) + '/.credentials/';
13 -// 토큰이 저장될 디렉토리
14 -var TOKEN_PATH = TOKEN_DIR + 'calendar-nodejs-quickstart.json';
15 -// 토큰 파일 명
16 -
17 -fs.readFile('client_secret.json', function processClientSecrets(err, content) {
18 - // 로컬의 client_secret.json 파일을 읽고 'authorize' 함수 실행
19 - if (err) {
20 - console.log('Error loading client secret file: ' + err);
21 - return;
22 - }
23 - authorize(JSON.parse(content), listEvents);
24 -});
25 -
26 -function authorize(credentials, callback) {
27 - var clientSecret = credentials.web.client_secret;
28 - var clientId = credentials.web.client_id;
29 - var redirectUrl = credentials.web.auth_provider_x509_cert_url;
30 - // client_secret.json 파일에서 시크릿키, 클라이언트 아이디, 리다이렉트 URI를 받습니다.
31 - // 웹 어플리케이션으로 만들었을 때에는 'installed' -> 'web' 으로 수정합니다.
32 - // ex 'var clientSecret = credentials.web.client_secret;'
33 -
34 - var auth = new googleAuth();
35 - var oauth2Client = new auth.OAuth2(clientId, clientSecret, redirectUrl);
36 -
37 - fs.readFile(TOKEN_PATH, function(err, token) {
38 - // 앞서 지정한 디렉토리와 파일명으로 토큰 파일을 읽습니다.
39 - if (err) {
40 - getNewToken(oauth2Client, callback); // 토큰이 없다면 만듭니다.
41 - } else {
42 - oauth2Client.credentials = JSON.parse(token); // 토큰이 있다면 정보를 객체에 담습니다.
43 - callback(oauth2Client);
44 - }
45 - });
46 -}
47 -
48 -function getNewToken(oauth2Client, callback) {
49 - var authUrl = oauth2Client.generateAuthUrl({
50 - access_type: 'offline',
51 - scope: SCOPES
52 - });
53 -
54 - // 브라우저에 'authUrl'의 링크로 접근하여 데이터 접근에 동의한 후 리다이렉트 되는 URL의
55 - // 'code=' 다음 부분을 복사합니다.
56 - console.log('Authorize this app by visiting this url: ', authUrl);
57 - var rl = readline.createInterface({
58 - input: process.stdin,
59 - output: process.stdout
60 - });
61 - // 복사한 'code=' 다음 부분을 입력합니다.
62 - // 로컬에서 테스트 할때에는 code= 다음 부분의 값이 URL 인코딩이 되어 있을 수 있으니
63 - // URL 디코딩한 후에 입력합니다.
64 - rl.question('Enter the code from that page here: ', function(code) {
65 - rl.close();
66 - oauth2Client.getToken(code, function(err, token) {
67 - if (err) {
68 - console.log('Error while trying to retrieve access token', err);
69 - return;
70 - }
71 - oauth2Client.credentials = token;
72 - storeToken(token);
73 - callback(oauth2Client);
74 - });
75 - });
76 -}
77 -
78 -function storeToken(token) {
79 - try {
80 - fs.mkdirSync(TOKEN_DIR);
81 - } catch (err) {
82 - if (err.code != 'EEXIST') {
83 - throw err;
84 - }
85 - }
86 - fs.writeFile(TOKEN_PATH, JSON.stringify(token)); // 토큰을 만듭니다.
87 - console.log('Token stored to ' + TOKEN_PATH);
88 -}
89 -
90 -function listEvents(auth) {
91 - // 토큰 인증이 완료되면 최종적으로 실행되는 함수 입니다.
92 - // 아래의 예제는 구글 캘린더에 등록된 이벤트 10개의 정보를 출력합니다.
93 - var calendar = google.calendar('v3');
94 -
95 - calendar.events.list({
96 - auth: auth,
97 - calendarId: 'primary', // 이곳에 이벤트를 가져올 캘린더 id를 입력해야 합니다.
98 - timeMin: (new Date()).toISOString(),
99 - maxResults: 10,
100 - singleEvents: true,
101 - orderBy: 'startTime'
102 - }, function(err, response) {
103 - if (err) {
104 - console.log('The API returned an error: ' + err);
105 - return;
106 - }
107 - var events = response.items;
108 - if (events.length == 0) {
109 - console.log('No upcoming events found.');
110 - } else {
111 - console.log('Upcoming 10 events:');
112 - for (var i = 0; i < events.length; i++) {
113 - var event = events[i];
114 - var start = event.start.dateTime || event.start.date;
115 - console.log('%s - %s', start, event.summary);
116 - }
117 - }
118 - });
119 -
120 -
121 - // 다음은 구글 캘린더에 'CHEOLGUSO' 라는 이름의 캘린더가 있는지 확인하여
122 - // 없다면 만들고 있다면 삭제해보겠습니다.
123 - calendar.calendarList.list({
124 - auth : auth
125 - }, function(err, calendarList){
126 - if(err) console.log(err);
127 -
128 - var deleteCalendarId; // 캘린더 삭제를 위한 아이디 변수
129 - var isCGSCalendar = false; // 'CHEOLGUSO' 캘린더가 존재하는지 확인하기 위한 변수
130 -
131 - // 'CHEOLGUSO' 캘린더가 있는지 확인
132 - for(var i=0; i<calendarList.items.length; i++){
133 - if(calendarList.items[i].summary === 'CHEOLGUSO'){
134 - isCGSCalendar = true;
135 - deleteCalendarId = calendarList.items[i].id;
136 - }
137 - }
138 -
139 - if(isCGSCalendar){
140 -
141 - // 'CHEOLGUSO' 캘린더가 있다면 캘린더를 지움
142 - calendar.calendars.delete({
143 - auth : auth,
144 - calendarId : deleteCalendarId
145 - }, function(err, calendars){
146 - if(err) console.log(err);
147 - });
148 -
149 - }else{
150 -
151 - // 'CHEOLGUSO' 캘린더가 없다면 캘린더를 만듬
152 - calendar.calendars.insert({
153 - auth : auth,
154 - resource : {
155 - summary : 'CHEOLGUSO'
156 - }
157 - }, function(err, calendars){
158 - if(err) console.log(err);
159 - });
160 -
161 - }
162 -
163 - });
164 -
165 -
166 -}
...\ No newline at end of file ...\ No newline at end of file
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +
4 +export default class HomeTab extends Component {
5 + render() {
6 + return (
7 + <View style={style.container}>
8 + <Text>HistoryTab</Text>
9 + </View>
10 + );
11 + }
12 +}
13 +
14 +const style = StyleSheet.create({
15 + container: {
16 + flex: 1,
17 + alignItems: 'center',
18 + justifyContent: 'center',
19 + }
20 +});
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +import WasteDetail from '../WasteDetail'
4 +
5 +export default class HomeTab extends Component {
6 + render() {
7 + return (
8 + <View style={style.container}>
9 + <Text>HomeTab</Text>
10 + <WasteDetail></WasteDetail>
11 + </View>
12 + );
13 + }
14 +}
15 +
16 +const style = StyleSheet.create({
17 + container: {
18 + flex: 1,
19 + }
20 +});
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +
4 +export default class HomeTab extends Component {
5 + render() {
6 + return (
7 + <View style={style.container}>
8 + <Text>SettingTab</Text>
9 + </View>
10 + );
11 + }
12 +}
13 +
14 +const style = StyleSheet.create({
15 + container: {
16 + flex: 1,
17 + alignItems: 'center',
18 + justifyContent: 'center',
19 + }
20 +});
...@@ -19,7 +19,7 @@ export default class Login extends Component { ...@@ -19,7 +19,7 @@ export default class Login extends Component {
19 <View style={styles.container}> 19 <View style={styles.container}>
20 <View style={styles.header}> 20 <View style={styles.header}>
21 <Text 21 <Text
22 - style={{textAlign : 'center', fontSize : 50, fontFamily : "BMJUA_ttf", marginTop:50}}>FW IoT</Text> 22 + style={{textAlign : 'center', fontSize : 50, marginTop:50}}>FW IoT</Text>
23 </View> 23 </View>
24 <View style={styles.logo}> 24 <View style={styles.logo}>
25 <Image 25 <Image
...@@ -30,9 +30,9 @@ export default class Login extends Component { ...@@ -30,9 +30,9 @@ export default class Login extends Component {
30 <View 30 <View
31 style={StyleSheet.inputPart}> 31 style={StyleSheet.inputPart}>
32 <Text 32 <Text
33 - style={{textAlign:'center',fontSize : 40, marginTop :20, fontFamily : "BMJUA_ttf"}}>Food Waste IoT</Text> 33 + style={{textAlign:'center',fontSize : 40, marginTop :20}}>Food Waste IoT</Text>
34 <Text 34 <Text
35 - style={{textAlign:'center',fontSize : 15, marginTop :20, fontFamily : "BMJUA_ttf"}}>기기 등록</Text> 35 + style={{textAlign:'center',fontSize : 15, marginTop :20}}>기기 등록</Text>
36 <TextInput 36 <TextInput
37 style={styles.input} 37 style={styles.input}
38 placeholder="ID" 38 placeholder="ID"
......
1 -import React, { Component, Notifications } from 'react'; 1 +import React, { Component } from 'react';
2 -import { StyleSheet, Text, View, TextInput, Image, } from 'react-native'; 2 +import { StyleSheet, Platform, View, Text } from 'react-native';
3 +import { createAppContainer } from 'react-navigation';
4 +import { createMaterialTopTabNavigator } from 'react-navigation-tabs'
5 +import HomeTab from './AppTabNavigator/HomeTab'
6 +import HistoryTab from './AppTabNavigator/HistoryTab'
7 +import SettingTab from './AppTabNavigator/SettingTab'
8 +
9 +// 하단 탭 네비게이터 생성
10 +const AppTabNavigator = createMaterialTopTabNavigator({
11 + Home: { screen: HomeTab },
12 + History: { screen: HistoryTab },
13 + Setting: { screen: SettingTab }
14 +},{
15 + animationEnabled: true,
16 + swipeEnabled: true,
17 + tabBarPosition: "bottom",
18 + tabBarOptions: {
19 + style: {
20 + ...Platform.select({
21 + android:{
22 + backgroundColor:'white',
23 + }
24 + })
25 + },
26 + iconStyle: { height: 10 },
27 + activeTintColor: '#000',
28 + inactiveTintColor: '#d1cece',
29 + upperCaseLabel: true,
30 + showLabel: true,
31 + showIcon: true,
32 + }
33 +});
3 34
4 -export default class Login extends Component { 35 +const AppTabContainet = createAppContainer(AppTabNavigator);
36 +
37 +export default class MainScreen extends Component {
5 38
6 constructor(props) { 39 constructor(props) {
7 super(props); 40 super(props);
...@@ -9,82 +42,19 @@ export default class Login extends Component { ...@@ -9,82 +42,19 @@ export default class Login extends Component {
9 ID: this.props.navigation.getParam('ID'), 42 ID: this.props.navigation.getParam('ID'),
10 }; 43 };
11 } 44 }
45 +
12 static navigationOptions = { 46 static navigationOptions = {
13 - title: 'MainScreen', 47 + title: 'FW IOT' }
14 - };
15 48
16 render() { 49 render() {
17 - return ( 50 + return <AppTabContainet/>; // AppTabContainet 컴포넌트를 리턴한다.
18 - <View style={styles.container}>
19 - <View style={styles.header}>
20 - <Text>{this.state.ID}</Text>
21 - </View>
22 - </View>
23 - );
24 } 51 }
25 } 52 }
26 53
27 -var PushNotification = require('react-native-push-notification');
28 -
29 -PushNotification.configure({
30 -
31 - // (optional) Called when Token is generated (iOS and Android)
32 - onRegister: function(token) {
33 - console.log( 'TOKEN:', token );
34 - },
35 -
36 - // (required) Called when a remote or local notification is opened or received
37 - onNotification: function(notification) {
38 - console.log( 'NOTIFICATION:', notification );
39 - },
40 -
41 - // ANDROID ONLY: GCM Sender ID (optional - not required for local notifications, but is need to receive remote push notifications)
42 - senderID: "YOUR GCM SENDER ID",
43 -
44 - // IOS ONLY (optional): default: all - Permissions to register.
45 - permissions: {
46 - alert: true,
47 - badge: true,
48 - sound: true
49 - },
50 -
51 - // Should the initial notification be popped automatically
52 - // default: true
53 - popInitialNotification: true,
54 -
55 - /**
56 - * (optional) default: true
57 - * - Specified if permissions (ios) and token (android and ios) will requested or not,
58 - * - if not, you must call PushNotificationsHandler.requestPermissions() later
59 - */
60 - requestPermissions: true,
61 -});
62 -
63 const styles = StyleSheet.create({ 54 const styles = StyleSheet.create({
64 - input: {
65 - height: 50,
66 - width: 250,
67 - fontSize: 0,
68 - alignSelf: 'center',
69 - borderRadius: 1,
70 - borderStyle: 'dotted',
71 - borderBottomColor: "#0066cc",
72 - borderBottomWidth: 2,
73 - },
74 container: { 55 container: {
75 flex: 1, 56 flex: 1,
76 - backgroundColor: 'white', 57 + alignItems: 'center',
77 - }, 58 + justifyContent: 'center',
78 - header: {
79 - flex: 2,
80 - backgroundColor: 'white',
81 - },
82 - logo: {
83 - flex: 4,
84 - backgroundColor: 'white',
85 - },
86 - inputPart: {
87 - flex: 4,
88 - backgroundColor: 'white',
89 }, 59 },
90 }); 60 });
......
1 +import React, { Component } from 'react';
2 +import { View, Text, StyleSheet } from 'react-native';
3 +
4 +export default class HomeTab extends Component {
5 + render() {
6 + return (
7 + <View style={style.container}>
8 + <Text> 3.8kg 추가</Text>
9 + </View>
10 + );
11 + }
12 +}
13 +
14 +const style = StyleSheet.create({
15 + container: {
16 + flex: 1,
17 + backgroundColor: "rgba(230,230,230,0.5)"
18 + }
19 +});
This diff could not be displayed because it is too large.