smuyyh / bookreader Goto Github PK
View Code? Open in Web Editor NEW:closed_book: "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~
License: Apache License 2.0
:closed_book: "任阅" 网络小说阅读器,3D翻页效果、txt/pdf/epub书籍阅读、Wifi传书~
License: Apache License 2.0
博主,能不能抽时间就如何获取应用的api写个博客啊,想学习下,很好的项目
请问支持的书籍格式是pdf?epub?还是txt?
有编译好的包吗,
发现在看书页面点击返回键会报错
com.justwayward.reader E/MessageQueue-JNI: java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at com.justwayward.reader.manager.CollectionsManager.isCollected(CollectionsManager.java:79)
at com.justwayward.reader.ui.activity.ReadActivity.onKeyDown(ReadActivity.java:529)
at android.view.KeyEvent.dispatch(KeyEvent.java:2693)
at android.app.Activity.dispatchKeyEvent(Activity.java:2785)
at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:534)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2389)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4557)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4513)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4035)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4088)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4054)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4191)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4062)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4248)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4035)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4088)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4054)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4062)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4035)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4088)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4054)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4224)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4394)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2285)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1909)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1900)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2262)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:151)
at android.app.ActivityThread.main(ActivityThread.java:5667)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:962)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
09-30 16:13:38.617 32756-32756/com.justwayward.reader E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.justwayward.reader, PID: 32756
java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Iterator java.util.List.iterator()' on a null object reference
at com.justwayward.reader.manager.CollectionsManager.isCollected(CollectionsManager.java:79)
at com.justwayward.reader.ui.activity.ReadActivity.onKeyDown(ReadActivity.java:529)
at android.view.KeyEvent.dispatch(KeyEvent.java:2693)
at android.app.Activity.dispatchKeyEvent(Activity.java:2785)
at android.support.v7.app.AppCompatActivity.dispatchKeyEvent(AppCompatActivity.java:534)
at android.support.v7.view.WindowCallbackWrapper.dispatchKeyEvent(WindowCallbackWrapper.java:50)
at android.support.v7.app.AppCompatDelegateImplBase$AppCompatWindowCallbackBase.dispatchKeyEvent(AppCompatDelegateImplBase.java:241)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchKeyEvent(PhoneWindow.java:2389)
at android.view.ViewRootImpl$ViewPostImeInputStage.processKeyEvent(ViewRootImpl.java:4557)
at android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(ViewRootImpl.java:4513)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4035)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4088)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4054)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4191)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4062)
at android.view.ViewRootImpl$AsyncInputStage.apply(ViewRootImpl.java:4248)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4035)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4088)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4054)
at android.view.ViewRootImpl$InputStage.apply(ViewRootImpl.java:4062)
at android.view.ViewRootImpl$InputStage.deliver(ViewRootImpl.java:4035)
at android.view.ViewRootImpl$InputStage.onDeliverToNext(ViewRootImpl.java:4088)
at android.view.ViewRootImpl$InputStage.forward(ViewRootImpl.java:4054)
at android.view.ViewRootImpl$AsyncInputStage.forward(ViewRootImpl.java:4224)
at android.view.ViewRootImpl$ImeInputStage.onFinishedInputEvent(ViewRootImpl.java:4394)
at android.view.inputmethod.InputMethodManager$PendingEvent.run(InputMethodManager.java:2285)
at android.view.inputmethod.InputMethodManager.invokeFinishedInputEventCallback(InputMethodManager.java:1909)
at android.view.inputmethod.InputMethodManager.finishedInputEvent(InputMethodManager.java:1900)
at android.view.inputmethod.InputMethodManager$ImeInputEventSender.onInputEventFinished(InputMethodManager.java:2262)
at android.view.InputEventSender.dispatchInputEventFinished(InputEventSender.java:141)
at android.os.MessageQueue.nativePollOnce(Native Method)
at android.os.MessageQueue.next(MessageQueue.java:148)
at android.os.Looper.loop(Looper.java:151)
at android.app.ActivityThread.main(ActivityThread.java:5667)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:962)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
在阅读时切换日夜间模式,比如切换为夜间,返回主页追书页面,会出现日夜间混淆,标题栏为夜间模式, 追书列表为日间模式, 手机小米1S,4.1.2
can't find modules ...
翻页模式的功能有待优化,每次点击或者翻到一半再翻回去都会响应翻页操作。
CollectionsManager line 79 出现空指针异常
public boolean isCollected(String bookId) {
List<Recommend.RecommendBooks> list = getCollectionList();
for (Recommend.RecommendBooks bean : list) { // 报空指针异样
if (bean._id.equals(bookId)) {
return true;
}
}
return false;
}
getConllectionList() 方法会返回 null 的。所以在 for 循环之前先加判断。
这是修改之后的
public boolean isCollected(String bookId) {
List<Recommend.RecommendBooks> list = getCollectionList();
if (list == null ) return false;
for (Recommend.RecommendBooks bean : list) {
if (bean._id.equals(bookId)) {
return true;
}
}
return false;
}
java.lang.UnsatisfiedLinkError: Couldn't load hci_curl from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.justwayward.reader-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.justwayward.reader-1, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.sinovoice.hcicloudsdk.api.tts.HciCloudTts.(SourceFile:79)
at com.sinovoice.hcicloudsdk.player.TTSCommonPlayer.init(SourceFile:279)
at com.justwayward.reader.utils.TTSPlayerUtils.getTTSPlayer(TTSPlayerUtils.java:18)
at com.justwayward.reader.ui.activity.ReadActivity.initDatas(ReadActivity.java:234)
at com.justwayward.reader.base.BaseActivity.onCreate(BaseActivity.java:53)
翻页效果 怎么网上都找不到开源的啊 一般的阅读器左右平滑 上下滑动 仿真 仿真像QQ阅读那样的比较好,现在用的最多的我感觉还是上下 和 左右滑动两种, 大神有这方面的资源吗?
如题
我的是SONY Z3v 5.1.1的系统, 另外问一下楼主, 我想实现一个简单的txt文本阅读, 楼主能否告诉我长文本时如何分批读取, 然后又能自动读取上次的观看位置, 只需告诉我一个思路就行, 或者你能告诉我你这个源码中那部分是关于这个的?
我在其他地方看了一些书,几百章了,好难翻 T_T
发现- -排行榜里面的数据返回了两次.
这更新频率 这速度!!!!
真是好勤奋的大神啊!
俺要像你慢慢学习!!!!!!!!!!
gradle 3.1 下编译不过了,不知道能否解决一下;mac 下使用homebrew 来安装的 gradle,最老的版本都不是 2.10 了
6.0以上默认关闭所有权限,导致获取数据时报这个异常java.lang.SecurityException: getDeviceId: Neither user 10158 nor current process has android.permission.READ_PHONE_STAT
请在启动时判断 手机版本 并且6.0以上动态获取权限
10-14 15:21:39.496 9473-9473/com.justwayward.reader E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.justwayward.reader, PID: 9473
java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true
at android.support.v7.widget.RecyclerView$Recycler.recycleViewHolderInternal(RecyclerView.java:4878)
at android.support.v7.widget.RecyclerView$Recycler.quickRecycleScrapView(RecyclerView.java:4951)
at android.support.v7.widget.RecyclerView$LayoutManager.removeAndRecycleScrapInt(RecyclerView.java:7352)
at android.support.v7.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:3101)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2917)
at android.support.v7.widget.RecyclerView.consumePendingUpdateOperations(RecyclerView.java:1482)
at android.support.v7.widget.RecyclerView.access$400(RecyclerView.java:147)
at android.support.v7.widget.RecyclerView$1.run(RecyclerView.java:294)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:894)
at android.view.Choreographer.doCallbacks(Choreographer.java:696)
at android.view.Choreographer.doFrame(Choreographer.java:628)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:880)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5905)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:749)
你好,想问下读书界面的夜间模式不生效,是bug吗
可能是之前的数据与现在的逻辑不符合,动不动就因为一些时间字段报错,例如 更新时间排序,格式化追书神器返回的时间字符串,现在只能赶紧把书单抢救出来,重新弄了~~~
我发现有的书,比追书神器的内容更新慢,这是为什么,是接口权限的问题,还是业务逻辑处理导致的?
大神真是厉害,已下载试用,虽然还有很多功能没有实现,不过还是希望追书神器的API不要那么快就加密,否则只能解析百度了。不过追书好像不是很及时啊,在看的一本已经更新了,但是软件刷不出来(超品相师),而且追书神器也已经更新了。
txt文件内容可能是GBK、UTF-8、Unicode等不同的编码。
PageFactory中,读取文件等相关方法中默认使用的UTF-8编码。
/**
* 指针移到上一页页首
*/
private void pageUp() {
String strParagraph = "";
Vector lines = new Vector<>(); // 页面行
int paraSpace = 0;
mPageLineCount = mVisibleHeight / (mFontSize + mLineSpace);
while ((lines.size() < mPageLineCount) && (m_mbBufBeginPos > 0)) {
Vector paraLines = new Vector<>(); // 段落行
byte[] parabuffer = readParagraphBack(m_mbBufBeginPos); // 1.读取上一个段落
m_mbBufBeginPos -= parabuffer.length; // 2.变换起始位置指针
try {
strParagraph = new String(parabuffer, "UTF-8");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
strParagraph = strParagraph.replaceAll("\r\n", " ");
strParagraph = strParagraph.replaceAll("\n", " ");
while (strParagraph.length() > 0) { // 3.逐行添加到lines
int paintSize = mPaint.breakText(strParagraph, true, mVisibleWidth, null);
paraLines.add(strParagraph.substring(0, paintSize));
strParagraph = strParagraph.substring(paintSize);
}
lines.addAll(0, paraLines);
while (lines.size() > mPageLineCount) { // 4.如果段落添加完,但是超出一页,则超出部分需删减
try {
m_mbBufBeginPos += lines.get(0).getBytes("UTF-8").length; // 5.删减行数同时起始位置指针也要跟着偏移
lines.remove(0);
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
}
m_mbBufEndPos = m_mbBufBeginPos; // 6.最后结束指针指向下一段的开始处
paraSpace += mLineSpace;
mPageLineCount = (mVisibleHeight - paraSpace) / (mFontSize + mLineSpace); // 添加段落间距,实时更新行数
}
}
不知道有没有 api 文档,我在搜书神器网上没找到。谢谢!
大神,看你的代码有一段时间了,发现追书体验还不是很好啊。
最近大神在MainActivityPresenter类里添加同步书架的功能,发现有些书可用,有些书(超品相师)更新直接还退回去了(我打印的语句:MainActivityPresenter.java:92] - 网络最新lastChapter=第2582章 玉柔 本地最新章节book.lastChapter=第2751章 选择),操作方式:先在书籍详细界面点击追书后,返回书架界面,点击同步书架。ps:难不成是VIP章节导致的?不过在不保存到本地(保存到本地没试过),在书籍详细界面点击不追书,再点追书更新,主界面显示的最新章节就对了,不过进去阅读界面的目录还是没有更新。
此外,大神可以把lastChapter字段的数字提取出来,根据数字大小判断是否有更新,推送就不必了(目前实现的方式感觉就是写个服务隔断时间就去刷新,这样太恶心了)。
在华为G9 android 6.0 系统上 点击图书列表 程序异常崩溃
首次进入APP选择性别后,加载推荐列表,低概率闪退。TAB发现-分类-女性-(游戏竞技和莉莉两个子分类),大概率闪退。
表层原因是这两个页面的数据只有很少的几个,不能够填充满一页。
实质是EasyRecyclerView的OnRefresh在数据加载到绘制完成的过程中一直被调用。这个问题在页面数据铺满的时候不会造成大的问题。但是在数据不足一页的时候,EasyRecyclerView还会自动触发OnLoadMore方法。OnLoadMore方法会试图重绘制RecyclerView。但是刚刚上面说了,OnRefresh被调用了多次,有很大几率,在OnloadMore的时候,OnRefresh正在调用RecyclerArrayAdapter的clear方法,其中的notifyItemRangeRemoved(headers.size(), count),会报错java.lang.IllegalArgumentException: Scrapped or attached views may not be recycled. isScrap:false isAttached:true。
目前的解决办法是在adapter的clear方法notifyItemRangeRemoved前先notifyDataSetChanged。可以避免闪退,但是并不能解决问题,他会不断加载重复的数据……
至于更好的解决方法……耦合太厉害,暂时下不了手。
com.justwayward.reader.component.DaggerAppComponent 未提交 缺少
使用中发现,在阅读界面左边,只能上一页,我的手势是右边往左边翻,相同的,右边就只能下一页。
我发现,我的手指一按到屏幕,其实我要干嘛程序就已经判断完了.......
这个是不是旧版的阅读界面的问题呢?
我的代码现在是9月30号的。之后的还没更新,但是我看记录没有关于阅读界面的更新,应该是影响的吧。
在实体类里没有,但是会索引到debug文件夹下,这是为什么?
是从服务器下载的代码?
Could not find property 'KEYSTORE_FILE' on SigningConfig_Decorated{name=release, storeFile=null, storePassword=null, keyAlias=null, keyPassword=null, storeType=null}.
是用自己的签名么。
感谢分享
想先使用一下
Error:Connection refused: connect
: )
还缺一个追书更新时,广播通知的 通知栏的提示
状态栏不显示 不方便 看书的时候如果手机收到信息等, 如果点击中间能显示状态栏 就能看到,很方便
现在这样不显示太不方便了
wifi传书,看不了,出现乱码
项目很不错,请问翻页的效果能做到追书神器那样吗,感觉很舒服,我一直使用追书神器,体验很不错
com.justwayward.reader.component.DaggerAppComponent
项目里是不是少了这个类?说找不到。
导入本地书时。进度始终显示100%。单本书进度应该是全书长度的百分比。
com.justwayward.reader.component 这个包下怎么没了
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.