Skip to content

Commit 94e3279

Browse files
committed
update Example with v1.1.9
1 parent 8801454 commit 94e3279

File tree

12 files changed

+92
-32
lines changed

12 files changed

+92
-32
lines changed

Example/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["react-native"]
3+
}

Example/.flowconfig

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
11
[ignore]
22

33
# We fork some components by platform.
4-
.*/*.android.js
4+
.*/*[.]android.js
55

66
# Ignore templates with `@flow` in header
77
.*/local-cli/generator.*
88

99
# Ignore malformed json
1010
.*/node_modules/y18n/test/.*\.json
1111

12+
# Ignore the website subdir
13+
<PROJECT_ROOT>/website/.*
14+
15+
# Ignore BUCK generated dirs
16+
<PROJECT_ROOT>/\.buckd/
17+
18+
# Ignore unexpected extra @providesModule
19+
.*/node_modules/commoner/test/source/widget/share.js
20+
21+
# Ignore duplicate module providers
22+
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
23+
.*/Libraries/react-native/React.js
24+
.*/Libraries/react-native/ReactNative.js
25+
.*/node_modules/jest-runtime/build/__tests__/.*
26+
1227
[include]
1328

1429
[libs]
@@ -33,9 +48,11 @@ suppress_type=$FlowIssue
3348
suppress_type=$FlowFixMe
3449
suppress_type=$FixMe
3550

36-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
37-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
51+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-2]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-2]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
3853
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
3954

55+
unsafe.enable_getters_and_setters=true
56+
4057
[version]
41-
^0.27.0
58+
^0.32.0

Example/__tests__/index.android.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'react-native';
2+
import React from 'react';
3+
import Index from '../index.android.js';
4+
5+
// Note: test renderer must be required after react-native.
6+
import renderer from 'react-test-renderer';
7+
8+
it('renders correctly', () => {
9+
const tree = renderer.create(
10+
<Index />
11+
);
12+
});

Example/__tests__/index.ios.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import 'react-native';
2+
import React from 'react';
3+
import Index from '../index.ios.js';
4+
5+
// Note: test renderer must be required after react-native.
6+
import renderer from 'react-test-renderer';
7+
8+
it('renders correctly', () => {
9+
const tree = renderer.create(
10+
<Index />
11+
);
12+
});

