649 Commits

Author SHA1 Message Date
Mikael Sand 35597ed772 [android] Support other elements than Path as href in TextPath 2018-09-22 13:11:28 +03:00
Niko Rehnbäck 2219317513 Let SvgViewManager handle removing node and view references. 2018-09-18 16:09:52 +03:00
Mikael Sand 24c375fe43 Remove android.support.annotation.RequiresApi 2018-09-16 02:19:22 +03:00
Mikael Sand 2dae34054a Fix merge issue: https://github.com/react-native-community/react-native-svg/issues/778 2018-09-15 21:20:38 +03:00
Mikael Sand bf3fc3d677 Merge pull request #746 from msand/emoji
Implement basic support for unicode emoji
2018-09-15 19:11:17 +03:00
Mikael Sand c39b3267f1 [android] Only render once per frame when animating several svg nodes. 2018-09-15 19:03:28 +03:00
Mikael Sand 7e42a99cf3 Clear cached data in tree when changing properties on root svg element.
Fixes staleness issues when changing width and height.
2018-09-13 01:29:15 +03:00
Mikael Sand b88cba85a4 [iOS] Fix transform in mask handling
cleanup mask implementation
2018-09-12 02:59:38 +03:00
Mikael Sand 46307ecd2d Implement basic support for Mask element
iOS luminanceToAlpha calculation seems off
probably some color space or gamma issue
2018-09-12 01:48:39 +03:00
Mikael Sand fc63635f3c Implement basic support for Pattern element 2018-09-02 16:06:44 +03:00
Mikael Sand 7bb1e748b7 [android] Fix clipping path on Android < Kitkat (API 19) 2018-09-01 16:41:03 +03:00
Mikael Sand a1097b8594 Fix spec conformance of clipping path with multiple child elements.
https://www.w3.org/TR/SVG11/masking.html#EstablishingANewClippingPath

The raw geometry of each child element exclusive of rendering properties such as ‘fill’, ‘stroke’, ‘stroke-width’ within a ‘clipPath’ conceptually defines a 1-bit mask (with the possible exception of anti-aliasing along the edge of the geometry) which represents the silhouette of the graphics associated with that element. Anything outside the outline of the object is masked out. If a child element is made invisible by ‘display’ or ‘visibility’ it does not contribute to the clipping path. When the ‘clipPath’ element contains multiple child elements, the silhouettes of the child elements are logically OR'd together to create a single silhouette which is then used to restrict the region onto which paint can be applied. Thus, a point is inside the clipping path if it is inside any of the children of the ‘clipPath’.

For a given graphics element, the actual clipping path used will be the intersection of the clipping path specified by its ‘clip-path’ property (if any) with any clipping paths on its ancestors, as specified by the ‘clip-path’ property on the ancestor elements, or by the ‘overflow’ property on ancestor elements which establish a new viewport. Also, see the discussion of the initial clipping path.)

Fixes issues highlighted by https://github.com/react-native-community/react-native-svg/issues/752
Fix https://github.com/react-native-community/react-native-svg/issues/280
Fix https://github.com/react-native-community/react-native-svg/issues/517

[android] Fix https://github.com/react-native-community/react-native-svg/issues/766
`Region.Op.REPLACE` is deprecated in API level 28
Replace with clipPath (Path path) to Intersect instead.
2018-09-01 02:55:36 +03:00
Mikael Sand 8e0420fc2d [android] Fix caching of text 2018-08-25 01:06:45 +03:00
Mikael Sand ce602c1d62 Fix dynamic null handling 2018-08-22 15:29:28 +03:00
Mikael Sand 41134b8636 Improve width and height calculation 2018-08-19 21:49:49 +03:00
Mikael Sand e98b0fe1d1 Merge branch 'master' into NativeAnimation
# Conflicts:
#	android/src/main/java/com/horcrux/svg/RenderableShadowNode.java
#	android/src/main/java/com/horcrux/svg/SvgViewShadowNode.java
#	elements/Image.js
#	elements/Rect.js
#	elements/Use.js
#	lib/attributes.js
2018-08-19 15:48:40 +03:00
Mikael Sand 211afecf3a Fix null exception. 2018-08-19 15:26:59 +03:00
Mikael Sand 34d4051aa9 Fix early predicate. 2018-08-18 15:04:58 +03:00
Mikael Sand 3879c90bd8 Support native animation of fill and stroke 2018-08-17 22:09:47 +03:00
Mikael Sand 53a917ce9e [android] Fix unicode emoji modifiers. 2018-08-09 23:47:46 +03:00
Hexer e7a7937bc8 fix NullPointerException 2018-08-03 11:36:51 +08:00
Mikael Sand 429f1969c3 Implement basic support for unicode emoji 2018-07-30 05:45:50 +03:00
colorfulberry 62a72e12ac Update build.gradle
compile should instead implemention
2018-07-27 17:21:30 +08:00
Mikael Sand 890d4d9d45 Merge remote-tracking branch 'yeomann/patch-1' 2018-07-26 23:53:26 +03:00
Mikael Sand f969b9ebe9 Merge remote-tracking branch 'philoinc/master' 2018-07-26 23:53:06 +03:00
Mikael Sand d3bd2e3d9f Merge remote-tracking branch 'rghorbani/master' 2018-07-26 23:52:23 +03:00
Danish 22bdfa930e Update obsolete compile to implemenation
Hi, as React native 0.56.0 is released with MAJOR android changes such as:

-Gradle 3.5.1
-Compile using Android SDK 26
-Google Maven repo
-etc

more about Change log, specially of Android Here, https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#android-projects-are-now-compiled-using-the-android-26-sdk
and https://github.com/react-native-community/react-native-releases/blob/master/CHANGELOG.md#android-specific-changes

