Skip to content

Commit

Permalink
Project is buildable again, version 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
alwx committed Sep 1, 2017
1 parent 8166103 commit 22877b2
Show file tree
Hide file tree
Showing 24 changed files with 298 additions and 3,105 deletions.
8 changes: 3 additions & 5 deletions example/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ emoji=true

module.system=haste

experimental.strict_type_args=true

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
Expand All @@ -36,12 +34,12 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-2]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
^0.42.0
^0.49.1
12 changes: 12 additions & 0 deletions example/__tests__/index.android.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'react-native';
import React from 'react';
import Index from '../index.android.js';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
});
12 changes: 12 additions & 0 deletions example/__tests__/index.ios.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'react-native';
import React from 'react';
import Index from '../index.ios.js';

// Note: test renderer must be required after react-native.
import renderer from 'react-test-renderer';

it('renders correctly', () => {
const tree = renderer.create(
<Index />
);
});
16 changes: 11 additions & 5 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
Expand Down Expand Up @@ -84,7 +91,7 @@ def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.example"
Expand Down Expand Up @@ -127,10 +134,9 @@ android {

dependencies {
compile project(':react-native-photo-view')
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.facebook.react:react-native:+'
// From node_modules
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
}

// Run this once to be able to run the application with BUCK
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.example;

import com.facebook.react.ReactActivity;
import com.reactnative.photoview.PhotoViewPackage;

public class MainActivity extends ReactActivity {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import android.app.Application;

import com.facebook.react.ReactApplication;
import com.reactnative.photoview.PhotoViewPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
Expand All @@ -23,8 +22,7 @@ public boolean getUseDeveloperSupport() {
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new PhotoViewPackage()
new MainReactPackage()
);
}
};
Expand Down
1 change: 1 addition & 0 deletions example/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">example</string>
</resources>
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:2.2.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
3 changes: 1 addition & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Thu Jul 20 18:01:37 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
4 changes: 2 additions & 2 deletions example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
rootProject.name = 'example'
include ':react-native-photo-view'
project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')

include ':app'
include ':react-native-photo-view'
project(':react-native-photo-view').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-photo-view/android')
74 changes: 37 additions & 37 deletions example/index.android.js
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
import React, {Component} from 'react';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View,
AppRegistry,
StyleSheet,
View
} from 'react-native';
import PhotoView from 'react-native-photo-view';

class example extends Component {
render() {
return (
<View style={styles.container}>
<PhotoView
source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
onLoad={() => console.log("onLoad called")}
onTap={() => console.log("onTap called")}
minimumZoomScale={0.5}
maximumZoomScale={3}
androidScaleType="center"
style={styles.photo} />
</View>
);
}
export default class Example extends Component {
render() {
return (
<View style={styles.container}>
<PhotoView
source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
onLoad={() => console.log("onLoad called")}
onTap={() => console.log("onTap called")}
minimumZoomScale={0.5}
maximumZoomScale={3}
androidScaleType="center"
style={styles.photo} />
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
photo: {
width: 300,
height: 300,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'black'
},
text: {
backgroundColor: "transparent",
color: "#FFF",
}
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
photo: {
width: 300,
height: 300,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'black'
},
text: {
backgroundColor: "transparent",
color: "#FFF",
}
});

AppRegistry.registerComponent('example', () => example);
AppRegistry.registerComponent('example', () => Example);
118 changes: 59 additions & 59 deletions example/index.ios.js
Original file line number Diff line number Diff line change
@@ -1,68 +1,68 @@
import React, {Component} from 'react';
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
View,
AppRegistry,
StyleSheet,
View
} from 'react-native';
import PhotoView from 'react-native-photo-view';

class example extends Component {
_onScale = (event) => {
console.log('_onScale', event.nativeEvent);
};
_onTap = (event) => {
console.log('_onTap', event.nativeEvent);
};
_onViewTap = (event) => {
console.log('_onViewTap', event.nativeEvent);
};
_onLoadStart = (event) => {
console.log('_onLoadStart', event.nativeEvent);
};
_onLoad = (event) => {
console.log('_onLoad', event.nativeEvent);
};
_onLoadEnd = (event) => {
console.log('_onLoadEnd', event.nativeEvent);
};
render() {
return (
<View style={styles.container}>
<PhotoView
source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}}
onScale={this._onScale}
onTap={this._onTap}
onViewTap={this._onViewTap}
onLoadStart={this._onLoadStart}
onLoad={this._onLoad}
onLoadEnd={this._onLoadEnd}
showsVerticalScrollIndicator={true}
showsHorizontalScrollIndicator={true}
minimumZoomScale={0.5}
maximumZoomScale={3}
style={styles.photo} />
</View>
);
}
export default class Example extends Component {
_onScale = (event) => {
console.log('_onScale', event.nativeEvent);
};
_onTap = (event) => {
console.log('_onTap', event.nativeEvent);
};
_onViewTap = (event) => {
console.log('_onViewTap', event.nativeEvent);
};
_onLoadStart = (event) => {
console.log('_onLoadStart', event.nativeEvent);
};
_onLoad = (event) => {
console.log('_onLoad', event.nativeEvent);
};
_onLoadEnd = (event) => {
console.log('_onLoadEnd', event.nativeEvent);
};
render() {
return (
<View style={styles.container}>
<PhotoView
source={{uri: "https://facebook.github.io/react/img/logo_og.png"}}
onScale={this._onScale}
onTap={this._onTap}
onViewTap={this._onViewTap}
onLoadStart={this._onLoadStart}
onLoad={this._onLoad}
onLoadEnd={this._onLoadEnd}
showsVerticalScrollIndicator={true}
showsHorizontalScrollIndicator={true}
minimumZoomScale={0.5}
maximumZoomScale={3}
style={styles.photo} />
</View>
);
}
}

const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
photo: {
width: 300,
height: 300,
justifyContent: 'center',
alignItems: 'center'
},
text: {
backgroundColor: "transparent",
color: "#FFF",
}
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
photo: {
width: 300,
height: 300,
justifyContent: 'center',
alignItems: 'center'
},
text: {
backgroundColor: "transparent",
color: "#FFF",
}
});

AppRegistry.registerComponent('example', () => example);
AppRegistry.registerComponent('example', () => Example);
Loading

0 comments on commit 22877b2

Please sign in to comment.