Example/android/app/BUCK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import re
55
# - install Buck
66
# - `npm start` - to start the packager
77
# - `cd android`
8-
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US`
8+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
99
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
1010
# - `buck install -r android/app` - compile, install and run application
1111
#

Example/index.android.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
View
1313
} from 'react-native';
1414

15-
class Example extends Component {
15+
export default class Example extends Component {
1616
render() {
1717
return (
1818
<View style={styles.container}>
@@ -23,6 +23,7 @@ class Example extends Component {
2323
To get started, edit index.android.js
2424
</Text>
2525
<Text style={styles.instructions}>
26+
Double tap R on your keyboard to reload,{'\n'}
2627
Shake or press menu button for dev menu
2728
</Text>
2829
</View>

Example/index.ios.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414

1515
import CameraRollPicker from 'react-native-camera-roll-picker';
1616

17-
class Example extends Component {
17+
export default class Example extends Component {
1818
constructor(props) {
1919
super(props);
2020

@@ -48,10 +48,10 @@ class Example extends Component {
4848
scrollRenderAheadDistance={500}
4949
initialListSize={1}
5050
pageSize={3}
51-
removeClippedSubviews={true}
51+
removeClippedSubviews={false}
5252
groupTypes='SavedPhotos'
5353
batchSize={5}
54-
maximum={5}
54+
maximum={3}
5555
selected={this.state.selected}
5656
assetType='Photos'
5757
imagesPerRow={3}

Example/ios/Example.xcodeproj/project.pbxproj

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2424
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
2525
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
26-
BC334C061D38D79200B3C48C /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BC334BFC1D38D78400B3C48C /* libRCTCameraRoll.a */; };
26+
BC6A3A6D1DBDFA0C007AFF2A /* libRCTCameraRoll.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BC6A3A631DBDFA04007AFF2A /* libRCTCameraRoll.a */; };
2727
/* End PBXBuildFile section */
2828

2929
/* Begin PBXContainerItemProxy section */
@@ -104,9 +104,9 @@
104104
remoteGlobalIDString = 58B5119B1A9E6C1200147676;
105105
remoteInfo = RCTText;
106106
};
107-
BC334BFB1D38D78400B3C48C /* PBXContainerItemProxy */ = {
107+
BC6A3A621DBDFA04007AFF2A /* PBXContainerItemProxy */ = {
108108
isa = PBXContainerItemProxy;
109-
containerPortal = BC334BF61D38D78400B3C48C /* RCTCameraRoll.xcodeproj */;
109+
containerPortal = BC6A3A5D1DBDFA04007AFF2A /* RCTCameraRoll.xcodeproj */;
110110
proxyType = 2;
111111
remoteGlobalIDString = 58B5115D1A9E6B3D00147676;
112112
remoteInfo = RCTCameraRoll;
@@ -135,7 +135,7 @@
135135
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
136136
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
137137
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
138-
BC334BF61D38D78400B3C48C /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTCameraRoll.xcodeproj; path = "../node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj"; sourceTree = "<group>"; };
138+
BC6A3A5D1DBDFA04007AFF2A /* RCTCameraRoll.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTCameraRoll.xcodeproj; path = "../node_modules/react-native/Libraries/CameraRoll/RCTCameraRoll.xcodeproj"; sourceTree = "<group>"; };
139139
/* End PBXFileReference section */
140140

141141
/* Begin PBXFrameworksBuildPhase section */
@@ -151,7 +151,7 @@
151151
isa = PBXFrameworksBuildPhase;
152152
buildActionMask = 2147483647;
153153
files = (
154-
BC334C061D38D79200B3C48C /* libRCTCameraRoll.a in Frameworks */,
154+
BC6A3A6D1DBDFA0C007AFF2A /* libRCTCameraRoll.a in Frameworks */,
155155
146834051AC3E58100842450 /* libReact.a in Frameworks */,
156156
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
157157
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
@@ -274,7 +274,7 @@
274274
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
275275
isa = PBXGroup;
276276
children = (
277-
BC334BF61D38D78400B3C48C /* RCTCameraRoll.xcodeproj */,
277+
BC6A3A5D1DBDFA04007AFF2A /* RCTCameraRoll.xcodeproj */,
278278
146833FF1AC3E56700842450 /* React.xcodeproj */,
279279
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
280280
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
@@ -318,10 +318,10 @@
318318
name = Products;
319319
sourceTree = "<group>";
320320
};
321-
BC334BF71D38D78400B3C48C /* Products */ = {
321+
BC6A3A5E1DBDFA04007AFF2A /* Products */ = {
322322
isa = PBXGroup;
323323
children = (
324-
BC334BFC1D38D78400B3C48C /* libRCTCameraRoll.a */,
324+
BC6A3A631DBDFA04007AFF2A /* libRCTCameraRoll.a */,
325325
);
326326
name = Products;
327327
sourceTree = "<group>";
@@ -397,8 +397,8 @@
397397
ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */;
398398
},
399399
{
400-
ProductGroup = BC334BF71D38D78400B3C48C /* Products */;
401-
ProjectRef = BC334BF61D38D78400B3C48C /* RCTCameraRoll.xcodeproj */;
400+
ProductGroup = BC6A3A5E1DBDFA04007AFF2A /* Products */;
401+
ProjectRef = BC6A3A5D1DBDFA04007AFF2A /* RCTCameraRoll.xcodeproj */;
402402
},
403403
{
404404
ProductGroup = 00C302B61ABCB90400DB3ED1 /* Products */;
@@ -516,11 +516,11 @@
516516
remoteRef = 832341B41AAA6A8300B99B32 /* PBXContainerItemProxy */;
517517
sourceTree = BUILT_PRODUCTS_DIR;
518518
};
519-
BC334BFC1D38D78400B3C48C /* libRCTCameraRoll.a */ = {
519+
BC6A3A631DBDFA04007AFF2A /* libRCTCameraRoll.a */ = {
520520
isa = PBXReferenceProxy;
521521
fileType = archive.ar;
522522
path = libRCTCameraRoll.a;
523-
remoteRef = BC334BFB1D38D78400B3C48C /* PBXContainerItemProxy */;
523+
remoteRef = BC6A3A621DBDFA04007AFF2A /* PBXContainerItemProxy */;
524524
sourceTree = BUILT_PRODUCTS_DIR;
525525
};
526526
/* End PBXReferenceProxy section */
@@ -611,7 +611,7 @@
611611
"$(inherited)",
612612
);
613613
INFOPLIST_FILE = ExampleTests/Info.plist;
614-
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
614+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
615615
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
616616
PRODUCT_NAME = "$(TARGET_NAME)";
617617
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
@@ -624,7 +624,7 @@
624624
BUNDLE_LOADER = "$(TEST_HOST)";
625625
COPY_PHASE_STRIP = NO;
626626
INFOPLIST_FILE = ExampleTests/Info.plist;
627-
IPHONEOS_DEPLOYMENT_TARGET = 8.2;
627+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
628628
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
629629
PRODUCT_NAME = "$(TARGET_NAME)";
630630
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example";
@@ -635,6 +635,7 @@
635635
isa = XCBuildConfiguration;
636636
buildSettings = {
637637
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
638+
CURRENT_PROJECT_VERSION = 1;
638639
DEAD_CODE_STRIPPING = NO;
639640
HEADER_SEARCH_PATHS = (
640641
"$(inherited)",
@@ -649,13 +650,15 @@
649650
"-lc++",
650651
);
651652
PRODUCT_NAME = Example;
653+
VERSIONING_SYSTEM = "apple-generic";
652654
};
653655
name = Debug;
654656
};
655657
13B07F951A680F5B00A75B9A /* Release */ = {
656658
isa = XCBuildConfiguration;
657659
buildSettings = {
658660
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
661+
CURRENT_PROJECT_VERSION = 1;
659662
HEADER_SEARCH_PATHS = (
660663
"$(inherited)",
661664
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
@@ -669,6 +672,7 @@
669672
"-lc++",
670673
);
671674
PRODUCT_NAME = Example;
675+
VERSIONING_SYSTEM = "apple-generic";
672676
};
673677
name = Release;
674678
};
@@ -711,7 +715,7 @@
711715
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
712716
"$(SRCROOT)/../node_modules/react-native/React/**",
713717
);
714-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
718+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
715719
MTL_ENABLE_DEBUG_INFO = YES;
716720
ONLY_ACTIVE_ARCH = YES;
717721
SDKROOT = iphoneos;
@@ -751,7 +755,7 @@
751755
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include,
752756
"$(SRCROOT)/../node_modules/react-native/React/**",
753757
);
754-
IPHONEOS_DEPLOYMENT_TARGET = 7.0;
758+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
755759
MTL_ENABLE_DEBUG_INFO = NO;
756760
SDKROOT = iphoneos;
757761
VALIDATE_PRODUCT = YES;

Example/ios/Example/AppDelegate.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1818
{
1919
NSURL *jsCodeLocation;
2020

21-
[[RCTBundleURLProvider sharedSettings] setDefaults];
2221
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
2322

2423
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation

Example/ios/Example/Info.plist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
<key>NSLocationWhenInUseUsageDescription</key>
4040
<string></string>
4141
<key>NSAppTransportSecurity</key>
42-
<!--See http://ste.vn/2015/06/10/configuring-app-transport-security-ios-9-osx-10-11/ -->
4342
<dict>
4443
<key>NSExceptionDomains</key>
4544
<dict>
@@ -50,5 +49,7 @@
5049
</dict>
5150
</dict>
5251
</dict>
52+
<key>NSPhotoLibraryUsageDescription</key>
53+
<string>This app attempts to access your camera data.</string>
5354
</dict>
5455
</plist>

0 commit comments

Comments
 (0)