Skip to content

Commit 38bd92c

Browse files
committed
working on android nested gradient
1 parent ebd136d commit 38bd92c

File tree

96 files changed

+10945
-9130
lines changed

Some content is hidden

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

96 files changed

+10945
-9130
lines changed
File renamed without changes.

example/.flowconfig renamed to TextGradientExample/.flowconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
[libs]
2525
node_modules/react-native/Libraries/react-native/react-native-interface.js
2626
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2827

2928
[options]
3029
emoji=true
3130

31+
esproposal.optional_chaining=enable
32+
esproposal.nullish_coalescing=enable
33+
3234
module.system=haste
3335
module.system.haste.use_name_reducers=true
3436
# get basename
@@ -64,4 +66,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6466
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6567

6668
[version]
67-
^0.75.0
69+
^0.92.0
File renamed without changes.
File renamed without changes.
File renamed without changes.

example/App.js renamed to TextGradientExample/App.js

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import React, {Component} from 'react';
1010
import {Platform, StyleSheet, Text, View} from 'react-native';
11-
import {LinearTextGradient} from 'react-native-text-gradient';
11+
import {LinearTextGradient} from 'react-native-text-gradient'
1212

1313
const instructions = Platform.select({
1414
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu',
@@ -17,19 +17,22 @@ const instructions = Platform.select({
1717
'Shake or press menu button for dev menu',
1818
});
1919

20-
export default class App extends Component {
20+
type Props = {};
21+
export default class App extends Component<Props> {
2122
render() {
2223
return (
2324
<View style={styles.container}>
2425
<LinearTextGradient
2526
style={styles.welcome}
2627
locations={[0, 1]}
27-
colors={['red', 'blue']}
28+
colors={['blue', 'red']}
2829
start={{ x: 0, y: 0 }}
2930
end={{ x: 1, y: 0 }}
3031
>
3132
Welcome to React Native!
3233
</LinearTextGradient>
34+
<Text style={styles.instructions}>To get started, edit App.js</Text>
35+
<Text style={styles.instructions}>{instructions}</Text>
3336
</View>
3437
);
3538
}
@@ -46,5 +49,10 @@ const styles = StyleSheet.create({
4649
fontSize: 20,
4750
textAlign: 'center',
4851
margin: 10,
49-
}
52+
},
53+
instructions: {
54+
textAlign: 'center',
55+
color: '#333333',
56+
marginBottom: 5,
57+
},
5058
});
File renamed without changes.

TextGradientExample/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
### Run debug version
2+
- Go to example folder `cd react-native-text-gradient/TextGradientExample`
3+
- Run `npm i && npm run run:android`
4+
5+
### Build signed release apk with Docker
6+
- Go to TextGradientExample folder `cd react-native-text-gradient/TextGradientExample`
7+
- Generate keystore `npm run generate:android:signing-key`
8+
- Open `TextGradientExample/android/gradle.properties` file and replace `qwerty`s with your passwords
9+
- Run `npm run build:release:docker` - upon script completion apk will be copied to `TextGradientExample/text-gradient.apk` file
File renamed without changes.

example/android/app/BUCK renamed to TextGradientExample/android/app/BUCK

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
# - `buck install -r android/app` - compile, install and run application
99
#
1010

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1113
lib_deps = []
1214

13-
for jarfile in glob(['libs/*.jar']):
14-
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15-
lib_deps.append(':' + name)
16-
prebuilt_jar(
17-
name = name,
18-
binary_jar = jarfile,
19-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
2016

21-
for aarfile in glob(['libs/*.aar']):
22-
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23-
lib_deps.append(':' + name)
24-
android_prebuilt_aar(
25-
name = name,
26-
aar = aarfile,
27-
)
17+
create_jar_targets(glob(["libs/*.jar"]))
2818

2919
android_library(
3020
name = "all-libs",

0 commit comments

Comments
 (0)