attentiveness / reading Goto Github PK
View Code? Open in Web Editor NEWiReading App Write In React-Native
Home Page: https://richardcao.me/2016/07/05/Talk-About-Reading/
License: Apache License 2.0
iReading App Write In React-Native
Home Page: https://richardcao.me/2016/07/05/Talk-About-Reading/
License: Apache License 2.0
var singleinstance;
ReadingToolbar = ({
title,
subtitle,
actions,
navigator,
onActionSelected,
onIconClicked,
navIconName
}) => {
const handleIconClicked = () => {
if (onIconClicked) {
onIconClicked();
} else if (navigator) {
naviGoBack(navigator);
}
};
const renderToolbarAndroid = () => (
<Icon.ToolbarAndroid
style={styles.toolbar}
actions={actions}
onActionSelected={onActionSelected}
onIconClicked={handleIconClicked}
navIconName={navIconName === undefined ? 'md-arrow-back' : navIconName}
titleColor="#fff"
title={title}
subtitleColor="#fff"
subtitle={subtitle}
overflowIconName="md-more"
>
<CountdownText/>
</Icon.ToolbarAndroid>
);
const renderToolbarIOS = () => {
const action = actions[0];
showActionButton = action !== undefined;
return (
<View style={styles.toolbar}>
<Icon.Button
name={navIconName === undefined ? 'ios-arrow-back' : navIconName}
iconStyle={styles.leftIOS}
onPress={handleIconClicked}
backgroundColor="transparent"
underlayColor="transparent"
activeOpacity={0.8}
/>
<Text
style={[styles.titleIOS,
showActionButton ? { paddingLeft: 0 } : { paddingLeft: -35 }]}
>
{title}+{'\t\t\t'}+{subtitile}
</Text>
{showActionButton && action.show === 'always' ?
<Icon.Button
iconStyle={showActionButton ? styles.rightIOS : { height: 0, width: 0 }}
name={action.iconName}
backgroundColor="transparent"
underlayColor="transparent"
activeOpacity={0.8}
onPress={onActionSelected}
/> :
<Button
containerStyle={showActionButton ? styles.rightIOS : { height: 0, width: 0 }}
style={styles.rightText}
text={showActionButton ? action.title : ''}
onPress={onActionSelected}
/>
}
</View>
);
};
const Toolbar = Platform.select({
android: () => renderToolbarAndroid(),
ios: () => renderToolbarIOS()
});
singleinstance=
console.log(this);
console.log('----single------');
console.log(singleinstance);
return singleinstance;
};
const styles = StyleSheet.create({
toolbar: {
flexDirection: 'column',
backgroundColor: '#3e9ce9',
alignItems: 'center',
height: 58
},
titleIOS: {
flex: 1,
textAlign: 'center',
color: '#fff',
fontSize: 20,
marginTop: 20
},
leftIOS: {
marginTop: 20,
marginLeft: 8
},
rightIOS: {
marginTop: 20,
marginRight: 8
},
rightText: {
textAlign: 'center',
color: '#fff',
fontSize: 18
}
});
export default ReadingToolbar;
readingtoolbar的代码等价于以上代码,其中代码块被我省略,那些属性和赋值都是没有用的,因为不会被调用。
因为这个导出的是一个对象字面量,这个对象字面量用的方法是()=> 每次都会重新生成一个导航控件。这样做的结果是,每次从drawtab项进入子页面都用的是一个新的导航控件,虽然退出的时候也会unmount,但是这个unmount并不等于会被gc清除掉,只是被挂载。所以这些对象并没有被释放容易导致内存泄漏,很明显的例子是,开了debug模式进入这些页面之后会非常卡,因为dubug模式跟这些未被释放的资源有监控联系。同理,如果是比较复杂的页面不用单例模式会导致崩溃。
undefined is not an object (evaluating 'WeChat.registerApp')
index.js -> line 183
ios版的获取不到数据,网络错误
你好,我想请问下,APP在加载完 IOS的 LaunchImage 之后 会闪一下白屏,然后再跳转到 Splash 页面,这个该怎么处理呢?
npm install 后,在代码中加import Modal from 'react-native-root-modal';
报标题的错误,是没安装上去还是怎么回事?
because codepush has update to 1.12.2-beta and codepush implements reactPackage
so in mainActivity.java
this.codePush.getReactPackage() can instead of this.codePush directly
A problem occurred configuring project ':RNDeviceInfo'.
Could not resolve all dependencies for configuration ':RNDeviceInfo:_debugCompile'.
Could not find com.google.android.gms:play-services-gcm:8.3.0.
Searched in the following locations:
file:/C:/Users/Administrator/.m2/repository/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.pom
file:/C:/Users/Administrator/.m2/repository/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.jar
https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.jar
file:/E:/works/rn/gitphoto/reading/node_modules/node_modules/react-native/android/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.pom
file:/E:/works/rn/gitphoto/reading/node_modules/node_modules/react-native/android/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.jar
file:/D:/codes/android-sdk-windows/extras/android/m2repository/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.pom
file:/D:/codes/android-sdk-windows/extras/android/m2repository/com/google/android/gms/play-services-gcm/8.3.0/play-services-gcm-8.3.0.jar
Required by:
reading:RNDeviceInfo:unspecified
原因在此
react-native-device-info/react-native-device-info#78
Could not expand ZIP 'D:\ProgramFiles\android_sdk\extras\android\m2repository\com\android\support\appcompat-v7\22.2.0\appcompat-v7-22.2.0.aar'.
我的sdk目录下是存在这个aar的
TransformError: /Users/xxx/Desktop/git/reading/node_modules/debug/browser.js: Couldn't find preset "es2015" relative to directory "/Users/xxx/Desktop/git/reading/node_modules/debug"
RCTFatal
-[RCTBatchedBridge stopLoadingWithError:]
__25-[RCTBatchedBridge start]_block_invoke_2
_dispatch_call_block_and_release
_dispatch_client_callout
_dispatch_main_queue_callback_4CF
CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
__CFRunLoopRun
CFRunLoopRunSpecific
GSEventRunModal
UIApplicationMain
main
start
从AppStore安装了iReading,启动后选择分类时,提示“网路发生错误,请重试”
#import "RCTBundleURLProvider.h"
#import "RCTBundleURLProvider.h" file not found 找不到这个文件
这个问题怎么解决呢? 是不是版本不同所产生的问题
= = 求解
hi
本人最近在学习RN,无意中发现了这个项目,我去app store下载后,打开发现没办法用,到处都是网络链接错误,所以想问一下,此项目是否还在维护?
环境:
mac系统、jdk 1.8、android studio 2.1
错误信息:
AGPBI: {"kind":"simple","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"simple","text":"(com.tencent.mm.sdk.openapi.WXApiImplV10$ActivityLifecycleCb$1) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"simple","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"simple","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"simple","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"simple","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"simple","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"simple","text":"indicate that it is *not* an inner class.","sources":[{}]}
AGPBI: {"kind":"simple","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"simple","text":"(com.tencent.mm.sdk.openapi.WXApiImplV10$ActivityLifecycleCb$2) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"simple","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"simple","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"simple","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"simple","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"simple","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"simple","text":"indicate that it is *not* an inner class.","sources":[{}]}
AGPBI: {"kind":"simple","text":"warning: Ignoring InnerClasses attribute for an anonymous inner class","sources":[{}]}
AGPBI: {"kind":"simple","text":"(com.tencent.mm.sdk.b.b) that doesn\u0027t come with an","sources":[{}]}
AGPBI: {"kind":"simple","text":"associated EnclosingMethod attribute. This class was probably produced by a","sources":[{}]}
AGPBI: {"kind":"simple","text":"compiler that did not target the modern .class file format. The recommended","sources":[{}]}
AGPBI: {"kind":"simple","text":"solution is to recompile the class from source, using an up-to-date compiler","sources":[{}]}
AGPBI: {"kind":"simple","text":"and without specifying any \"-target\" type options. The consequence of ignoring","sources":[{}]}
AGPBI: {"kind":"simple","text":"this warning is that reflective operations on this class will incorrectly","sources":[{}]}
AGPBI: {"kind":"simple","text":"indicate that it is *not* an inner class.","sources":[{}]}
打包最终结果如下:
app-armeabi-v7a-release-unaligned.apk
app-armeabi-v7a-release.apk
app-x86-release-unaligned.apk
app-x86-release.apk
请问会有什么影响吗?
Installing build/Build/Products/Debug-iphonesimulator/reading.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/reading.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
我也是运行ios报错 RCTBridgeModule.h这个头文件没找到,看到你说的RCTWebChat.xcodeproj的build setting 下改,改完以后还是报找不到,
$(SRCROOT)/../../react-native/React
$(SRCROOT)/../../react-native/Libraries
这样两个一个是加在header search path
一个是加在library search path 下,对吧,要选recursive么
Yoy said that it support Android 4.1 (API 16)+
But it throw a exception on API19;
with:
Caused by: com.facebook.react.bridge.JSApplicationIllegalArgumentException: Attribute selectableItemBackgroundBorderless couldn't be found in the resource list;
had depend on: com.android.support:appcompat-v7:23.3.0
May I have done something wrong?
cause: react-native-root-toasts
does not compile es6 code to es5 when uploading to npm.
when: mocha test with babel-register, it will by default ignore any file that is located in node_modules, so the es6 files in react-native-root-toasts
will cause test fail.
solution: configure babel to include react-native-root-toasts
if you used it in your tests or ask the user to compile it to es5 as other npm modules.
I've opened an issue in the original repo: magicismight/react-native-root-toast#16
导致app打不开啊
unkown module "./qiniu/io.js" 经过全局搜索发现是leancolud-storage中的问题 不知道怎么解决。谢谢
isRefreshing: false,
loading: false,
isLoadMore: false,
noMore: false,
造成展示状态混乱,不同列表应对应不同状态
多列表共享page 数据展示错误
比如列表1到了第10页,列表二才刚展示,但是加载更多的时候就是从第11页开始的
我直接clone了项目到本地然后
dashzhao@dashdeMacBook-Pro:~/Learn/reactNative$ git clone https://github.com/attentiveness/reading.git Cloning into 'reading'... remote: Counting objects: 1509, done. remote: Compressing objects: 100% (76/76), done. remote: Total 1509 (delta 25), reused 0 (delta 0), pack-reused 1429 Receiving objects: 100% (1509/1509), 1.77 MiB | 120.00 KiB/s, done. Resolving deltas: 100% (822/822), done. Checking connectivity... done. dashzhao@dashdeMacBook-Pro:~/Learn/reactNative$ ls AwesomeProject Hello UseView reading dashzhao@dashdeMacBook-Pro:~/Learn/reactNative$ cd reading/ dashzhao@dashdeMacBook-Pro:~/Learn/reactNative/reading$ ls LICENSE Reading_OnLine_Accident.md index.android.js package.json README.md android index.ios.js screenshot Reading_Logo.png app ios dashzhao@dashdeMacBook-Pro:~/Learn/reactNative/reading$ react-native run-android Command
run-androidunrecognized. Did you mean to run this inside a react-native project?
好了我知道怎么做了 ,
需要npm install
这样下载package.json 里的依赖
你好!我对store 最后configureStore(initialState) 这方法不太懂想请教一下
export default function configureStore(initialState) {
const store = createStoreWithMiddleware(rootReducer, initialState);
return store;
}
FAILURE: Build failed with an exception.
Could not copy zip entry E:\WorkSpace\Studio_space_Test\ReactNativeDemo\readin
g-master1\reading-master\node_modules\react-native-wechat\android\build\outputs
aar\RCTWeChat-release.aar!res/ to 'E:\WorkSpace\Studio_space_Test\ReactNativeDem
o\reading-master1\reading-master\android\app\build\intermediates\exploded-aar\re
ading\RCTWeChat\unspecified\res'.
在windows坏境会产生这个错误,这个module在node_module是存在的。
在mac坏境正常,请问怎么解决?
你好,我使用的是windows 7,git clone了你的代码,npm install了相关依赖,一切正常,执行react-native run-android后编译失败,输入如下:
Incremental java compilation is an incubating feature.
:RCTWeChat:preBuild UP-TO-DATE
:RCTWeChat:preReleaseBuild UP-TO-DATE
:RCTWeChat:checkReleaseManifest
:RCTWeChat:preDebugAndroidTestBuild UP-TO-DATE
:RCTWeChat:preDebugBuild UP-TO-DATE
:RCTWeChat:preDebugUnitTestBuild UP-TO-DATE
:RCTWeChat:preReleaseUnitTestBuild UP-TO-DATE
:RCTWeChat:prepareComAndroidSupportAppcompatV72301Library UP-TO-DATE
:RCTWeChat:prepareComAndroidSupportRecyclerviewV72301Library UP-TO-DATE
:RCTWeChat:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:RCTWeChat:prepareComFacebookFrescoDrawee061Library UP-TO-DATE
:RCTWeChat:prepareComFacebookFrescoFbcore061Library UP-TO-DATE
:RCTWeChat:prepareComFacebookFrescoFresco061Library UP-TO-DATE
:RCTWeChat:prepareComFacebookFrescoImagepipeline061Library UP-TO-DATE
:RCTWeChat:prepareComFacebookFrescoImagepipelineOkhttp061Library UP-TO-DATE
:RCTWeChat:prepareComFacebookReactReactNative0153Library UP-TO-DATE
:RCTWeChat:prepareOrgWebkitAndroidJscR174650Library UP-TO-DATE
:RCTWeChat:prepareReleaseDependencies
:RCTWeChat:compileReleaseAidl UP-TO-DATE
:RCTWeChat:compileReleaseNdk UP-TO-DATE
:RCTWeChat:compileLint UP-TO-DATE
:RCTWeChat:copyReleaseLint UP-TO-DATE
:RCTWeChat:compileReleaseRenderscript UP-TO-DATE
:RCTWeChat:generateReleaseBuildConfig UP-TO-DATE
:RCTWeChat:generateReleaseResValues UP-TO-DATE
:RCTWeChat:generateReleaseResources UP-TO-DATE
:RCTWeChat:mergeReleaseResources UP-TO-DATE
:RCTWeChat:processReleaseManifest UP-TO-DATE
:RCTWeChat:processReleaseResources UP-TO-DATE
:RCTWeChat:generateReleaseSources UP-TO-DATE
:RCTWeChat:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:RCTWeChat:compileReleaseJavaWithJavac UP-TO-DATE
:RCTWeChat:extractReleaseAnnotations FAILED
FAILURE: Build failed with an exception.
com/intellij/psi/PsiJavaFile
有4个分类,就会弹出4次
你好,我再win10启动的工程,部署到手机上后,手机加载完bundle后出现了requiring known module ”./qiniu/auth/digest.js”.If you are sure the module is there, try restarting the packager or running npm install 的异常,但是工程中已经存在了qiniu的module,且npm清空缓存都没用,您知道是为什么么?
.../reading/node_modules/promise/lib/done.js:10
throw err;
^
Error: xcodebuild process exited with code 65
at ChildProcess. (runIOS.js:102:14)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:850:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)
找不到leadclound-storage下的qiniu/io.js 然后我下载了网站上了apk 也进入之后会闪退 。 昨天老大打包发现在android 4.4 下会出现闪退的问题 你看看是不是我4.4的问题 谢谢!
NavigationExperimental based router and navigation methods can be driven by declarative way of changing the routes instead of directly accessing the navigation state by pushing and poping.
In short, solutions like react-native-router-flux and ex-navigation can simplify the navigation logic just like we use redux to simplify the application state.
Let's try to learn and understand these solutions and try to integrate them into this project.
Hi @Richard-Cao , Thank you for this awesome app. Im very new to react native so when i see this app, i feel little bit difficult to understand. If you find some time please add any simple react-native redux app using post and get data from local server. It would be more helpful to understand.
Thanks in Advance
2016-11-30 13:45:36.114 [info][tid:main][RCTBatchedBridge.m:73] Initializing <RCTBatchedBridge: 0x1345f1700> (parent: <RCTBridge: 0x1345f0e30>, executor: RCTJSCExecutor)
2016-11-30 13:45:36.120 iReading[5649:541805] * Assertion failure in -RCTBatchedBridge loadSource:onProgress:, /Users/Ailix/RN/reading/node_modules/.0.38.0@react-native/React/Base/RCTBatchedBridge.m:197
看了下jsCodeLocation为空 新手求助
iOS xcode 运行的时候微信分享的报错
/Users/pan/GitHub/reading/node_modules/react-native-wechat/ios/RCTWeChat.h:10:9: 'RCTBridgeModule.h' file not found
你好,我想请教下 我仿照案例新建了一个Demo,然后一点一点照搬代码去理解,运行之后,Android可以显示出来 新闻列表数据,但是 Ios显示 TypeError:Network request failed 这个错误。
进入app后报错,请看看这是什么问题?
TaskQueue: Error with task : undefined is not an object (evaluating 'DrawerLayoutAndroid.positions.Left')
Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
Could not find any matches for com.tencent.bugly:crashreport:latest.release as no versions of com.tencent.bugly:crashreport are available.
Required by:
reading:app:unspecified
var singleinstance;
ReadingToolbar = ({
title,
subtitle,
actions,
navigator,
onActionSelected,
onIconClicked,
navIconName
}) => {
const handleIconClicked = () => {
if (onIconClicked) {
onIconClicked();
} else if (navigator) {
naviGoBack(navigator);
}
};
const renderToolbarAndroid = () => (
<Icon.ToolbarAndroid
style={styles.toolbar}
actions={actions}
onActionSelected={onActionSelected}
onIconClicked={handleIconClicked}
navIconName={navIconName === undefined ? 'md-arrow-back' : navIconName}
titleColor="#fff"
title={title}
subtitleColor="#fff"
subtitle={subtitle}
overflowIconName="md-more"
>
<CountdownText/>
</Icon.ToolbarAndroid>
);
const renderToolbarIOS = () => {
const action = actions[0];
showActionButton = action !== undefined;
return (
<View style={styles.toolbar}>
<Icon.Button
name={navIconName === undefined ? 'ios-arrow-back' : navIconName}
iconStyle={styles.leftIOS}
onPress={handleIconClicked}
backgroundColor="transparent"
underlayColor="transparent"
activeOpacity={0.8}
/>
<Text
style={[styles.titleIOS,
showActionButton ? { paddingLeft: 0 } : { paddingLeft: -35 }]}
>
{title}+{'\t\t\t'}+{subtitile}
</Text>
{showActionButton && action.show === 'always' ?
<Icon.Button
iconStyle={showActionButton ? styles.rightIOS : { height: 0, width: 0 }}
name={action.iconName}
backgroundColor="transparent"
underlayColor="transparent"
activeOpacity={0.8}
onPress={onActionSelected}
/> :
<Button
containerStyle={showActionButton ? styles.rightIOS : { height: 0, width: 0 }}
style={styles.rightText}
text={showActionButton ? action.title : ''}
onPress={onActionSelected}
/>
}
</View>
);
};
const Toolbar = Platform.select({
android: () => renderToolbarAndroid(),
ios: () => renderToolbarIOS()
});
singleinstance=
console.log(this);
console.log('----single------');
console.log(singleinstance);
return singleinstance;
};
const styles = StyleSheet.create({
toolbar: {
flexDirection: 'column',
backgroundColor: '#3e9ce9',
alignItems: 'center',
height: 58
},
titleIOS: {
flex: 1,
textAlign: 'center',
color: '#fff',
fontSize: 20,
marginTop: 20
},
leftIOS: {
marginTop: 20,
marginLeft: 8
},
rightIOS: {
marginTop: 20,
marginRight: 8
},
rightText: {
textAlign: 'center',
color: '#fff',
fontSize: 18
}
});
export default ReadingToolbar;
readingtoolbar的代码等价于以上代码,其中代码块被我省略,那些属性和赋值都是没有用的,因为不会被调用。
### 建议为什么要是单例呢?
> 因为这个导出的是一个对象字面量,这个对象字面量用的方法是()=> 每次都会重新生成一个导航控件。这样做的结果是,每次从drawtab项进入子页面都用的是一个新的导航控件,虽然退出的时候也会unmount,但是这个unmount并不等于会被gc清除掉,只是被挂载。所以这些对象并没有被释放容易导致内存泄漏,很明显的例子是,开了debug模式进入这些页面之后会非常卡,因为dubug模式跟这些未被释放的资源有监控联系。同理,如果是比较复杂的页面不用单例模式会导致崩溃。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.