Aslo as Per Google new "Google Play's target API level requirement", mentioned here  https://developer.android.com/distribute/best-practices/develop/target-sdk

"Google Play will require that new apps target at least Android 8.0 (API level 26) from August 1, 2018, and that app updates target Android 8.0 from November 1, 2018."

It's clear that Android would be moving to new Gradle and new SDK changes, Thus creating a new type of error that is:

"Configuration 'compile' is obsolete and has been replaced with 'implementation' or 'Api'" 

more about the Old and new configuration please see this https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration?utm_source=android-studio#new_configurations 
at the heading of "Use the new dependency configurations"

Therefore, all old "compile" should be now "implementation" or "provided" should be "compileOnly"

I have tested the with "compile" and "implementation" in my current release ready product and also by "renaming" "compile" to "implementation".
Also tested with higher andorid SDK configs such as of below:

```
ext {
    buildToolsVersion = "27.0.3"
    minSdkVersion = 19
    compileSdkVersion = 27
    targetSdkVersion = 27
    supportLibVersion = "27.1.1"
}
```

so SDK 27 was also compiled successully. test on Android phone with ADK 23 all looks good. Thus, `react-native-svg` was working just fine as intended. thank you so much for this package btw. Love this package so much :)

Therefore, Please would it be possible to merge as i am sure many new projects and old one are going to update specially Gradle and SDK as of Google new requirements. 

related mention of Upgrading issue mention here https://github.com/facebook/react-native/issues/20273#issuecomment-405959030


Moreover, if someone still have any issue after upgrading everything successfully, then he should use following in build.gradle under `andorid/build.gradle`

```

subprojects {
    afterEvaluate {project ->
        if (project.hasProperty("android")) {
            android {
                compileSdkVersion 27
                buildToolsVersion '27.0.3'
                supportLibVersion = "27.1.1"
            }
        }
    }
}
```
2018-07-19 20:28:05 +03:00
Seth Madison 149259de64 Fix memory leak: remove references to SvgViews in onDetachedFromWindow
It looks like onDropViewInstance does not get called when the entire react
instance is shut down from the native side. To gaurantee that we do not
leak memory, we need to remove the reference to the view in onDetachedFromWindow().
2018-07-18 16:06:36 -07:00
Reza 89ae631c95 upgrade SDK Build Tools 2018-07-06 01:10:42 +04:30
ExoMemphiz 5a5fff8b2a Fixed NullPointerException 2018-07-04 13:37:57 +02:00
Mikael Sand d982130316 [android] fix text hit test 2018-07-02 06:00:22 +03:00
Mikael Sand a454fe3490 [android] fix inherited attributes 2018-07-02 05:26:39 +03:00
Mikael Sand 2fa029035c [android] fix rendering of nested svg 2018-07-02 05:25:20 +03:00
Mikael Sand b395697853 Merge pull request #716 from isnotgood/master
[android] Handle gracefully gradients with only one stop
2018-07-02 05:20:11 +03:00
Lukas Weber b1462e08f5 [android] Handle gracefully gradients with only one stop
Handles erroneous gradient which contains only one stop or two
stops at the same place, but merged into one stop by extractGradient().
2018-06-14 14:54:30 +02:00
Maksym Komarychev 9e73ffe0f0 [android] initial CTM is identity 2018-06-10 11:39:07 +03:00
Maksym Komarychev ba7bef6ce8 [android] fire onLayout 2018-06-09 00:20:27 +03:00
Mikael Sand f28a343a8d Merge remote-tracking branch 'EmentoDev/master' 2018-06-08 01:16:29 +03:00
Mikael Sand 01452d7354 Merge remote-tracking branch 'max/touches-group-use' 2018-06-07 21:20:35 +03:00
Mikael Sand 3866c64092 Merge remote-tracking branch 'Crash--/patch-1' 2018-06-07 20:42:10 +03:00
davidpricedev 15dd172e58 Fixes android arc 2018-06-04 12:29:14 -05:00
Rasmus Fredensborg Jensen c16a9ed4c0 Removing check for cachedClipPath when getting clipPath in VirtualNode, as it hinders image clip path update, when animating the clip path itself 2018-06-01 10:15:04 +02:00
Quentin Valmori 6a63989f73 drawOutput() only when Layout is != 0 2018-04-30 12:25:47 +02:00
Maksym Komarychev 3440d72277 [android] hitTest for Use 2018-04-14 19:38:11 +03:00
Mikael Sand 13fcdf6f15 Merge remote-tracking branch 'msand/NestedSvg' into merge-test
# Conflicts:
#	ios/Elements/RNSVGGroup.m
#	ios/RNSVGNode.h
#	ios/RNSVGNode.m
2018-03-19 00:27:01 +02:00
Mikael Sand 40a17c838d Merge remote-tracking branch 'uxbert/5.5.1-load-image-from-url' into fix-display-none
# Conflicts:
#	android/src/main/java/com/horcrux/svg/ImageShadowNode.java
#	ios/Elements/RNSVGImage.m
2018-03-18 23:14:29 +02:00
Mikael Sand 0eb501d5e8 Alternative approach without TextureView. 2018-03-18 22:39:44 +02:00
Mikael Sand 7deabf8287 Add RenderableView, fix names. Allow percentages in nested SVG (iOS). 2018-03-17 23:22:40 +02:00
Bilal Syed 77ebefb650 Load Image from URL 2018-03-15 19:00:58 +03:00
Mikael Sand a3c9aa2872 Add remaining properties to view managers. 2018-03-04 22:00:48 +02:00