Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Added realms
Browse files Browse the repository at this point in the history
  • Loading branch information
whs committed May 2, 2016
1 parent b704a9c commit 7d951d2
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 5 deletions.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ android {
}

dependencies {
compile project(':realm')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/koandeck/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.content.Intent;
import android.content.res.Configuration;
import com.facebook.react.ReactActivity;
import io.realm.react.RealmReactPackage;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.github.yamill.orientation.OrientationPackage;
Expand Down Expand Up @@ -38,6 +39,7 @@ protected boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RealmReactPackage(),
new OrientationPackage(this)
);
}
Expand Down
1 change: 1 addition & 0 deletions android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<resources>

<string name="app_name">koandeck</string>
</resources>
6 changes: 4 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
rootProject.name = 'koandeck'

include ':app'
include ':Orientation', ':app'
project(':Orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation/android')
include ':realm'
project(':realm').projectDir = new File(rootProject.projectDir, '../node_modules/realm/android')
include ':Orientation'
project(':Orientation').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-orientation/android')
24 changes: 24 additions & 0 deletions components/models.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import Realms from 'realm';

export default new Realm({
schema: [
{
name: 'Document',
properties: {
name: 'string',
slides: {type: 'list', objectType: 'Slide'},
}
},
{
name: 'Slide',
properties: {
text1: 'string',
text2: 'string',
text1Color: 'string',
text2Color: 'string',
image: 'string',
layout: 'int',
}
}
]
});
37 changes: 35 additions & 2 deletions ios/koandeck.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
};
objectVersion = 46;
objects = {

/* Begin PBXBuildFile section */
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
Expand All @@ -22,6 +21,9 @@
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
BEBFD3F81CA9504500B2BAD7 /* Orientation.m in Sources */ = {isa = PBXBuildFile; fileRef = BEBFD3F71CA9504500B2BAD7 /* Orientation.m */; };
32904D0CFE024B09A25077CC /* libRealmReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25CCC9171028478882ACD222 /* libRealmReact.a */; };
44639F57D9634963BEB36B6A /* libc++.tbd in Resources */ = {isa = PBXBuildFile; fileRef = BDB100F5F46A4FC1ACD8E370 /* libc++.tbd */; };
7DC7FF86D2DA46A6842754F1 /* libz.tbd in Resources */ = {isa = PBXBuildFile; fileRef = 98659FC36D8042E2964D4BF1 /* libz.tbd */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -120,6 +122,10 @@
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
BEBFD3F61CA9504500B2BAD7 /* Orientation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Orientation.h; sourceTree = "<group>"; };
BEBFD3F71CA9504500B2BAD7 /* Orientation.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Orientation.m; sourceTree = "<group>"; };
D1B66430C7024040B4FA45FA /* RealmReact.xcodeproj */ = {isa = PBXFileReference; name = "RealmReact.xcodeproj"; path = "../node_modules/realm/react-native/ios/RealmReact.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
25CCC9171028478882ACD222 /* libRealmReact.a */ = {isa = PBXFileReference; name = "libRealmReact.a"; path = "libRealmReact.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
BDB100F5F46A4FC1ACD8E370 /* libc++.tbd */ = {isa = PBXFileReference; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; };
98659FC36D8042E2964D4BF1 /* libz.tbd */ = {isa = PBXFileReference; name = "libz.tbd"; path = "usr/lib/libz.tbd"; sourceTree = SDKROOT; fileEncoding = undefined; lastKnownFileType = sourcecode.text-based-dylib-definition; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -137,6 +143,9 @@
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */,
00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */,
139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */,
32904D0CFE024B09A25077CC /* libRealmReact.a in Frameworks */,
44639F57D9634963BEB36B6A /* libc++.tbd in Resources */,
7DC7FF86D2DA46A6842754F1 /* libz.tbd in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -259,6 +268,7 @@
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */,
00C302DF1ABCB9EE00DB3ED1 /* RCTVibration.xcodeproj */,
139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */,
D1B66430C7024040B4FA45FA /* RealmReact.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
Expand All @@ -279,6 +289,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */,
00E356EF1AD99517003FC87E /* koandeckTests */,
83CBBA001A601CBA00E9B192 /* Products */,
CB785603E47A489DA53253EE /* Frameworks */,
);
indentWidth = 2;
sourceTree = "<group>";
Expand All @@ -301,6 +312,16 @@
path = RCTOrientation;
sourceTree = "<group>";
};
CB785603E47A489DA53253EE /* Frameworks */ = {
isa = PBXGroup;
children = (
BDB100F5F46A4FC1ACD8E370 /* libc++.tbd */,
98659FC36D8042E2964D4BF1 /* libz.tbd */,
);
name = Frameworks;
path = "";
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -328,7 +349,7 @@
83CBB9F71A601CBA00E9B192 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0610;
LastUpgradeCheck = 610;
ORGANIZATIONNAME = Facebook;
TargetAttributes = {
13B07F861A680F5B00A75B9A = {
Expand Down Expand Up @@ -534,13 +555,18 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/realm/src/**",
);
INFOPLIST_FILE = koandeck/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = th.in.whs.koandeck;
PRODUCT_NAME = "Koan Deck";
TARGETED_DEVICE_FAMILY = "1,2";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Koan Deck\"",
);
};
name = Debug;
};
Expand All @@ -553,13 +579,18 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/realm/src/**",
);
INFOPLIST_FILE = koandeck/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_BUNDLE_IDENTIFIER = th.in.whs.koandeck;
PRODUCT_NAME = "Koan Deck";
TARGETED_DEVICE_FAMILY = "1,2";
LIBRARY_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)/Koan Deck\"",
);
};
name = Release;
};
Expand Down Expand Up @@ -601,6 +632,7 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/realm/src/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = YES;
Expand Down Expand Up @@ -641,6 +673,7 @@
"$(inherited)",
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
"$(SRCROOT)/../node_modules/react-native/React/**",
"$(SRCROOT)/../node_modules/realm/src/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
MTL_ENABLE_DEBUG_INFO = NO;
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"react-native-grid-view": "^0.3.7",
"react-native-nav": "^1.0.9",
"react-native-orientation": "^1.16.0",
"react-native-page-swiper": "^0.1.0"
"react-native-page-swiper": "^0.1.0",
"realm": "^0.11.1"
}
}

0 comments on commit 7d951d2

Please sign in to comment.