Skip to content

Commit

Permalink
add linearGradient
Browse files Browse the repository at this point in the history
  • Loading branch information
necfol committed Jun 29, 2017
1 parent 738d361 commit e89f345
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 1 deletion.
1 change: 1 addition & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ android {
}

dependencies {
compile project(':react-native-linear-gradient')
compile project(':react-native-fetch-blob')
compile project(':react-native-sound')
compile project(':react-native-blur')
Expand Down
2 changes: 2 additions & 0 deletions android/app/src/main/java/com/micrncli/MainApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.app.Application;

import com.facebook.react.ReactApplication;
import com.BV.LinearGradient.LinearGradientPackage;
import com.RNFetchBlob.RNFetchBlobPackage;
import com.zmxv.RNSound.RNSoundPackage;
import com.cmcewen.blurview.BlurViewPackage;
Expand All @@ -28,6 +29,7 @@ public boolean getUseDeveloperSupport() {
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new LinearGradientPackage(),
new RNFetchBlobPackage(),
new RNSoundPackage(),
new BlurViewPackage(),
Expand Down
2 changes: 2 additions & 0 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
rootProject.name = 'MICRNCLI'
include ':react-native-linear-gradient'
project(':react-native-linear-gradient').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-linear-gradient/android')
include ':react-native-fetch-blob'
project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android')
include ':react-native-sound'
Expand Down
17 changes: 17 additions & 0 deletions ios/MICRNCLI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
0EAAFC7559D8464E994CEBCB /* libRNBlur.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 910E07598F4544BA8A3D9D98 /* libRNBlur.a */; };
58083D9D7D334C0D815631A9 /* libRNSound.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 6DF664DAB7024D83B56BB59A /* libRNSound.a */; };
C1BF7934A1EA44CA98EE5B45 /* libRNFetchBlob.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDF8A74B95994715AB43B70B /* libRNFetchBlob.a */; };
AB3AD7C6E2B44648B21AE6D1 /* libBVLinearGradient.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 291185F1300140F38D516AA6 /* libBVLinearGradient.a */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -306,6 +307,8 @@
6DF664DAB7024D83B56BB59A /* libRNSound.a */ = {isa = PBXFileReference; name = "libRNSound.a"; path = "libRNSound.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
363391F374354FB49850A822 /* RNFetchBlob.xcodeproj */ = {isa = PBXFileReference; name = "RNFetchBlob.xcodeproj"; path = "../node_modules/react-native-fetch-blob/ios/RNFetchBlob.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
DDF8A74B95994715AB43B70B /* libRNFetchBlob.a */ = {isa = PBXFileReference; name = "libRNFetchBlob.a"; path = "libRNFetchBlob.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
B8B2790D6586490FBF67EBCD /* BVLinearGradient.xcodeproj */ = {isa = PBXFileReference; name = "BVLinearGradient.xcodeproj"; path = "../node_modules/react-native-linear-gradient/BVLinearGradient.xcodeproj"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; };
291185F1300140F38D516AA6 /* libBVLinearGradient.a */ = {isa = PBXFileReference; name = "libBVLinearGradient.a"; path = "libBVLinearGradient.a"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -338,6 +341,7 @@
0EAAFC7559D8464E994CEBCB /* libRNBlur.a in Frameworks */,
58083D9D7D334C0D815631A9 /* libRNSound.a in Frameworks */,
C1BF7934A1EA44CA98EE5B45 /* libRNFetchBlob.a in Frameworks */,
AB3AD7C6E2B44648B21AE6D1 /* libBVLinearGradient.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -527,6 +531,7 @@
822B52A433A3451BBE2A7EF6 /* RNBlur.xcodeproj */,
505EBC21FF564717845C4770 /* RNSound.xcodeproj */,
363391F374354FB49850A822 /* RNFetchBlob.xcodeproj */,
B8B2790D6586490FBF67EBCD /* BVLinearGradient.xcodeproj */,
);
name = Libraries;
sourceTree = "<group>";
Expand Down Expand Up @@ -1100,6 +1105,7 @@
"$(SRCROOT)/../node_modules/react-native-blur/ios",
"$(SRCROOT)/../node_modules/react-native-sound/RNSound",
"$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
);
INFOPLIST_FILE = MICRNCLITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
Expand All @@ -1112,6 +1118,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand All @@ -1135,6 +1142,7 @@
"$(SRCROOT)/../node_modules/react-native-blur/ios",
"$(SRCROOT)/../node_modules/react-native-sound/RNSound",
"$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
);
INFOPLIST_FILE = MICRNCLITests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
Expand All @@ -1147,6 +1155,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand All @@ -1171,6 +1180,7 @@
"$(SRCROOT)/../node_modules/react-native-blur/ios",
"$(SRCROOT)/../node_modules/react-native-sound/RNSound",
"$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
);
INFOPLIST_FILE = MICRNCLI/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -1197,6 +1207,7 @@
"$(SRCROOT)/../node_modules/react-native-blur/ios",
"$(SRCROOT)/../node_modules/react-native-sound/RNSound",
"$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
);
INFOPLIST_FILE = MICRNCLI/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down Expand Up @@ -1230,6 +1241,7 @@
"$(SRCROOT)/../node_modules/react-native-blur/ios",
"$(SRCROOT)/../node_modules/react-native-sound/RNSound",
"$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
);
INFOPLIST_FILE = "MICRNCLI-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -1241,6 +1253,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -1274,6 +1287,7 @@
"$(SRCROOT)/../node_modules/react-native-blur/ios",
"$(SRCROOT)/../node_modules/react-native-sound/RNSound",
"$(SRCROOT)/../node_modules/react-native-fetch-blob/ios/**",
"$(SRCROOT)/../node_modules/react-native-linear-gradient/BVLinearGradient",
);
INFOPLIST_FILE = "MICRNCLI-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -1285,6 +1299,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
OTHER_LDFLAGS = (
"-ObjC",
Expand Down Expand Up @@ -1319,6 +1334,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.MICRNCLI-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -1349,6 +1365,7 @@
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
"\"$(SRCROOT)/$(TARGET_NAME)\"",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.MICRNCLI-tvOSTests";
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git",
"react-native-elements": "^0.12.2",
"react-native-fetch-blob": "^0.10.5",
"react-native-linear-gradient": "^2.0.0",
"react-native-qrcode-scanner": "0.0.11",
"react-native-scrollable-tab-view": "^0.6.7",
"react-native-search-bar": "^3.0.0",
Expand Down
19 changes: 18 additions & 1 deletion src/container/Cd.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
import React, { Component } from 'react';
import {
Text,
StyleSheet,
ScrollView,
Image,
Dimensions,
View
} from 'react-native';
import { connect } from 'react-redux';
import { NavigationActions } from 'react-navigation'
import LinearGradient from 'react-native-linear-gradient'
import MyNav from '../component/MyNav.js'
import MyStatusBar from '../component/MyStatusBar.js'
const SCREEN_HEIGHT = Dimensions.get('window').height
const navigateAction = NavigationActions.back({
key: null
})
var styles = StyleSheet.create({
linearGradient: {
height: 40,
},
buttonText: {
fontSize: 18,
fontFamily: 'Gill Sans',
textAlign: 'center',
margin: 10,
color: '#ffffff',
backgroundColor: 'transparent',
}
})
@connect(state => ({state}),
dispatch => ({
navGo: () => dispatch(navigateAction)
Expand Down Expand Up @@ -41,7 +56,9 @@ export default class Cd extends Component {
<View style={{position: 'absolute', top: 0, left: 0}}>
<MyNav textColor="#fff" backText="歌单" backgroundColor={this.state.backgroundColor} backFunc={() => {this.props.navGo()}}></MyNav>
<ScrollView style={{backgroundColor: 'rgba(246,246,246,0)', flex: 0, height: SCREEN_HEIGHT}} scrollEventThrottle={1} onScroll={e => this.handleScroll(e)}>
<View style={{height: 350, opacity: 0}}></View>
<View style={{height: 250}}></View>
<LinearGradient colors={['rgba(135, 130, 139,0)', 'rgba(135, 130, 139,1)']} style={styles.linearGradient}>
</LinearGradient>
{
[1,2,3,4,4,5,2,3,2,4,3,4,5,42,3,4,4,5,2,3,2,4,3,4,5,42,2,454,2,23,34,32,43,43,43,3,4,343,3,3,3,43,43,43,43,43,43].map((item, index) => (
<Text key={index}>haha</Text>
Expand Down

0 comments on commit e89f345

Please sign in to comment.