Skip to content

Commit be4d7bc

Browse files
committed
Merge pull request #48 from magicismight/touch-events
Touch events branch merge into master
2 parents ddb317e + ac6e49b commit be4d7bc

File tree

124 files changed

+2832
-1182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+2832
-1182
lines changed

Example/android/app/BUCK

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import re
2+
3+
# To learn about Buck see [Docs](https://buckbuild.com/).
4+
# To run your application with Buck:
5+
# - install Buck
6+
# - `npm start` - to start the packager
7+
# - `cd android`
8+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US`
9+
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
10+
# - `buck install -r android/app` - compile, install and run application
11+
#
12+
13+
lib_deps = []
14+
for jarfile in glob(['libs/*.jar']):
15+
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16+
lib_deps.append(':' + name)
17+
prebuilt_jar(
18+
name = name,
19+
binary_jar = jarfile,
20+
)
21+
22+
for aarfile in glob(['libs/*.aar']):
23+
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24+
lib_deps.append(':' + name)
25+
android_prebuilt_aar(
26+
name = name,
27+
aar = aarfile,
28+
)
29+
30+
android_library(
31+
name = 'all-libs',
32+
exported_deps = lib_deps
33+
)
34+
35+
android_library(
36+
name = 'app-code',
37+
srcs = glob([
38+
'src/main/java/**/*.java',
39+
]),
40+
deps = [
41+
':all-libs',
42+
':build_config',
43+
':res',
44+
],
45+
)
46+
47+
android_build_config(
48+
name = 'build_config',
49+
package = 'com.artsvgexample',
50+
)
51+
52+
android_resource(
53+
name = 'res',
54+
res = 'src/main/res',
55+
package = 'com.artsvgexample',
56+
)
57+
58+
android_binary(
59+
name = 'app',
60+
package_type = 'debug',
61+
manifest = 'src/main/AndroidManifest.xml',
62+
keystore = '//android/keystores:debug',
63+
deps = [
64+
':app-code',
65+
],
66+
)

Example/android/app/build.gradle

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.android.build.OutputFile
99
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
1010
* bundle directly from the development server. Below you can see all the possible configurations
1111
* and their defaults. If you decide to add a configuration block, make sure to add it before the
12-
* `apply from: "react.gradle"` line.
12+
* `apply from: "../../node_modules/react-native/react.gradle"` line.
1313
*
1414
* project.ext.react = [
1515
* // the name of the generated asset file containing your JS bundle
@@ -26,7 +26,9 @@ import com.android.build.OutputFile
2626
*
2727
* // whether to bundle JS and assets in another build variant (if configured).
2828
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29-
* // The configuration property is in the format 'bundleIn${productFlavor}${buildType}'
29+
* // The configuration property can be in the following formats
30+
* // 'bundleIn${productFlavor}${buildType}'
31+
* // 'bundleIn${buildType}'
3032
* // bundleInFreeDebug: true,
3133
* // bundleInPaidRelease: true,
3234
* // bundleInBeta: true,
@@ -57,11 +59,10 @@ import com.android.build.OutputFile
5759
* ]
5860
*/
5961

60-
apply from: "react.gradle"
62+
apply from: "../../node_modules/react-native/react.gradle"
6163

6264
/**
63-
* Set this to true to create three separate APKs instead of one:
64-
* - A universal APK that works on all devices
65+
* Set this to true to create two separate APKs instead of one:
6566
* - An APK that only works on ARM devices
6667
* - An APK that only works on x86 devices
6768
* The advantage is the size of the APK is reduced by about 4MB.
@@ -91,9 +92,9 @@ android {
9192
}
9293
splits {
9394
abi {
94-
enable enableSeparateBuildPerCPUArchitecture
95-
universalApk false
9695
reset()
96+
enable enableSeparateBuildPerCPUArchitecture
97+
universalApk false // If true, also generate a universal APK
9798
include "armeabi-v7a", "x86"
9899
}
99100
}
@@ -119,9 +120,15 @@ android {
119120
}
120121

121122
dependencies {
123+
compile project(':react-native-svg')
122124
compile fileTree(dir: "libs", include: ["*.jar"])
123125
compile "com.android.support:appcompat-v7:23.0.1"
124-
compile "com.facebook.react:react-native:0.20.+"
126+
compile "com.facebook.react:react-native:+" // From node_modules
127+
}
125128

126-
compile project(':react-native-svg')
129+
// Run this once to be able to run the application with BUCK
130+
// puts all compile dependencies into folder libs for BUCK to use
131+
task copyDownloadableDepsToLibs(type: Copy) {
132+
from configurations.compile
133+
into 'libs'
127134
}

Example/android/app/proguard-rules.pro

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,3 @@
6161
-dontwarn java.nio.file.*
6262
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
6363
-dontwarn okio.**
64-
65-
# stetho
66-
67-
-dontwarn com.facebook.stetho.**

Example/android/app/src/main/java/com/artsvgexample/MainActivity.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package com.artsvgexample;
22

33
import com.facebook.react.ReactActivity;
4+
import com.horcrux.svg.RNSvgPackage;
45
import com.facebook.react.ReactPackage;
56
import com.facebook.react.shell.MainReactPackage;
67

78
import java.util.Arrays;
89
import java.util.List;
9-
import com.horcrux.svg.RNSvgPackage;
1010

1111
public class MainActivity extends ReactActivity {
1212

@@ -28,15 +28,15 @@ protected boolean getUseDeveloperSupport() {
2828
return BuildConfig.DEBUG;
2929
}
3030

31-
/**
32-
* A list of packages used by the app. If the app uses additional views
33-
* or modules besides the default ones, add more packages here.
34-
*/
31+
/**
32+
* A list of packages used by the app. If the app uses additional views
33+
* or modules besides the default ones, add more packages here.
34+
*/
3535
@Override
3636
protected List<ReactPackage> getPackages() {
37-
return Arrays.<ReactPackage>asList(
38-
new RNSvgPackage(),
39-
new MainReactPackage()
40-
);
37+
return Arrays.<ReactPackage>asList(
38+
new MainReactPackage(),
39+
new RNSvgPackage()
40+
);
4141
}
4242
}

Example/android/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ allprojects {
1616
repositories {
1717
mavenLocal()
1818
jcenter()
19+
maven {
20+
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
21+
url "$projectDir/../../node_modules/react-native/android"
22+
}
1923
}
2024
}

Example/android/settings.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
rootProject.name = 'ArtSvgExample'
22

33
include ':app'
4-
54
include ':react-native-svg'
65
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')

Example/examples/Circle.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {
22
Component
3-
} from 'react-native';
3+
} from 'react';
44

55
import Svg, {
66
Circle

Example/examples/Clipping.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {
22
Component
3-
} from 'react-native';
3+
} from 'react';
44

55
import Svg, {
66
ClipPath,
@@ -49,6 +49,14 @@ class ClipPathAttr extends Component{
4949
height="100"
5050
fill="url(#grad)"
5151
clipPath="M50,5L20,99L95,39L5,39L80,99z"
52+
onStartShouldSetResponder={() => alert("1111111")}
53+
/>
54+
<Rect
55+
x="40%"
56+
y="0"
57+
width="20%"
58+
height="20%"
59+
fill="pink"
5260
/>
5361
</Svg>;
5462
}

Example/examples/Ellipse.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {
22
Component
3-
} from 'react-native';
3+
} from 'react';
44

55
import Svg, {
66
Ellipse

Example/examples/G.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, {
22
Component
3-
} from 'react-native';
3+
} from 'react';
44

55
import Svg, {
66
G,

0 commit comments

Comments
 (0)