Skip to content

Commit 13afaa9

Browse files
committed
updated example & gradle config
1 parent e07dc67 commit 13afaa9

File tree

22 files changed

+1148
-1303
lines changed

22 files changed

+1148
-1303
lines changed

TextGradientExample/.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

TextGradientExample/App.js

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
/**
22
* Sample React Native App
33
* https://github.com/facebook/react-native
4+
*
5+
* @format
46
* @flow
57
*/
68

7-
import React, { Component } from 'react';
8-
import {
9-
Platform,
10-
StyleSheet,
11-
Text,
12-
View
13-
} from 'react-native';
9+
import React, {Component} from 'react';
10+
import {Platform, StyleSheet, Text, View} from 'react-native';
1411
import {LinearTextGradient} from 'react-native-text-gradient';
1512

1613
const instructions = Platform.select({
17-
ios: 'Press Cmd+R to reload,\n' +
18-
'Cmd+D or shake for dev menu',
19-
android: 'Double tap R on your keyboard to reload,\n' +
14+
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
15+
android:
16+
'Double tap R on your keyboard to reload,\n' +
2017
'Shake or press menu button for dev menu',
2118
});
2219

2320
export default class App extends Component {
2421
render() {
25-
2622
return (
2723
<View style={styles.container}>
2824
<LinearTextGradient
29-
ref={ref => console.warn('linear')}
3025
style={styles.welcome}
31-
colors={['red', 'green']}
3226
locations={[0, 1]}
33-
start={{x: 0, y: 0}}
34-
end={{x: 1, y: 0}}
27+
colors={['red', 'blue']}
28+
start={{ x: 0, y: 0 }}
29+
end={{ x: 1, y: 0 }}
3530
>
3631
Welcome to React Native!
3732
</LinearTextGradient>
@@ -51,10 +46,5 @@ const styles = StyleSheet.create({
5146
fontSize: 20,
5247
textAlign: 'center',
5348
margin: 10,
54-
},
55-
instructions: {
56-
textAlign: 'center',
57-
color: '#333333',
58-
marginBottom: 5,
59-
},
49+
}
6050
});

TextGradientExample/android/app/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def enableSeparateBuildPerCPUArchitecture = false
9494
def enableProguardInReleaseBuilds = false
9595

9696
android {
97-
compileSdkVersion 23
98-
buildToolsVersion "23.0.1"
97+
compileSdkVersion rootProject.ext.compileSdkVersion
98+
buildToolsVersion rootProject.ext.buildToolsVersion
9999

100100
defaultConfig {
101101
applicationId "com.textgradientexample"
102-
minSdkVersion 16
103-
targetSdkVersion 22
102+
minSdkVersion rootProject.ext.minSdkVersion
103+
targetSdkVersion rootProject.ext.targetSdkVersion
104104
versionCode 1
105105
versionName "1.0"
106106
ndk {
@@ -139,7 +139,7 @@ android {
139139
dependencies {
140140
compile project(':react-native-text-gradient')
141141
compile fileTree(dir: "libs", include: ["*.jar"])
142-
compile "com.android.support:appcompat-v7:23.0.1"
142+
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
143143
compile "com.facebook.react:react-native:+" // From node_modules
144144
}
145145

TextGradientExample/android/app/proguard-rules.pro

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,3 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18-
19-
# Disabling obfuscation is useful if you collect stack traces from production crashes
20-
# (unless you are using a system that supports de-obfuscate the stack traces).
21-
-dontobfuscate
22-
23-
# React Native
24-
25-
# Keep our interfaces so they can be used by other ProGuard rules.
26-
# See http://sourceforge.net/p/proguard/bugs/466/
27-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29-
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30-
31-
# Do not strip any method/class that is annotated with @DoNotStrip
32-
-keep @com.facebook.proguard.annotations.DoNotStrip class *
33-
-keep @com.facebook.common.internal.DoNotStrip class *
34-
-keepclassmembers class * {
35-
@com.facebook.proguard.annotations.DoNotStrip *;
36-
@com.facebook.common.internal.DoNotStrip *;
37-
}
38-
39-
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40-
void set*(***);
41-
*** get*();
42-
}
43-
44-
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45-
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
46-
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
47-
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
48-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50-
51-
-dontwarn com.facebook.react.**
52-
53-
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54-
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55-
-dontwarn android.text.StaticLayout
56-
57-
# okhttp
58-
59-
-keepattributes Signature
60-
-keepattributes *Annotation*
61-
-keep class okhttp3.** { *; }
62-
-keep interface okhttp3.** { *; }
63-
-dontwarn okhttp3.**
64-
65-
# okio
66-
67-
-keep class sun.misc.Unsafe { *; }
68-
-dontwarn java.nio.file.*
69-
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70-
-dontwarn okio.**
-362 Bytes
Loading
4.91 KB
Loading
-110 Bytes
Loading
2.79 KB
Loading
-273 Bytes
Loading
6.93 KB
Loading

0 commit comments

Comments
 (0)