newbiechen1024 / novelreader Goto Github PK
View Code? Open in Web Editor NEW仿照"任阅"的追书、看书的小说阅读器。重写"任阅"的代码,优化代码逻辑和代码结构,降低内存使用率。重写小说阅读器,支持网络阅读、本地阅读(支持分章,虚拟分章)。支持仿真翻页、上下滚动翻页等翻页效果。支持小说断点续传功能。优化用户使用体验。
License: MIT License
仿照"任阅"的追书、看书的小说阅读器。重写"任阅"的代码,优化代码逻辑和代码结构,降低内存使用率。重写小说阅读器,支持网络阅读、本地阅读(支持分章,虚拟分章)。支持仿真翻页、上下滚动翻页等翻页效果。支持小说断点续传功能。优化用户使用体验。
License: MIT License
今天把系统刷到8.0了,发现翻页动画很卡很卡,几乎不能阅读了!8.0以下没有出现这个问题!
2017/9/14
上午6:22 Gradle sync started
上午6:22 Invalid VCS root mapping
The directory /Users/sun/Downloads/android/NovelReader-master is registered as a Git root, but no Git repositories were found there.
Configure
上午6:22 Gradle sync failed: Connection refused
Consult IDE log for more details (Help | Show Log)
新手小白,请帮忙解答一下,非常感谢!
读完图书后,退出页面后,没有释放内存,好像有内存泄漏
我想问下,不支撑上一页对角翻页是基于什么考虑的呢?
后续能支持epub PDF吗 这两个需求比较大,但市面上又很少
epub格式的好多好书可以看呢
最近在写小说项目,查了很多代码,找了任阅,还有你的升级版的,以及如风那个,由于本人技术有限,以前很少接触数据库和retrofit,看起来代码有点费劲,昨天提出来那个也是自己两个代码对比半天才解决的,虽然是站在了巨人的肩膀上,但是换成了我们这边的接口后还是不知道如何实现(主要是rx和greendao那些对我这种类小白来说瞅着相当费事),等我慢慢写出来后(脑袋都大了,快无爱了),如果你的代码还在更新,我会多测试帮忙提出来问题,再次感谢。
建议作者优化下,谢谢
原任阅都有的呀,亲
在BrightnessUtils工具类添加
public static void setDefaultBrightness(Activity activity) {
try{
WindowManager.LayoutParams lp = activity.getWindow().getAttributes();
//将 0255 范围内的数据,转换为 01
lp.screenBrightness = WindowManager.LayoutParams.BRIGHTNESS_OVERRIDE_NONE;
activity.getWindow().setAttributes(lp);
}catch(Exception ex){
ex.printStackTrace();
}
}
方法,在ReadSettingDialog 的mCbBrightnessAuto。isChecked的时候调用,ReadActivity的171行和243行注释掉,试试
下载列表更新下载进度的时候,出现闪动,下载列表点击暂停,再从书架点击缓存的时候,提示已经缓存
没啥时间 也懒得去优化任阅了~ 哈哈,加油
如题,断章的章节跨度很大,不准确
操作步骤,清理后台,打开IReader,载入一个本地txt文件,从书架打开,返回书架,再点击任意一个txt都会黑屏
后台报错信息:
01-06 22:47:20.552 2040-2059/com.example.newbiechen.ireader I/art: WaitForGcToComplete blocked for 5.419s for cause Background
01-06 22:47:20.552 2040-2040/com.example.newbiechen.ireader I/art: Waiting for a blocking GC Alloc
01-06 22:47:20.552 2040-2132/com.example.newbiechen.ireader I/art: Waiting for a blocking GC Alloc
01-06 22:47:20.577 2040-2040/com.example.newbiechen.ireader I/art: WaitForGcToComplete blocked for 875.902ms for cause Alloc
01-06 22:47:20.577 2040-2040/com.example.newbiechen.ireader I/art: Starting a blocking GC Alloc
01-06 22:47:20.578 2040-2132/com.example.newbiechen.ireader I/art: WaitForGcToComplete blocked for 328.382ms for cause Alloc
01-06 22:47:20.578 2040-2132/com.example.newbiechen.ireader I/art: Starting a blocking GC Alloc
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:111)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.os.Looper.loop(Looper.java:159)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6363)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at java.lang.reflect.Method.invoke(Native Method)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader W/System.err: Caused by: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
01-06 22:47:20.578 2040-2040/com.example.newbiechen.ireader E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.newbiechen.ireader, PID: 2040
java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:111)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:159)
at android.app.ActivityThread.main(ActivityThread.java:6363)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
Caused by: java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack trace available
01-06 22:47:20.590 2040-2040/com.example.newbiechen.ireader I/Process: killProcess pid=2040
java.lang.RuntimeException
at android.os.Process.killProcess(Process.java:1258)
at com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:111)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1063)
at io.reactivex.plugins.RxJavaPlugins.uncaught(RxJavaPlugins.java:288)
at io.reactivex.plugins.RxJavaPlugins.onError(RxJavaPlugins.java:282)
at io.reactivex.android.schedulers.HandlerScheduler$ScheduledRunnable.run(HandlerScheduler.java:113)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:159)
at android.app.ActivityThread.main(ActivityThread.java:6363)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1096)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:883)
01-06 22:47:20.590 2040-2040/com.example.newbiechen.ireader I/Process: Sending signal. PID: 2040 SIG: 9
public boolean isRunning(){
return mPageAnim.isRunning();
}
显示空对象.
另外想问一下楼主, 只是想搞一个简单的text阅读器, 限制每次读取的字节, 当scrollView滑动到底部时再添加上一些内容, 逻辑上没有问题, 但每次添加时textView.append都会造成ui线程的卡顿, 有没有办法解决? 难道只能用canvas.drawText的方式?
如题,版主能解答一下吗,想翻页动画(主要是横向翻页时)完成之后处理一些事情,请问可以实现么
感觉没必要全部扫描一次呢,一般情况下只扫描3级目录应该就可以了吧
类似于微信读书,QQ阅读 掌阅都有这个长按选中部分文字 然后 做一些 复制、做标记、写评论等功能 。
这个选中部分文字不好实现(不用系统自带的)。 请作者指点。 谢谢。
//对内容进行绘制
for (int i = mCurPage.titleLines; i < mCurPage.lines.size(); ++i) {
str = mCurPage.lines.get(i);
canvas.drawText(str, mMarginWidth, top, mTextPaint);
if (str.endsWith("\n")) {
top += para;
} else {
top += interval;
}
}
if (mCurPage.position + 1 == mCurPageList.size()) {
if (null != mCurPage.nativeADDataRef) {
// TODO: 2018/6/13 绘制插图
// View view = mCurPage.view;
View view = LayoutInflater.from(App.getContext()).inflate(R.layout.aa_ad_big, null);
ImageView imageView = (ImageView) view.findViewById(R.id.img_ad_big);
// Glide.with(App.getContext()).load(mCurPage.nativeADDataRef.getImgUrl()).asBitmap().into(imageView);
Bitmap viewBitmap = getViewBitmap(imageView, (int) top, titlePara, mTitleInterval);
// Bitmap viewBitmap = getViewBitmap(view);
if (viewBitmap != null)
canvas.drawBitmap(viewBitmap, mMarginWidth, -mTextPaint.getFontMetrics().top , mBgPaint);
}
}
使用本地插图可以,已加载网络插图,就不行了,版主可以指导下么
编译的时候报错
Error:(13, 48) 错误: 找不到符号
符号: 类 BookBeanDao
位置: 程序包 com.example.newbiechen.ireader.model.gen
我们之间加载目录,自动预下载章节等等
、、、、
这个项目还在维护吗?
看了楼主的note,十分有心,必属大神
header_disc_review_detail.xml 文件
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/ic_book_list_add"//改成ic_book_shelf_add后看得清楚些
android:drawablePadding="15dp"
android:gravity="center_vertical"
android:padding="20dp"
android:text="添加你喜欢的小说"
android:textColor="@color/nb.text.default"/>
我把预加载去了,每次只请求一章,章节切换的时候动画没有释放掉,我调用pageView的 abortAnimation()也没起作用,不知道哪位朋友解决这个问题了,可以留言告诉一下,感激不尽
这里
nowBrightnessValue = Settings.System.getFloat(resolver, "screen_auto_brightness_adj");
为什么不写成
nowBrightnessValue = Settings.System.getFloat(resolver, Settings.System.SCREEN_BRIGHTNESS);
public CollBookBean createCollBookBean(){
CollBookBean bean = new CollBookBean();
bean.set_id(get_id());
bean.setTitle(getTitle());
bean.setAuthor(bean.getAuthor());//这里应该是 bean.setAuthor(getAuthor());
bean.setShortIntro(getLongIntro());
bean.setCover(getCover());
bean.setHasCp(isHasCp());
bean.setLatelyFollower(getLatelyFollower());
bean.setRetentionRatio(Double.parseDouble(getRetentionRatio()));
bean.setUpdated(getUpdated());
bean.setChaptersCount(getChaptersCount());
bean.setLastChapter(getLastChapter());
return bean;
}
您好, 看了你的代码, 如果我想加入某个布局在每个页面中,类似电量, 但不是能直接用canvas画出来的, 该怎么添加呢,
报错内容Chapter list must not null
有没有计划整个APP切换日间夜间模式 换肤
此时COLL_BOOK_BEAN中某些非空字段未设置,导致插入数据库失败。
将生僻字的图片文字单独作为一行了。
近期正在学习小说阅读器方面的技术,请问现在这个项目已经完全开源了么?
[email protected] 这是我的邮箱,主要是请教关于 上下滚动~和云同步书架的一些问题
请问有什么好的解决方案吗
运行了一下,效果很不错。但是好像很多功能没实现,比如字体大小。切换了翻页动画下次进去还是默认的效果。时间和电量在我手机上不会变。还有就是那个百分比可以搞成页码方式吗,类似这样1/20 每一章这样显示比百分比直观很多。
如题
api<19的 仿真翻页 会异常。。
其实是不是不用考虑api<19的机型。
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.