Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b54a0a0

Browse files
(1)添加 CoderReader 部分代码
(2)修正部分文件路径
1 parent 5dcb7c4 commit b54a0a0

File tree

12 files changed

+351
-11
lines changed

12 files changed

+351
-11
lines changed
File renamed without changes.

‎CoderReader/App.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { AppLoading } from "expo";
44
import { FontAwesome, MaterialIcons } from "@expo/vector-icons";
55
import RootNavigation from "./src/screen/RootNavigation";
66

7-
import cacheAssetsAsync from "./src/util/cacheAssetsAsync";
7+
import cacheAssetsAsync from "./src/util/cache";
88

99
export default class AppContainer extends React.Component {
1010
state = {

‎CoderReader/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ CoderReader 是笔者闲暇时编写的专门的技术人员阅读应用,其
2323

2424
本文余下部分是笔者在进行 React Native 开发过程中的笔记与实践总结,有兴趣者不妨一看。
2525

26+
## Integrated Open Source Code
27+
28+
- [kittenTricks](https://github.com/akveo/kittenTricks): A react native mobile starter kit with over 40 screens and theme hot reload support.
29+
2630
# 配置与调试
2731

2832
![](https://docs.expo.io/0af875d134c9a8835b71baaa0e1791bc-quality=50&pngCompressionLevel=9&width=1822.png)

‎CoderReader/package.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"fluent-fetcher": "0.2.8",
1818
"react": "16.0.0-alpha.12",
1919
"react-native": "https://github.com/expo/react-native/archive/sdk-18.0.1.tar.gz",
20+
"react-native-ui-kitten": "^2.0.1",
2021
"react-native-vector-icons": "^4.2.0",
2122
"react-navigation": "^1.0.0-beta.11",
2223
"styled-components": "^2.1.0"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// @flow
2+
3+
/**
4+
* Description 利用 Wallabag 进行网页抓取
5+
*/
6+
export default class WallabagAPI {}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// @flow
2+
import React from "react";
3+
4+
/**
5+
* renderListViewRow: function(row, pushNavBarTitle){
6+
return(
7+
<TouchableHighlight underlayColor={'#f3f3f2'}
8+
onPress={()=>this.selectRow(row, pushNavBarTitle)}>
9+
<View style={styles.rowContainer}>
10+
<Text style={styles.rowCount}>
11+
{row.count}
12+
</Text>
13+
<View style={styles.rowDetailsContainer}>
14+
<Text style={styles.rowTitle}>
15+
{row.title}
16+
</Text>
17+
<Text style={styles.rowDetailsLine}>
18+
Posted by {row.by} | {row.score} Points | {row.descendants} Comments
19+
</Text>
20+
<View style={styles.separator}/>
21+
</View>
22+
</View>
23+
</TouchableHighlight>
24+
);
25+
},
26+
27+
var styles = StyleSheet.create({
28+
rowContainer:{
29+
flex: 1,
30+
flexDirection: 'row',
31+
alignItems: 'center',
32+
},
33+
rowCount: {
34+
fontSize: 20,
35+
textAlign: 'right',
36+
color: 'gray',
37+
margin: 10,
38+
marginLeft: 15,
39+
},
40+
rowDetailsContainer: {
41+
flex: 1,
42+
},
43+
rowTitle: {
44+
fontSize: 15,
45+
textAlign: 'left',
46+
marginTop: 10,
47+
marginBottom: 4,
48+
marginRight: 10,
49+
color: '#FF6600'
50+
},
51+
rowDetailsLine: {
52+
fontSize: 12,
53+
marginBottom: 10,
54+
color: 'gray',
55+
},
56+
listview: {
57+
marginBottom:49
58+
},
59+
separator: {
60+
height: 1,
61+
backgroundColor: '#CCCCCC'
62+
}
63+
});
64+
*/
Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
// // @flow
2+
//
3+
// import React from 'react';
4+
// import {
5+
// View,
6+
// Image,
7+
// Keyboard
8+
// } from 'react-native';
9+
// import {
10+
// RkButton,
11+
// RkText,
12+
// RkTextInput,
13+
// RkAvoidKeyboard, RkStyleSheet
14+
// } from 'react-native-ui-kitten';
15+
// import {GradientButton} from '../../components/';
16+
// import {RkTheme} from 'react-native-ui-kitten';
17+
// import {scale, scaleModerate, scaleVertical} from '../../utils/scale';
18+
//
19+
// export class LoginV2 extends React.Component {
20+
// static navigationOptions = {
21+
// header: null
22+
// };
23+
//
24+
// constructor(props) {
25+
// super(props);
26+
// }
27+
//
28+
// render() {
29+
// let renderIcon = () => {
30+
// if (RkTheme.current.name === 'light')
31+
// return <Image style={styles.image} source={require('../../assets/images/logo.png')}/>;
32+
// return <Image style={styles.image} source={require('../../assets/images/logoDark.png')}/>
33+
// };
34+
//
35+
// return (
36+
// <RkAvoidKeyboard
37+
// style={styles.screen}
38+
// onStartShouldSetResponder={ (e) => true}
39+
// onResponderRelease={ (e) => Keyboard.dismiss()}>
40+
// <View style={styles.header}>
41+
// {renderIcon()}
42+
// <RkText rkType='light h1'>React Native</RkText>
43+
// <RkText rkType='logo h0'>UI Kitten</RkText>
44+
// </View>
45+
// <View style={styles.content}>
46+
// <View>
47+
// import React from 'react';
48+
// import {
49+
// View,
50+
// Image,
51+
// Keyboard
52+
// } from 'react-native';
53+
// import {
54+
// RkButton,
55+
// RkText,
56+
// RkTextInput,
57+
// RkAvoidKeyboard, RkStyleSheet
58+
// } from 'react-native-ui-kitten';
59+
// import {FontAwesome} from '../../assets/icons';
60+
// import {GradientButton} from '../../components/';
61+
// import {RkTheme} from 'react-native-ui-kitten';
62+
// import {scale, scaleModerate, scaleVertical} from '../../utils/scale';
63+
//
64+
// export class LoginV2 extends React.Component {
65+
// static navigationOptions = {
66+
// header: null
67+
// };
68+
//
69+
// constructor(props) {
70+
// super(props);
71+
// }
72+
//
73+
// render() {
74+
// let renderIcon = () => {
75+
// if (RkTheme.current.name === 'light')
76+
// return <Image style={styles.image} source={require('../../assets/images/logo.png')}/>;
77+
// return <Image style={styles.image} source={require('../../assets/images/logoDark.png')}/>
78+
// };
79+
//
80+
// return (
81+
// <RkAvoidKeyboard
82+
// style={styles.screen}
83+
// onStartShouldSetResponder={ (e) => true}
84+
// onResponderRelease={ (e) => Keyboard.dismiss()}>
85+
// <View style={styles.header}>
86+
// {renderIcon()}
87+
// <RkText rkType='light h1'>React Native</RkText>
88+
// <RkText rkType='logo h0'>UI Kitten</RkText>
89+
// </View>
90+
// <View style={styles.content}>
91+
// <View>
92+
// <RkTextInput rkType='rounded' placeholder='Username'/>
93+
// <RkTextInput rkType='rounded' placeholder='Password' secureTextEntry={true}/>
94+
// <GradientButton style={styles.save} rkType='large' text='LOGIN' onPress={() => {
95+
// this.props.navigation.goBack()
96+
// }}/>
97+
// </View>
98+
// <View style={styles.buttons}>
99+
// <RkButton style={styles.button} rkType='social'>
100+
// <RkText rkType='awesome hero'>{FontAwesome.twitter}</RkText>
101+
// </RkButton>
102+
// <RkButton style={styles.button} rkType='social'>
103+
// <RkText rkType='awesome hero'>{FontAwesome.google}</RkText>
104+
// </RkButton>
105+
// <RkButton style={styles.button} rkType='social'>
106+
// <RkText rkType='awesome hero'>{FontAwesome.facebook}</RkText>
107+
// </RkButton>
108+
// </View>
109+
//
110+
// <View style={styles.footer}>
111+
// <View style={styles.textRow}>
112+
// <RkText rkType='primary3'>Don’t have an account?</RkText>
113+
// <RkButton rkType='clear' onPress={() => this.props.navigation.navigate('SignUp')}>
114+
// <RkText rkType='header6'> Sign up now </RkText>
115+
// </RkButton>
116+
// </View>
117+
// </View>
118+
// </View>
119+
// </RkAvoidKeyboard>
120+
// )
121+
// }
122+
// }
123+
//
124+
// let styles = RkStyleSheet.create(theme => ({
125+
// screen: {
126+
// padding: scaleVertical(16),
127+
// flex: 1,
128+
// justifyContent: 'space-between',
129+
// backgroundColor: theme.colors.screen.base
130+
// },
131+
// image: {
132+
// height: scaleVertical(77),
133+
// resizeMode: 'contain'
134+
// },
135+
// header: {
136+
// paddingBottom: scaleVertical(10),
137+
// alignItems: 'center',
138+
// justifyContent: 'center',
139+
// flex: 1
140+
// },
141+
// content: {
142+
// justifyContent: 'space-between'
143+
// },
144+
// save: {
145+
// marginVertical: 20
146+
// },
147+
// buttons: {
148+
// flexDirection: 'row',
149+
// marginBottom: scaleVertical(24),
150+
// marginHorizontal: 24,
151+
// justifyContent: 'space-around',
152+
// },
153+
// textRow: {
154+
// flexDirection: 'row',
155+
// justifyContent: 'center'
156+
// },
157+
// button: {
158+
// borderColor: theme.colors.border.solid
159+
// },
160+
// footer: {}
161+
// }));
162+
// <RkTextInput rkType='rounded' placeholder='Password' secureTextEntry={true}/>
163+
// <GradientButton style={styles.save} rkType='large' text='LOGIN' onPress={() => {
164+
// this.props.navigation.goBack()
165+
// }}/>
166+
// </View>
167+
// <View style={styles.buttons}>
168+
// <RkButton style={styles.button} rkType='social'>
169+
// <RkText rkType='awesome hero'>{FontAwesome.twitter}</RkText>
170+
// </RkButton>
171+
// <RkButton style={styles.button} rkType='social'>
172+
// <RkText rkType='awesome hero'>{FontAwesome.google}</RkText>
173+
// </RkButton>
174+
// <RkButton style={styles.button} rkType='social'>
175+
// <RkText rkType='awesome hero'>{FontAwesome.facebook}</RkText>
176+
// </RkButton>
177+
// </View>
178+
//
179+
// <View style={styles.footer}>
180+
// <View style={styles.textRow}>
181+
// <RkText rkType='primary3'>Don’t have an account?</RkText>
182+
// <RkButton rkType='clear' onPress={() => this.props.navigation.navigate('SignUp')}>
183+
// <RkText rkType='header6'> Sign up now </RkText>
184+
// </RkButton>
185+
// </View>
186+
// </View>
187+
// </View>
188+
// </RkAvoidKeyboard>
189+
// )
190+
// }
191+
// }
192+
//
193+
// let styles = RkStyleSheet.create(theme => ({
194+
// screen: {
195+
// padding: scaleVertical(16),
196+
// flex: 1,
197+
// justifyContent: 'space-between',
198+
// backgroundColor: theme.colors.screen.base
199+
// },
200+
// image: {
201+
// height: scaleVertical(77),
202+
// resizeMode: 'contain'
203+
// },
204+
// header: {
205+
// paddingBottom: scaleVertical(10),
206+
// alignItems: 'center',
207+
// justifyContent: 'center',
208+
// flex: 1
209+
// },
210+
// content: {
211+
// justifyContent: 'space-between'
212+
// },
213+
// save: {
214+
// marginVertical: 20
215+
// },
216+
// buttons: {
217+
// flexDirection: 'row',
218+
// marginBottom: scaleVertical(24),
219+
// marginHorizontal: 24,
220+
// justifyContent: 'space-around',
221+
// },
222+
// textRow: {
223+
// flexDirection: 'row',
224+
// justifyContent: 'center'
225+
// },
226+
// button: {
227+
// borderColor: theme.colors.border.solid
228+
// },
229+
// footer: {}
230+
// }));

‎CoderReader/src/container/news/hacker_news/HackerNewsStories.js‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,16 @@
22

33
import React, { Component } from "react";
44
import {
5-
StyleSheet,
65
ActivityIndicator,
6+
ScrollView,
7+
StyleSheet,
78
Text,
8-
View,
9-
ScrollView
9+
View
1010
} from "react-native";
11-
import { AppLoading } from "expo";
11+
import { RkTextInput } from "react-native-ui-kitten";
1212

1313
import { hackerNewsApi } from "../../../api/news/hacker_news/HackerNewsApi";
14-
import {
15-
centerInRowStyleMixin,
16-
containerStyleMixin
17-
} from "../../../application/theme/style_mixins";
18-
import RefreshableListView
19-
from "../../../../fractal-reactnative-components/list/RefreshableListView";
14+
import { containerStyleMixin } from "../../../application/theme/style_mixins";
2015
export default class HackerNewsStories extends Component {
2116
async componentDidMount() {
2217
let stories = await hackerNewsApi.getTopStories();
@@ -31,6 +26,7 @@ export default class HackerNewsStories extends Component {
3126
>
3227

3328
<ActivityIndicator size={"large"} />
29+
<RkTextInput rkType="rounded" placeholder="Username" />
3430
</ScrollView>
3531
);
3632
}
File renamed without changes.

‎CoderReader/src/util/color.js‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// @flow
2+
3+
/**
4+
* Description 将十六进制转化为 RGB 格式
5+
* @param hex
6+
* @returns {string}
7+
*/
8+
export const hexToRGB = function (hex) {
9+
hex = parseInt(hex.slice(1), 16);
10+
let r = hex >> 16;
11+
let g = hex >> 8 & 0xFF;
12+
let b = hex & 0xFF;
13+
return `rgb(${r},${g},${b})`
14+
};

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /