YoonyoungL

Replace project

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