Skip to content

Commit 4c1bf8f

Browse files
committed
Merge branch 'master' into android-nested-gradient
# Conflicts: # example/.babelrc # example/.flowconfig # example/App.js # example/android/app/BUCK # example/android/app/build.gradle # example/android/app/proguard-rules.pro # example/android/app/src/main/AndroidManifest.xml # example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png # example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png # example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png # example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png # example/android/app/src/main/res/values/strings.xml # example/android/build.gradle # example/android/gradle.properties # example/android/gradle/wrapper/gradle-wrapper.properties # example/android/settings.gradle # example/app.json # example/index.js # example/package-lock.json # example/package.json # example/yarn.lock # package.json # src/create-text-gradient-class.js
2 parents 498ecaa + 62fc7c8 commit 4c1bf8f

60 files changed

Lines changed: 5413 additions & 3666 deletions

Some content is hidden

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

.dockerignore

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
**/node_modules
2+
.github
3+
.git
4+
img
5+
LICENSE
6+
**/*.md
7+
*.tgz
8+
**/.gitignore
9+
10+
**/bin
11+
**/obj
12+
**/packages
13+
**/paket-files
14+
fable-typed/paket.*
15+
fable-typed/*.fsproj
16+
fable-typed/publish.js
17+
fable-typed/.paket
18+
19+
**/android/build
20+
**/android/app/build
21+
**/android/app/src/main/assets/*.bundle
22+
**/android/local.properties
23+
**/.gradle
24+
**/.idea
25+
**/*.iml
26+
**/*.apk
27+
28+
**/ios/build
29+
**/ios/infer-out
30+
31+
**/out
32+
33+
**/infer-out
34+
**/compile_commands.json
35+
**/xcodebuild.log

.github/issue_template.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
Please specify your mobile platform(s) and react-native & react-native-text-gradient versions.
1+
<!-- Please specify your mobile platform(s) and react-native & react-native-text-gradient versions. Also check https://github.com/iyegoroff/react-native-text-gradient#status if your rntg version corresponds with your rn version.-->
2+
3+
<!-- Getting "No ViewManager defined for class X" error most likely means that you didn't link the module or something is wrong with your build and/or configuration. Try cleaning the project and check if your configuration matches with https://github.com/iyegoroff/react-native-text-gradient/blob/master/manual_installation.md instruction. -->
4+
5+
<!-- If your app crashed due to react-native-text-gradient, please attach a crash log. -->

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# react-native-text-gradient
32
[![npm version](https://badge.fury.io/js/react-native-text-gradient.svg?t=1495378566925)](https://badge.fury.io/js/react-native-text-gradient)
43
[![Dependency Status](https://david-dm.org/iyegoroff/react-native-text-gradient.svg?t=1495378566925)](https://david-dm.org/iyegoroff/react-native-text-gradient)
@@ -23,7 +22,8 @@ React-Native text gradient component for iOS & Android.
2322

2423
- Component works as drop-in replacement for standard `Text` component and it is possible to have nested gradients.
2524
- React-Native:
26-
- with rn >= 0.55.0 use latest version;
25+
- with rn >= 0.56.0 use latest version and [patch](#usage-with-rn--0560);
26+
- with rn >= 0.55.0 use 0.0.9;
2727
- with rn >= 0.54.0 use 0.0.7;
2828
- with rn >= 0.53.1 use 0.0.4;
2929
- rn 0.53.0 is not supported;
@@ -88,6 +88,13 @@ Optional. If true gradient will be calculated for text view background frame rat
8888
<img src="img/useViewFrame.png" width="300">
8989

9090

91+
## Usage with rn >= 0.56.0
92+
93+
Wait until https://github.com/facebook/react/pull/13211 will be merged or patch react-native to remove failing invariant checks
94+
95+
`$ node node_modules/react-native-text-gradient/patch-rn.js`
96+
97+
9198
## Caveats
9299

93100
When mixing several text gradients and `Text`s top component always should be text gradient.

RELEASE_NOTES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[release notes](https://github.com/iyegoroff/react-native-text-gradient/releases)

android/.classpath

Lines changed: 0 additions & 6 deletions
This file was deleted.

android/.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
build/
2+
.idea
3+
.gradle
4+
local.properties
5+
*.iml
6+
.DS_Store

android/build.gradle

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
1-
21
buildscript {
32
repositories {
43
jcenter()
54
}
65

76
dependencies {
8-
classpath 'com.android.tools.build:gradle:1.3.1'
7+
classpath 'com.android.tools.build:gradle:2.3.3'
98
}
109
}
1110

1211
apply plugin: 'com.android.library'
1312

13+
def _ext = rootProject.ext;
14+
15+
def _reactNativeVersion = _ext.has('reactNative') ? _ext.reactNative : '+';
16+
def _compileSdkVersion = _ext.has('compileSdkVersion') ? _ext.compileSdkVersion : 26;
17+
def _buildToolsVersion = _ext.has('buildToolsVersion') ? _ext.buildToolsVersion : '26.0.1';
18+
def _minSdkVersion = _ext.has('minSdkVersion') ? _ext.minSdkVersion : 16;
19+
def _targetSdkVersion = _ext.has('targetSdkVersion') ? _ext.targetSdkVersion : 26;
20+
1421
android {
15-
compileSdkVersion 23
16-
buildToolsVersion "23.0.1"
22+
compileSdkVersion _compileSdkVersion
23+
buildToolsVersion _buildToolsVersion
1724

1825
defaultConfig {
19-
minSdkVersion 16
20-
targetSdkVersion 22
26+
minSdkVersion _minSdkVersion
27+
targetSdkVersion _targetSdkVersion
2128
versionCode 1
2229
versionName "1.0"
2330
}
@@ -26,11 +33,7 @@ android {
2633
}
2734
}
2835

29-
repositories {
30-
mavenCentral()
31-
}
32-
3336
dependencies {
34-
compile 'com.facebook.react:react-native:+'
37+
//noinspection GradleDynamicVersion
38+
provided "com.facebook.react:react-native:${_reactNativeVersion}"
3539
}
36-

android/src/main/java/iyegoroff/RNTextGradient/Linear/RNLinearTextGradientSpan.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ public void updateDrawState(TextPaint paint) {
7474
mColors != null &&
7575
mLocations != null &&
7676
mText != null &&
77-
!YogaConstants.isUndefined(mMaxWidth)
77+
!YogaConstants.isUndefined(mMaxWidth) &&
78+
mMaxWidth != 0 &&
79+
mMaxHeight != 0
7880
) {
7981

8082
FontMetrics metrics = paint.getFontMetrics();

example/.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["react-native"]
2+
"presets": ["module:metro-react-native-babel-preset"]
33
}

example/.flowconfig

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,19 @@ node_modules/react-native/flow-github/
3030
emoji=true
3131

3232
module.system=haste
33+
module.system.haste.use_name_reducers=true
34+
# get basename
35+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
36+
# strip .js or .js.flow suffix
37+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
38+
# strip .ios suffix
39+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
40+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
41+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
42+
module.system.haste.paths.blacklist=.*/__tests__/.*
43+
module.system.haste.paths.blacklist=.*/__mocks__/.*
44+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
45+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
3346

3447
munge_underscores=true
3548

@@ -51,4 +64,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
5164
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
5265

5366
[version]
54-
^0.67.0
67+
^0.75.0

0 commit comments

Comments
 (0)