update example`s react-naitve version to 0.31.0

This commit is contained in:
Horcrux
2016-08-19 16:02:05 +08:00
parent 63ad060e49
commit c9a64c44fc
14 changed files with 83 additions and 70 deletions

View File

@@ -5,7 +5,7 @@ import re
# - install Buck # - install Buck
# - `npm start` - to start the packager # - `npm start` - to start the packager
# - `cd android` # - `cd android`
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US` # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
# - `buck install -r android/app` - compile, install and run application # - `buck install -r android/app` - compile, install and run application
# #
@@ -46,13 +46,13 @@ android_library(
android_build_config( android_build_config(
name = 'build_config', name = 'build_config',
package = 'com.artsvgexample', package = 'com.svgexample',
) )
android_resource( android_resource(
name = 'res', name = 'res',
res = 'src/main/res', res = 'src/main/res',
package = 'com.artsvgexample', package = 'com.svgexample',
) )
android_binary( android_binary(

View File

@@ -55,7 +55,13 @@ import com.android.build.OutputFile
* // date; if you have any other folders that you want to ignore for performance reasons (gradle * // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here. * // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"] * inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ] * ]
*/ */
@@ -81,7 +87,7 @@ android {
buildToolsVersion "23.0.1" buildToolsVersion "23.0.1"
defaultConfig { defaultConfig {
applicationId "com.artsvgexample" applicationId "com.svgexample"
minSdkVersion 16 minSdkVersion 16
targetSdkVersion 22 targetSdkVersion 22
versionCode 1 versionCode 1

View File

@@ -26,11 +26,14 @@
# See http://sourceforge.net/p/proguard/bugs/466/ # See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
# Do not strip any method/class that is annotated with @DoNotStrip # Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class * -keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * { -keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *; @com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
} }
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * { -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
@@ -51,9 +54,9 @@
-keepattributes Signature -keepattributes Signature
-keepattributes *Annotation* -keepattributes *Annotation*
-keep class com.squareup.okhttp.** { *; } -keep class okhttp3.** { *; }
-keep interface com.squareup.okhttp.** { *; } -keep interface okhttp3.** { *; }
-dontwarn com.squareup.okhttp.** -dontwarn okhttp3.**
# okio # okio

View File

@@ -1,14 +1,14 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.artsvgexample"> package="com.svgexample">
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<application <application
android:name=".MainApplication"
android:allowBackup="true" android:allowBackup="true"
android:label="@string/app_name" android:label="@string/app_name"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme"> android:theme="@style/AppTheme"
android:name=".MainApplication">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:label="@string/app_name" android:label="@string/app_name"

View File

@@ -1,36 +0,0 @@
package com.artsvgexample;
import android.app.Application;
import android.util.Log;
import com.horcrux.svg.RNSvgPackage;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
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 RNSvgPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}

View File

@@ -1,4 +1,4 @@
package com.artsvgexample; package com.svgexample;
import com.facebook.react.ReactActivity; import com.facebook.react.ReactActivity;

View File

@@ -0,0 +1,35 @@
package com.svgexample;
import android.app.Application;
import com.horcrux.svg.RNSvgPackage;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.asList(
new MainReactPackage(),
new RNSvgPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}

View File

@@ -18,7 +18,7 @@ allprojects {
jcenter() jcenter()
maven { maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$projectDir/../../node_modules/react-native/android" url "$rootDir/../node_modules/react-native/android"
} }
} }
} }

View File

@@ -42,6 +42,11 @@ case "`uname`" in
;; ;;
esac esac
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
# Attempt to set APP_HOME # Attempt to set APP_HOME
# Resolve links: $0 may be a link # Resolve links: $0 may be a link
PRG="$0" PRG="$0"
@@ -56,9 +61,9 @@ while [ -h "$PRG" ] ; do
fi fi
done done
SAVED="`pwd`" SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null cd "`dirname \"$PRG\"`/" >&-
APP_HOME="`pwd -P`" APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null cd "$SAVED" >&-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -109,7 +114,6 @@ fi
if $cygwin ; then if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"` APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath # We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`

View File

@@ -334,7 +334,7 @@
isa = PBXProject; isa = PBXProject;
attributes = { attributes = {
LastUpgradeCheck = 0610; LastUpgradeCheck = 0610;
ORGANIZATIONNAME = Facebook; ORGANIZATIONNAME = Horcrux;
}; };
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SvgExample" */; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "SvgExample" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 3.2";

View File

@@ -199,7 +199,7 @@ class SvgExample extends Component {
<Animated.Modal <Animated.Modal
visible={this.state.modal} visible={this.state.modal}
style={[styles.modal, { style={[styles.modal, {
transform: [{scale: this.state.scale}] //transform: [{scale: this.state.scale}]
}]} }]}
> >
<ScrollView <ScrollView

View File

@@ -1,13 +1,13 @@
{ {
"name": "ArtSvgExample", "name": "SvgExample",
"version": "0.0.1", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"start": "react-native start" "start": "react-native start"
}, },
"dependencies": { "dependencies": {
"react": "^15.1.0", "react": "^15.1.0",
"react-native": "^0.29.0", "react-native": "^0.31.0",
"react-native-root-modal": "^1.0.4", "react-native-root-modal": "^1.0.4",
"react-native-svg": "../" "react-native-svg": "../"
} }

View File

@@ -580,6 +580,7 @@ npm install
3. Pattern element 3. Pattern element
4. implement Animated elements 4. implement Animated elements
5. load Image from url 5. load Image from url
6. Mask element
### Known issues: ### Known issues:
1. cannot set alpha channel for Gradient on iOS. 1. cannot set alpha channel for Gradient on iOS.

View File

@@ -1,5 +1,5 @@
{ {
"version": "4.1.2", "version": "4.1.3",
"name": "react-native-svg", "name": "react-native-svg",
"description": "SVG library for react-native", "description": "SVG library for react-native",
"repository": { "repository": {