新增阅读记录

pull/5/head v2.0.5
fengyuecanzhu 4 years ago
parent 0c3cf6bd9e
commit e4da857c67
  1. 4
      .idea/assetWizardSettings.xml
  2. 2
      app/build.gradle
  3. 1
      app/src/main/AndroidManifest.xml
  4. 8
      app/src/main/assets/updatelog.fy
  5. 2
      app/src/main/java/xyz/fycz/myreader/application/App.java
  6. 2
      app/src/main/java/xyz/fycz/myreader/entity/Date.java
  7. 2
      app/src/main/java/xyz/fycz/myreader/entity/Setting.java
  8. 1
      app/src/main/java/xyz/fycz/myreader/greendao/entity/Book.java
  9. 84
      app/src/main/java/xyz/fycz/myreader/greendao/entity/ReadRecord.java
  10. 2
      app/src/main/java/xyz/fycz/myreader/greendao/service/BookGroupService.java
  11. 2
      app/src/main/java/xyz/fycz/myreader/greendao/service/BookMarkService.java
  12. 1
      app/src/main/java/xyz/fycz/myreader/greendao/service/BookService.java
  13. 2
      app/src/main/java/xyz/fycz/myreader/greendao/service/ChapterService.java
  14. 76
      app/src/main/java/xyz/fycz/myreader/greendao/service/ReadRecordService.java
  15. 4
      app/src/main/java/xyz/fycz/myreader/greendao/service/SearchHistoryService.java
  16. 2
      app/src/main/java/xyz/fycz/myreader/greendao/util/MySQLiteOpenHelper.java
  17. 2
      app/src/main/java/xyz/fycz/myreader/model/sourceAnalyzer/BaseAnalyzer.java
  18. 4
      app/src/main/java/xyz/fycz/myreader/model/sourceAnalyzer/BookSourceManager.java
  19. 2
      app/src/main/java/xyz/fycz/myreader/model/sourceAnalyzer/JsonPathAnalyzer.java
  20. 2
      app/src/main/java/xyz/fycz/myreader/model/sourceAnalyzer/MatcherAnalyzer.java
  21. 2
      app/src/main/java/xyz/fycz/myreader/model/sourceAnalyzer/XpathAnalyzer.java
  22. 2
      app/src/main/java/xyz/fycz/myreader/model/storage/WebDavHelp.kt
  23. 4
      app/src/main/java/xyz/fycz/myreader/model/third2/analyzeRule/AnalyzeRule.java
  24. 2
      app/src/main/java/xyz/fycz/myreader/model/third2/analyzeRule/AnalyzeUrl.java
  25. 3
      app/src/main/java/xyz/fycz/myreader/ui/activity/AdSettingActivity.java
  26. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/BookDetailedActivity.java
  27. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/MainActivity.java
  28. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/QRCodeScanActivity.java
  29. 79
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  30. 206
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadRecordActivity.java
  31. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/SearchBookActivity.java
  32. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/SourceEditActivity.java
  33. 2
      app/src/main/java/xyz/fycz/myreader/ui/activity/SplashActivity.java
  34. 5
      app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDetailedAdapter.java
  35. 5
      app/src/main/java/xyz/fycz/myreader/ui/adapter/BookcaseDragAdapter.java
  36. 2
      app/src/main/java/xyz/fycz/myreader/ui/adapter/LocalSourceAdapter.java
  37. 2
      app/src/main/java/xyz/fycz/myreader/ui/adapter/ReplaceRuleAdapter.java
  38. 2
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/BookSourceHolder.java
  39. 2
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/BookStoreBookHolder.java
  40. 74
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/ReadRecordHolder.java
  41. 2
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/ReplaceRuleHolder.java
  42. 2
      app/src/main/java/xyz/fycz/myreader/ui/adapter/holder/SearchBookHolder.java
  43. 5
      app/src/main/java/xyz/fycz/myreader/ui/dialog/DialogCreator.java
  44. 3
      app/src/main/java/xyz/fycz/myreader/ui/dialog/MyAlertDialog.java
  45. 2
      app/src/main/java/xyz/fycz/myreader/ui/dialog/ReplaceDialog.java
  46. 18
      app/src/main/java/xyz/fycz/myreader/ui/fragment/FindFragment.java
  47. 15
      app/src/main/java/xyz/fycz/myreader/ui/fragment/MineFragment.java
  48. 3
      app/src/main/java/xyz/fycz/myreader/ui/fragment/WebDavFragment.java
  49. 2
      app/src/main/java/xyz/fycz/myreader/ui/presenter/BookcasePresenter.java
  50. 2
      app/src/main/java/xyz/fycz/myreader/util/help/CalendarHelper.java
  51. 2
      app/src/main/java/xyz/fycz/myreader/util/help/DateHelper.java
  52. 5
      app/src/main/java/xyz/fycz/myreader/util/help/OpenFileHelper.java
  53. 96
      app/src/main/java/xyz/fycz/myreader/util/help/RelativeDateHelp.java
  54. 2
      app/src/main/java/xyz/fycz/myreader/util/help/StringHelper.java
  55. 2
      app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java
  56. 5
      app/src/main/java/xyz/fycz/myreader/util/utils/FileUtils.java
  57. 2
      app/src/main/java/xyz/fycz/myreader/util/utils/NetworkUtils.java
  58. 7
      app/src/main/java/xyz/fycz/myreader/webapi/BookApi.java
  59. 2
      app/src/main/java/xyz/fycz/myreader/webapi/LanZousApi.java
  60. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/ReadCrawlerUtil.java
  61. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/base/BaseSourceCrawler.java
  62. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QB5FindCrawler.java
  63. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/find/QiDianMobileRank.java
  64. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiQuGe44ReadCrawler.java
  65. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/BiQuGeReadCrawler.java
  66. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/EWenXueReadCrawler.java
  67. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/LuoQiuReadCrawler.java
  68. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PinShuReadCrawler.java
  69. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/PinShuReadCrawler2.java
  70. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ShuHaiGeReadCrawler.java
  71. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/TianLaiReadCrawler.java
  72. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/XS7ReadCrawler2.java
  73. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/ZW37ReadCrawler.java
  74. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/JsonPathCrawler.java
  75. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/MatcherCrawler.java
  76. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/ThirdCrawler.java
  77. 2
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/source/XpathCrawler.java
  78. 2
      app/src/main/java/xyz/fycz/myreader/widget/page/LocalPageLoader.java
  79. 2
      app/src/main/java/xyz/fycz/myreader/widget/page/NetPageLoader.java
  80. 4
      app/src/main/res/drawable/ic_link.xml
  81. 15
      app/src/main/res/drawable/ic_more.xml
  82. 51
      app/src/main/res/layout/activity_read_record.xml
  83. 53
      app/src/main/res/layout/fragment_find.xml
  84. 30
      app/src/main/res/layout/fragment_mine.xml
  85. 113
      app/src/main/res/layout/item_read_record.xml
  86. 3
      app/src/main/res/values/strings.xml
  87. 2
      app/version_code.properties

@ -14,8 +14,8 @@
<option name="values"> <option name="values">
<map> <map>
<entry key="assetSourceType" value="FILE" /> <entry key="assetSourceType" value="FILE" />
<entry key="outputName" value="ic___" /> <entry key="outputName" value="ic_more" />
<entry key="sourceFile" value="F:\SVG图标\上传.svg" /> <entry key="sourceFile" value="F:\SVG图标\更多.svg" />
</map> </map>
</option> </option>
</PersistentState> </PersistentState>

@ -213,7 +213,7 @@ dependencies {
} }
greendao { greendao {
schemaVersion 28 schemaVersion 29
daoPackage 'xyz.fycz.myreader.greendao.gen' daoPackage 'xyz.fycz.myreader.greendao.gen'
// targetGenDir 'src/main/java' // targetGenDir 'src/main/java'
} }

@ -136,6 +136,7 @@
<activity android:name=".ui.activity.DonateActivity" /> <activity android:name=".ui.activity.DonateActivity" />
<activity android:name=".ui.activity.BookInfoEditActivity" /> <activity android:name=".ui.activity.BookInfoEditActivity" />
<activity android:name=".ui.activity.SourceLoginActivity" /> <activity android:name=".ui.activity.SourceLoginActivity" />
<activity android:name=".ui.activity.ReadRecordActivity" />
<receiver android:name=".util.notification.NotificationClickReceiver" /> <receiver android:name=".util.notification.NotificationClickReceiver" />
<receiver android:name=".ui.presenter.BookcasePresenter$cancelDownloadReceiver" /> <receiver android:name=".ui.presenter.BookcasePresenter$cancelDownloadReceiver" />

@ -1,5 +1,11 @@
2021.06.01 2021.06.01
风月读书v2.0.2 风月读书v2.0.5
更新内容:
1、优化对话框
2、新增阅读记录(记录上次阅读时间和时长)
3、新增友链
风月读书v2.0.4
更新内容: 更新内容:
1、修复部分机型概率性启动闪退的问题 1、修复部分机型概率性启动闪退的问题

@ -56,7 +56,7 @@ import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.fragment.BookcaseFragment; import xyz.fycz.myreader.ui.fragment.BookcaseFragment;
import xyz.fycz.myreader.util.help.SSLSocketClient; import xyz.fycz.myreader.util.help.SSLSocketClient;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.FileUtils;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;

@ -1,7 +1,7 @@
package xyz.fycz.myreader.entity; package xyz.fycz.myreader.entity;
import xyz.fycz.myreader.util.CalendarHelper; import xyz.fycz.myreader.util.help.CalendarHelper;
import java.io.Serializable; import java.io.Serializable;

@ -16,7 +16,7 @@ import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.enums.BookcaseStyle; import xyz.fycz.myreader.enums.BookcaseStyle;
import xyz.fycz.myreader.enums.Font; import xyz.fycz.myreader.enums.Font;
import xyz.fycz.myreader.enums.Language; import xyz.fycz.myreader.enums.Language;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ZipUtils; import xyz.fycz.myreader.util.ZipUtils;
import xyz.fycz.myreader.util.utils.BitmapUtil; import xyz.fycz.myreader.util.utils.BitmapUtil;
import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.FileUtils;

@ -14,7 +14,6 @@ import org.greenrobot.greendao.annotation.Transient;
import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.BookService;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper;
import java.io.Serializable; import java.io.Serializable;
import java.util.HashMap; import java.util.HashMap;

@ -0,0 +1,84 @@
package xyz.fycz.myreader.greendao.entity;
import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
/**
* @author fengyue
* @date 2021/6/1 18:38
*/
@Entity
public class ReadRecord {
@Id
private String id;
private String bookImg;
private String bookName;
private String bookAuthor;
private long readTime;
private long updateTime;
@Generated(hash = 1191129215)
public ReadRecord() {
}
@Generated(hash = 381392552)
public ReadRecord(String id, String bookImg, String bookName, String bookAuthor,
long readTime, long updateTime) {
this.id = id;
this.bookImg = bookImg;
this.bookName = bookName;
this.bookAuthor = bookAuthor;
this.readTime = readTime;
this.updateTime = updateTime;
}
public String getId() {
return this.id;
}
public void setId(String id) {
this.id = id;
}
public String getBookName() {
return this.bookName;
}
public void setBookName(String bookName) {
this.bookName = bookName;
}
public String getBookAuthor() {
return this.bookAuthor;
}
public void setBookAuthor(String bookAuthor) {
this.bookAuthor = bookAuthor;
}
public long getUpdateTime() {
return this.updateTime;
}
public void setUpdateTime(long updateTime) {
this.updateTime = updateTime;
}
public String getBookImg() {
return this.bookImg;
}
public void setBookImg(String bookImg) {
this.bookImg = bookImg;
}
public long getReadTime() {
return this.readTime;
}
public void setReadTime(long readTime) {
this.readTime = readTime;
}
}

@ -6,7 +6,7 @@ import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.greendao.entity.BookGroup; import xyz.fycz.myreader.greendao.entity.BookGroup;
import xyz.fycz.myreader.greendao.gen.BookGroupDao; import xyz.fycz.myreader.greendao.gen.BookGroupDao;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import java.util.List; import java.util.List;

@ -3,7 +3,7 @@ package xyz.fycz.myreader.greendao.service;
import xyz.fycz.myreader.greendao.DbManager; import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.greendao.entity.BookMark; import xyz.fycz.myreader.greendao.entity.BookMark;
import xyz.fycz.myreader.greendao.gen.BookMarkDao; import xyz.fycz.myreader.greendao.gen.BookMarkDao;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

@ -15,6 +15,7 @@ import xyz.fycz.myreader.greendao.gen.BookDao;
import xyz.fycz.myreader.util.*; import xyz.fycz.myreader.util.*;
import xyz.fycz.myreader.greendao.DbManager; import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.FileUtils;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;

@ -6,7 +6,7 @@ import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.gen.ChapterDao; import xyz.fycz.myreader.greendao.gen.ChapterDao;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.greendao.DbManager; import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.FileUtils;

@ -0,0 +1,76 @@
package xyz.fycz.myreader.greendao.service;
import java.util.List;
import io.reactivex.Single;
import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.ReadRecord;
import xyz.fycz.myreader.greendao.gen.BookDao;
import xyz.fycz.myreader.greendao.gen.ReadRecordDao;
/**
* @author fengyue
* @date 2021/6/1 19:09
*/
public class ReadRecordService extends BaseService {
private static volatile ReadRecordService sInstance;
public static ReadRecordService getInstance() {
if (sInstance == null) {
synchronized (ReadRecordService.class) {
if (sInstance == null) {
sInstance = new ReadRecordService();
}
}
}
return sInstance;
}
/**
* 获取所有书籍分组
*
* @return
*/
public Single<List<ReadRecord>> getAllRecordsByTime() {
return Single.create(emitter -> emitter.onSuccess(DbManager.getDaoSession().getReadRecordDao()
.queryBuilder()
.orderDesc(ReadRecordDao.Properties.UpdateTime)
.list()));
}
public Single<Boolean> removeAll() {
return Single.create(emitter -> {
DbManager.getDaoSession().getReadRecordDao().deleteAll();
emitter.onSuccess(true);
});
}
public Single<Boolean> removeAllTime(List<ReadRecord> records) {
return Single.create(emitter -> {
for (ReadRecord record : records) {
record.setReadTime(0);
record.setUpdateTime(0);
}
DbManager.getDaoSession().getReadRecordDao().insertOrReplaceInTx(records);
emitter.onSuccess(true);
});
}
public ReadRecord get(String bookName, String bookAuthor) {
try {
return DbManager.getInstance().getSession().getReadRecordDao()
.queryBuilder()
.where(ReadRecordDao.Properties.BookName.eq(bookName),
ReadRecordDao.Properties.BookAuthor.eq(bookAuthor))
.unique();
} catch (Exception e) {
e.printStackTrace();
return DbManager.getInstance().getSession().getReadRecordDao()
.queryBuilder()
.where(ReadRecordDao.Properties.BookName.eq(bookName),
ReadRecordDao.Properties.BookAuthor.eq(bookAuthor))
.list().get(0);
}
}
}

@ -4,8 +4,8 @@ import android.database.Cursor;
import xyz.fycz.myreader.greendao.entity.SearchHistory; import xyz.fycz.myreader.greendao.entity.SearchHistory;
import xyz.fycz.myreader.greendao.gen.SearchHistoryDao; import xyz.fycz.myreader.greendao.gen.SearchHistoryDao;
import xyz.fycz.myreader.util.DateHelper; import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.greendao.DbManager; import xyz.fycz.myreader.greendao.DbManager;
import java.util.ArrayList; import java.util.ArrayList;

@ -38,7 +38,7 @@ public class MySQLiteOpenHelper extends DaoMaster.OpenHelper {
}, },
BookDao.class, ChapterDao.class, SearchHistoryDao.class, BookDao.class, ChapterDao.class, SearchHistoryDao.class,
BookMarkDao.class, BookGroupDao.class, ReplaceRuleBeanDao.class, BookMarkDao.class, BookGroupDao.class, ReplaceRuleBeanDao.class,
BookSourceDao.class, CookieBeanDao.class BookSourceDao.class, CookieBeanDao.class, ReadRecordDao.class
); );
} }

@ -6,7 +6,7 @@ import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;
/** /**

@ -4,8 +4,6 @@ import android.database.Cursor;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import androidx.annotation.Nullable;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@ -24,7 +22,7 @@ import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.gen.BookSourceDao; import xyz.fycz.myreader.greendao.gen.BookSourceDao;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.FileUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt; import xyz.fycz.myreader.util.utils.GsonExtensionsKt;
import xyz.fycz.myreader.util.utils.GsonUtils; import xyz.fycz.myreader.util.utils.GsonUtils;

@ -12,7 +12,7 @@ import com.jayway.jsonpath.spi.json.GsonJsonProvider;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
/** /**
* @author fengyue * @author fengyue

@ -11,7 +11,7 @@ import xyz.fycz.myreader.greendao.entity.rule.ContentRule;
import xyz.fycz.myreader.greendao.entity.rule.InfoRule; import xyz.fycz.myreader.greendao.entity.rule.InfoRule;
import xyz.fycz.myreader.greendao.entity.rule.SearchRule; import xyz.fycz.myreader.greendao.entity.rule.SearchRule;
import xyz.fycz.myreader.greendao.entity.rule.TocRule; import xyz.fycz.myreader.greendao.entity.rule.TocRule;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;

@ -6,7 +6,7 @@ import org.seimicrawler.xpath.JXNode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
/** /**
* @author fengyue * @author fengyue

@ -78,7 +78,7 @@ object WebDavHelp {
}*/ }*/
BottomMenu.build().setTitle("选择恢复文件") BottomMenu.build().setTitle("选择恢复文件")
.setMenuStringList(names) .setMenuStringList(names)
.setOnMenuItemClickListener { dialog, text, which -> .setOnMenuItemClickListener { _, _, which ->
if (which in 0 until 30.coerceAtLeast(names.size)) { if (which in 0 until 30.coerceAtLeast(names.size)) {
restoreWebDav(names[which], callBack) restoreWebDav(names[which], callBack)
} }

@ -19,7 +19,7 @@ import javax.script.SimpleBindings;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.service.CookieStore; import xyz.fycz.myreader.greendao.service.CookieStore;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.help.JsExtensions; import xyz.fycz.myreader.util.help.JsExtensions;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;
@ -28,7 +28,7 @@ import static xyz.fycz.myreader.common.APPCONST.EXP_PATTERN;
import static xyz.fycz.myreader.common.APPCONST.JS_PATTERN; import static xyz.fycz.myreader.common.APPCONST.JS_PATTERN;
import static xyz.fycz.myreader.common.APPCONST.MAP_STRING; import static xyz.fycz.myreader.common.APPCONST.MAP_STRING;
import static xyz.fycz.myreader.common.APPCONST.SCRIPT_ENGINE; import static xyz.fycz.myreader.common.APPCONST.SCRIPT_ENGINE;
import static xyz.fycz.myreader.util.StringHelper.isEmpty; import static xyz.fycz.myreader.util.help.StringHelper.isEmpty;
import static xyz.fycz.myreader.util.utils.NetworkUtils.headerPattern; import static xyz.fycz.myreader.util.utils.NetworkUtils.headerPattern;

@ -19,7 +19,7 @@ import java.util.regex.Pattern;
import javax.script.SimpleBindings; import javax.script.SimpleBindings;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.help.JsExtensions; import xyz.fycz.myreader.util.help.JsExtensions;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;

@ -14,8 +14,7 @@ import xyz.fycz.myreader.base.BaseActivity;
import xyz.fycz.myreader.base.observer.MySingleObserver; import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.databinding.ActivityAdSettingBinding; import xyz.fycz.myreader.databinding.ActivityAdSettingBinding;
import xyz.fycz.myreader.ui.dialog.LoadingDialog; import xyz.fycz.myreader.ui.dialog.LoadingDialog;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog; import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.DateHelper;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.AdUtils; import xyz.fycz.myreader.util.utils.AdUtils;

@ -68,7 +68,7 @@ import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.ShareUtils; import xyz.fycz.myreader.util.ShareUtils;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.AdUtils; import xyz.fycz.myreader.util.utils.AdUtils;
import xyz.fycz.myreader.util.utils.BitmapUtil; import xyz.fycz.myreader.util.utils.BitmapUtil;

@ -44,7 +44,7 @@ import xyz.fycz.myreader.ui.fragment.BookcaseFragment;
import xyz.fycz.myreader.ui.fragment.FindFragment; import xyz.fycz.myreader.ui.fragment.FindFragment;
import xyz.fycz.myreader.ui.fragment.MineFragment; import xyz.fycz.myreader.ui.fragment.MineFragment;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.AdUtils; import xyz.fycz.myreader.util.utils.AdUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt; import xyz.fycz.myreader.util.utils.GsonExtensionsKt;

@ -23,7 +23,7 @@ import xyz.fycz.myreader.base.BaseActivity;
import xyz.fycz.myreader.base.observer.MySingleObserver; import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.databinding.ActivityQrcodeCaptureBinding; import xyz.fycz.myreader.databinding.ActivityQrcodeCaptureBinding;
import xyz.fycz.myreader.util.PermissionsChecker; import xyz.fycz.myreader.util.PermissionsChecker;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.RxUtils; import xyz.fycz.myreader.util.utils.RxUtils;

@ -39,9 +39,7 @@ import androidx.core.content.ContextCompat;
import com.gyf.immersionbar.ImmersionBar; import com.gyf.immersionbar.ImmersionBar;
import com.jaredrummler.android.colorpicker.ColorPickerDialogListener; import com.jaredrummler.android.colorpicker.ColorPickerDialogListener;
import com.kongzue.dialogx.dialogs.BottomDialog;
import com.kongzue.dialogx.dialogs.BottomMenu; import com.kongzue.dialogx.dialogs.BottomMenu;
import com.kongzue.dialogx.interfaces.OnDialogButtonClickListener;
import com.kongzue.dialogx.interfaces.OnMenuItemSelectListener; import com.kongzue.dialogx.interfaces.OnMenuItemSelectListener;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
@ -52,6 +50,7 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.Single;
import io.reactivex.schedulers.Schedulers; import io.reactivex.schedulers.Schedulers;
import xyz.fycz.myreader.ActivityManage; import xyz.fycz.myreader.ActivityManage;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
@ -66,22 +65,24 @@ import xyz.fycz.myreader.databinding.ActivityReadBinding;
import xyz.fycz.myreader.entity.Setting; import xyz.fycz.myreader.entity.Setting;
import xyz.fycz.myreader.enums.LocalBookSource; import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.enums.Font; import xyz.fycz.myreader.enums.Font;
import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.BookMark; import xyz.fycz.myreader.greendao.entity.BookMark;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.ReadRecord;
import xyz.fycz.myreader.greendao.entity.ReplaceRuleBean; import xyz.fycz.myreader.greendao.entity.ReplaceRuleBean;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.service.BookGroupService; import xyz.fycz.myreader.greendao.service.BookGroupService;
import xyz.fycz.myreader.greendao.service.BookMarkService; import xyz.fycz.myreader.greendao.service.BookMarkService;
import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.BookService;
import xyz.fycz.myreader.greendao.service.ChapterService; import xyz.fycz.myreader.greendao.service.ChapterService;
import xyz.fycz.myreader.greendao.service.ReadRecordService;
import xyz.fycz.myreader.model.audio.ReadAloudService; import xyz.fycz.myreader.model.audio.ReadAloudService;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager; import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.model.storage.Backup; import xyz.fycz.myreader.model.storage.Backup;
import xyz.fycz.myreader.ui.dialog.AudioPlayerDialog; import xyz.fycz.myreader.ui.dialog.AudioPlayerDialog;
import xyz.fycz.myreader.ui.dialog.CopyContentDialog; import xyz.fycz.myreader.ui.dialog.CopyContentDialog;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.ui.dialog.ReplaceDialog; import xyz.fycz.myreader.ui.dialog.ReplaceDialog;
import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog; import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog;
import xyz.fycz.myreader.ui.popmenu.AutoPageMenu; import xyz.fycz.myreader.ui.popmenu.AutoPageMenu;
@ -90,10 +91,10 @@ import xyz.fycz.myreader.ui.popmenu.CustomizeComMenu;
import xyz.fycz.myreader.ui.popmenu.CustomizeLayoutMenu; import xyz.fycz.myreader.ui.popmenu.CustomizeLayoutMenu;
import xyz.fycz.myreader.ui.popmenu.ReadSettingMenu; import xyz.fycz.myreader.ui.popmenu.ReadSettingMenu;
import xyz.fycz.myreader.util.BrightUtil; import xyz.fycz.myreader.util.BrightUtil;
import xyz.fycz.myreader.util.DateHelper; import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.ShareUtils; import xyz.fycz.myreader.util.ShareUtils;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.SystemUtil; import xyz.fycz.myreader.util.SystemUtil;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.notification.NotificationClickReceiver; import xyz.fycz.myreader.util.notification.NotificationClickReceiver;
@ -137,6 +138,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
private BookMarkService mBookMarkService; private BookMarkService mBookMarkService;
private NotificationUtil notificationUtil; private NotificationUtil notificationUtil;
private Setting mSetting; private Setting mSetting;
private ReadRecord record;
private boolean isCollected = true;//是否在书架中 private boolean isCollected = true;//是否在书架中
@ -155,6 +157,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
private Runnable keepScreenRunnable;//息屏线程 private Runnable keepScreenRunnable;//息屏线程
private Runnable autoPageRunnable;//自动翻页 private Runnable autoPageRunnable;//自动翻页
private Runnable sendDownloadNotification; private Runnable sendDownloadNotification;
private static boolean isStopDownload = true; private static boolean isStopDownload = true;
private int tempCacheChapterNum; private int tempCacheChapterNum;
@ -163,8 +166,6 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
private ReadCrawler mReadCrawler; private ReadCrawler mReadCrawler;
private int upHpbInterval = 30;//更新翻页进度速度
private int downloadInterval = 150; private int downloadInterval = 150;
private SourceExchangeDialog mSourceDialog; private SourceExchangeDialog mSourceDialog;
@ -182,6 +183,9 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
private Animation mBottomOutAnim; private Animation mBottomOutAnim;
private int lastX, lastY; private int lastX, lastY;
private long lastRecordTime;//上次记录时间
// 接收电池信息和时间更新的广播 // 接收电池信息和时间更新的广播
private BroadcastReceiver mReceiver = new BroadcastReceiver() { private BroadcastReceiver mReceiver = new BroadcastReceiver() {
@Override @Override
@ -333,6 +337,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
if (aBooks != null) { if (aBooks != null) {
mSourceDialog.setABooks(aBooks); mSourceDialog.setABooks(aBooks);
} }
lastRecordTime = System.currentTimeMillis();
} }
@Override @Override
@ -411,6 +416,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
@Override @Override
public void onChapterChange(int pos) { public void onChapterChange(int pos) {
mBook.setHistoryChapterId(mChapters.get(pos).getTitle()); mBook.setHistoryChapterId(mChapters.get(pos).getTitle());
recordReadTime();
} }
@Override @Override
@ -425,6 +431,7 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
@Override @Override
public void onPageChange(int pos, boolean resetRead) { public void onPageChange(int pos, boolean resetRead) {
mHandler.sendMessage(mHandler.obtainMessage(4)); mHandler.sendMessage(mHandler.obtainMessage(4));
recordReadTime();
if (ReadAloudService.running) { if (ReadAloudService.running) {
if (mPageLoader.hasChapterData(mChapters.get(mPageLoader.getChapterPos()))) { if (mPageLoader.hasChapterData(mChapters.get(mPageLoader.getChapterPos()))) {
if (resetRead) { if (resetRead) {
@ -1587,22 +1594,22 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
selectedIndex = which; selectedIndex = which;
} }
}).setOkButton("确定", (baseDialog, v) -> { }).setOkButton("确定", (baseDialog, v) -> {
switch (selectedIndex) { switch (selectedIndex) {
case 0: case 0:
addDownload(mPageLoader.getChapterPos(), mPageLoader.getChapterPos() + 50); addDownload(mPageLoader.getChapterPos(), mPageLoader.getChapterPos() + 50);
break; break;
case 1: case 1:
addDownload(mPageLoader.getChapterPos() - 50, mPageLoader.getChapterPos() + 50); addDownload(mPageLoader.getChapterPos() - 50, mPageLoader.getChapterPos() + 50);
break; break;
case 2: case 2:
addDownload(mPageLoader.getChapterPos(), mChapters.size()); addDownload(mPageLoader.getChapterPos(), mChapters.size());
break; break;
case 3: case 3:
addDownload(0, mChapters.size()); addDownload(0, mChapters.size());
break; break;
} }
return false; return false;
}).setCancelButton(R.string.cancel); }).setCancelButton(R.string.cancel);
}); });
} }
@ -2086,4 +2093,30 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
textToSpeech.speak(text, TextToSpeech.QUEUE_ADD, null, "select_text"); textToSpeech.speak(text, TextToSpeech.QUEUE_ADD, null, "select_text");
lastText = ""; lastText = "";
} }
/**
* 记录阅读时间
*/
private void recordReadTime() {
Single.create(emitter -> {
if (mBook == null) return;
if (record == null) {
record = ReadRecordService.getInstance().get(mBook.getName(), mBook.getAuthor());
if (record == null) {
record = new ReadRecord();
record.setId(StringHelper.getStringRandom(25));
record.setBookName(mBook.getName());
record.setBookAuthor(mBook.getAuthor());
record.setBookImg(NetworkUtils.getAbsoluteURL(mReadCrawler.getNameSpace(),
mBook.getImgUrl()));
}
}
long curTime = System.currentTimeMillis();
long deltaTime = curTime - lastRecordTime;
lastRecordTime = curTime;
record.setUpdateTime(curTime);
record.setReadTime(record.getReadTime() + deltaTime);
DbManager.getDaoSession().getReadRecordDao().insertOrReplace(record);
}).subscribe();
}
} }

@ -0,0 +1,206 @@
package xyz.fycz.myreader.ui.activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import androidx.appcompat.widget.Toolbar;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.kongzue.dialogx.dialogs.BottomMenu;
import com.kongzue.dialogx.interfaces.OnMenuItemClickListener;
import com.kongzue.dialogx.interfaces.OnMenuItemSelectListener;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import xyz.fycz.myreader.R;
import xyz.fycz.myreader.base.BaseActivity;
import xyz.fycz.myreader.base.BitIntentDataManager;
import xyz.fycz.myreader.base.adapter.BaseListAdapter;
import xyz.fycz.myreader.base.adapter.IViewHolder;
import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.ActivityReadRecordBinding;
import xyz.fycz.myreader.greendao.DbManager;
import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.ReadRecord;
import xyz.fycz.myreader.greendao.service.BookService;
import xyz.fycz.myreader.greendao.service.ReadRecordService;
import xyz.fycz.myreader.ui.adapter.holder.ReadRecordHolder;
import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.SourceExchangeDialog;
import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.help.RelativeDateHelp;
import xyz.fycz.myreader.util.utils.RxUtils;
import xyz.fycz.myreader.widget.DividerItemDecoration;
/**
* @author fengyue
* @date 2021/6/1 19:07
*/
public class ReadRecordActivity extends BaseActivity {
private ActivityReadRecordBinding binding;
private List<ReadRecord> records;
private long allTime;
private BaseListAdapter<ReadRecord> mAdapter;
private SourceExchangeDialog mSourceDia;
private ReadRecordService recordService;
@Override
protected void bindView() {
binding = ActivityReadRecordBinding.inflate(getLayoutInflater());
setContentView(binding.getRoot());
}
@Override
protected void setUpToolbar(Toolbar toolbar) {
super.setUpToolbar(toolbar);
setStatusBarColor(R.color.colorPrimary, true);
getSupportActionBar().setTitle(getString(R.string.read_record));
}
@Override
protected void initData(Bundle savedInstanceState) {
super.initData(savedInstanceState);
recordService = ReadRecordService.getInstance();
recordService.getAllRecordsByTime().compose(RxUtils::toSimpleSingle)
.subscribe(new MySingleObserver<List<ReadRecord>>() {
@Override
public void onSuccess(@NotNull List<ReadRecord> readRecords) {
records = readRecords;
initRecords();
}
@Override
public void onError(Throwable e) {
ToastUtils.showError("数据加载失败\n" + e.getLocalizedMessage());
}
});
}
private void initAllTime() {
allTime = 0;
for (ReadRecord record : records) {
allTime += record.getReadTime();
}
binding.tvAllRecord.setText(getString(R.string.all_read_time,
RelativeDateHelp.formatDuring(allTime)));
}
private void initRecords() {
initAllTime();
mAdapter = new BaseListAdapter<ReadRecord>() {
@Override
protected IViewHolder<ReadRecord> createViewHolder(int viewType) {
return new ReadRecordHolder((itemPos, menuPos) -> {
ReadRecord record = records.get(itemPos);
switch (menuPos) {
case 0:
DbManager.getDaoSession().getReadRecordDao().delete(record);
records.remove(itemPos);
mAdapter.removeItem(record);
ToastUtils.showSuccess(String.format("《%s》阅读记录移除成功", record.getBookName()));
break;
case 1:
record.setReadTime(0);
record.setUpdateTime(0);
DbManager.getDaoSession().getReadRecordDao().insertOrReplace(record);
mAdapter.notifyDataSetChanged();
ToastUtils.showSuccess(String.format("《%s》阅读时长已清空", record.getBookName()));
break;
}
initAllTime();
});
}
};
//设置布局
binding.rvRecords.setLayoutManager(new LinearLayoutManager(this));
binding.rvRecords.setAdapter(mAdapter);
mAdapter.refreshItems(records);
mAdapter.setOnItemClickListener((view, pos) -> {
ReadRecord record = records.get(pos);
Book book = BookService.getInstance().findBookByAuthorAndName(record.getBookName(), record.getBookAuthor());
if (book == null) {
DialogCreator.createCommonDialog(this, "搜索书籍",
"当前书籍未加入书架,是否重新搜索?", false, (dialog, which) -> {
Book newBook = new Book();
newBook.setName(record.getBookName());
newBook.setAuthor(record.getBookAuthor());
newBook.setImgUrl(record.getBookImg());
mSourceDia = new SourceExchangeDialog(this, newBook);
mSourceDia.setOnSourceChangeListener((bean, pos1) -> {
Intent intent = new Intent(this, BookDetailedActivity.class);
BitIntentDataManager.getInstance().putData(intent, mSourceDia.getaBooks());
intent.putExtra(APPCONST.SOURCE_INDEX, pos1);
ReadRecordActivity.this.startActivity(intent);
mSourceDia.dismiss();
});
mSourceDia.show();
}, null);
} else {
Intent intent = new Intent(this, BookDetailedActivity.class);
BitIntentDataManager.getInstance().putData(intent, book);
startActivity(intent);
}
});
}
@Override
protected void initClick() {
super.initClick();
binding.ivMore.setOnClickListener(v -> {
String[] menu = new String[]{"移除所有记录", "清空阅读时长(不会删除记录)"};
BottomMenu.show(menu)
.setTitle("总阅读记录")
.setOnMenuItemClickListener((dialog, text, which) -> {
if (records == null) {
ToastUtils.showWarring("数据未完成加载,无法进行操作!");
return false;
}
switch (which) {
case 0:
recordService.removeAll().compose(RxUtils::toSimpleSingle)
.subscribe(new MySingleObserver<Boolean>() {
@Override
public void onSuccess(@NotNull Boolean aBoolean) {
ToastUtils.showSuccess("阅读记录已全部移除");
records.clear();
mAdapter.refreshItems(records);
initAllTime();
}
@Override
public void onError(Throwable e) {
super.onError(e);
ToastUtils.showError(e.getLocalizedMessage());
}
});
break;
case 1:
recordService.removeAllTime(records).compose(RxUtils::toSimpleSingle)
.subscribe(new MySingleObserver<Boolean>() {
@Override
public void onSuccess(@NotNull Boolean aBoolean) {
ToastUtils.showSuccess("阅读时长已全部清空");
mAdapter.notifyDataSetChanged();
initAllTime();
}
@Override
public void onError(Throwable e) {
super.onError(e);
ToastUtils.showError(e.getLocalizedMessage());
}
});
break;
}
return false;
})
.setCancelButton(R.string.cancel);
});
}
}

@ -56,7 +56,7 @@ import xyz.fycz.myreader.ui.adapter.SearchHistoryAdapter;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.MultiChoiceDialog; import xyz.fycz.myreader.ui.dialog.MultiChoiceDialog;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.util.utils.RxUtils; import xyz.fycz.myreader.util.utils.RxUtils;

@ -5,8 +5,6 @@ import android.content.Intent;
import android.os.Bundle; import android.os.Bundle;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter; import android.widget.ArrayAdapter;
import androidx.appcompat.widget.Toolbar; import androidx.appcompat.widget.Toolbar;
@ -30,7 +28,7 @@ import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.ui.adapter.SourceEditAdapter; import xyz.fycz.myreader.ui.adapter.SourceEditAdapter;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog; import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.webapi.crawler.source.MatcherCrawler; import xyz.fycz.myreader.webapi.crawler.source.MatcherCrawler;

@ -31,7 +31,7 @@ import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.ActivitySplashBinding; import xyz.fycz.myreader.databinding.ActivitySplashBinding;
import xyz.fycz.myreader.greendao.service.BookGroupService; import xyz.fycz.myreader.greendao.service.BookGroupService;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog; import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.util.DateHelper; import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.PermissionsChecker; import xyz.fycz.myreader.util.PermissionsChecker;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;

@ -8,8 +8,6 @@ import android.view.ViewGroup;
import android.widget.LinearLayout; import android.widget.LinearLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.appcompat.app.AlertDialog;
import com.kongzue.dialogx.dialogs.BottomMenu; import com.kongzue.dialogx.dialogs.BottomMenu;
import java.io.IOException; import java.io.IOException;
@ -21,11 +19,10 @@ import xyz.fycz.myreader.base.BitIntentDataManager;
import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.ui.activity.ReadActivity; import xyz.fycz.myreader.ui.activity.ReadActivity;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.ui.activity.BookDetailedActivity; import xyz.fycz.myreader.ui.activity.BookDetailedActivity;
import xyz.fycz.myreader.ui.presenter.BookcasePresenter; import xyz.fycz.myreader.ui.presenter.BookcasePresenter;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil;

@ -6,8 +6,6 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import androidx.appcompat.app.AlertDialog;
import com.kongzue.dialogx.dialogs.BottomMenu; import com.kongzue.dialogx.dialogs.BottomMenu;
import java.io.IOException; import java.io.IOException;
@ -19,11 +17,10 @@ import xyz.fycz.myreader.base.BitIntentDataManager;
import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.ui.activity.ReadActivity; import xyz.fycz.myreader.ui.activity.ReadActivity;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.ui.activity.BookDetailedActivity; import xyz.fycz.myreader.ui.activity.BookDetailedActivity;
import xyz.fycz.myreader.ui.presenter.BookcasePresenter; import xyz.fycz.myreader.ui.presenter.BookcasePresenter;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil;

@ -7,10 +7,8 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import xyz.fycz.myreader.base.adapter.IViewHolder; import xyz.fycz.myreader.base.adapter.IViewHolder;
import xyz.fycz.myreader.greendao.entity.ReplaceRuleBean;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.ui.adapter.holder.LocalSourceHolder; import xyz.fycz.myreader.ui.adapter.holder.LocalSourceHolder;
import xyz.fycz.myreader.util.StringHelper;
/** /**
* @author fengyue * @author fengyue

@ -12,7 +12,7 @@ import xyz.fycz.myreader.base.adapter.BaseListAdapter;
import xyz.fycz.myreader.base.adapter.IViewHolder; import xyz.fycz.myreader.base.adapter.IViewHolder;
import xyz.fycz.myreader.greendao.entity.ReplaceRuleBean; import xyz.fycz.myreader.greendao.entity.ReplaceRuleBean;
import xyz.fycz.myreader.ui.adapter.holder.ReplaceRuleHolder; import xyz.fycz.myreader.ui.adapter.holder.ReplaceRuleHolder;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
/** /**
* @author fengyue * @author fengyue

@ -27,7 +27,7 @@ import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.ui.activity.SourceEditActivity; import xyz.fycz.myreader.ui.activity.SourceEditActivity;
import xyz.fycz.myreader.ui.adapter.BookSourceAdapter; import xyz.fycz.myreader.ui.adapter.BookSourceAdapter;
import xyz.fycz.myreader.util.ShareUtils; import xyz.fycz.myreader.util.ShareUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt; import xyz.fycz.myreader.util.utils.GsonExtensionsKt;
import xyz.fycz.myreader.widget.swipemenu.SwipeMenuLayout; import xyz.fycz.myreader.widget.swipemenu.SwipeMenuLayout;

@ -10,7 +10,7 @@ import xyz.fycz.myreader.base.adapter.ViewHolderImpl;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager; import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;

@ -0,0 +1,74 @@
package xyz.fycz.myreader.ui.adapter.holder;
import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;
import com.kongzue.dialogx.dialogs.BottomMenu;
import com.kongzue.dialogx.interfaces.OnMenuItemClickListener;
import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.base.adapter.ViewHolderImpl;
import xyz.fycz.myreader.greendao.entity.ReadRecord;
import xyz.fycz.myreader.util.help.RelativeDateHelp;
import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.widget.CoverImageView;
/**
* @author fengyue
* @date 2021/6/1 19:31
*/
public class ReadRecordHolder extends ViewHolderImpl<ReadRecord> {
private OnMenuItemClickListener onMenuItemClickListener;
private CoverImageView ivBookImg;
private TextView tvBookName;
private TextView tvBookAuthor;
private TextView tvRecord;
private ImageView ivMore;
private final String[] menu = new String[]{"移除此记录", "清空阅读时长(不会删除记录)"};
public ReadRecordHolder(OnMenuItemClickListener onMenuItemClickListener) {
this.onMenuItemClickListener = onMenuItemClickListener;
}
@Override
protected int getItemLayoutId() {
return R.layout.item_read_record;
}
@Override
public void initView() {
ivBookImg = findById(R.id.iv_book_img);
tvBookName = findById(R.id.tv_book_name);
tvBookAuthor = findById(R.id.tv_book_author);
tvRecord = findById(R.id.tv_book_read_record);
ivMore = findById(R.id.iv_more);
}
@Override
public void onBind(ReadRecord data, int pos) {
if (!App.isDestroy((Activity) getContext())) {
ivBookImg.load(data.getBookImg(), data.getBookName(), data.getBookAuthor());
}
tvBookName.setText(data.getBookName());
tvBookAuthor.setText(data.getBookAuthor());
String lastTime = data.getUpdateTime() == 0 ? "无记录"
: RelativeDateHelp.format(data.getUpdateTime());
tvRecord.setText(String.format("%s · %s", lastTime,
RelativeDateHelp.formatDuring(data.getReadTime())));
ivMore.setOnClickListener(v -> BottomMenu.show(menu)
.setTitle(data.getBookName())
.setOnMenuItemClickListener((dialog, text, which) -> {
onMenuItemClickListener.onClick(pos, which);
return false;
})
.setCancelButton(R.string.cancel));
}
public interface OnMenuItemClickListener{
void onClick(int itemPos, int menuPos);
}
}

@ -26,7 +26,7 @@ import xyz.fycz.myreader.model.ReplaceRuleManager;
import xyz.fycz.myreader.ui.adapter.ReplaceRuleAdapter; import xyz.fycz.myreader.ui.adapter.ReplaceRuleAdapter;
import xyz.fycz.myreader.ui.dialog.ReplaceDialog; import xyz.fycz.myreader.ui.dialog.ReplaceDialog;
import xyz.fycz.myreader.util.ShareUtils; import xyz.fycz.myreader.util.ShareUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt; import xyz.fycz.myreader.util.utils.GsonExtensionsKt;
import xyz.fycz.myreader.widget.swipemenu.SwipeMenuLayout; import xyz.fycz.myreader.widget.swipemenu.SwipeMenuLayout;

@ -21,7 +21,7 @@ import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager; import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.ui.adapter.BookTagAdapter; import xyz.fycz.myreader.ui.adapter.BookTagAdapter;
import xyz.fycz.myreader.ui.adapter.SearchBookAdapter; import xyz.fycz.myreader.ui.adapter.SearchBookAdapter;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.KeyWordUtils; import xyz.fycz.myreader.util.utils.KeyWordUtils;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil; import xyz.fycz.myreader.webapi.crawler.ReadCrawlerUtil;

@ -1,7 +1,6 @@
package xyz.fycz.myreader.ui.dialog; package xyz.fycz.myreader.ui.dialog;
import android.app.Dialog; import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context; import android.content.Context;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.view.View; import android.view.View;
@ -11,16 +10,14 @@ import android.widget.TextView;
import androidx.appcompat.app.AlertDialog; import androidx.appcompat.app.AlertDialog;
import com.kongzue.dialogx.dialogs.BottomDialog; import com.kongzue.dialogx.dialogs.BottomDialog;
import com.kongzue.dialogx.dialogs.MessageDialog;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import xyz.fycz.myreader.R;
import xyz.fycz.myreader.application.App; import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
public class DialogCreator { public class DialogCreator {

@ -18,7 +18,6 @@ import androidx.appcompat.app.AppCompatActivity;
import com.google.android.material.textfield.TextInputLayout; import com.google.android.material.textfield.TextInputLayout;
import com.kongzue.dialogx.dialogs.BottomDialog; import com.kongzue.dialogx.dialogs.BottomDialog;
import com.kongzue.dialogx.dialogs.CustomDialog;
import com.kongzue.dialogx.interfaces.OnBindView; import com.kongzue.dialogx.interfaces.OnBindView;
import xyz.fycz.myreader.R; import xyz.fycz.myreader.R;
@ -27,7 +26,7 @@ import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.greendao.service.BookGroupService; import xyz.fycz.myreader.greendao.service.BookGroupService;
import xyz.fycz.myreader.util.CyptoUtils; import xyz.fycz.myreader.util.CyptoUtils;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.FingerprintUtils; import xyz.fycz.myreader.util.utils.FingerprintUtils;

@ -28,7 +28,7 @@ import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.BookService;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager; import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.model.ReplaceRuleManager; import xyz.fycz.myreader.model.ReplaceRuleManager;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
/** /**

@ -1,14 +1,18 @@
package xyz.fycz.myreader.ui.fragment; package xyz.fycz.myreader.ui.fragment;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.base.BaseFragment; import xyz.fycz.myreader.base.BaseFragment;
import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.FragmentFindBinding; import xyz.fycz.myreader.databinding.FragmentFindBinding;
import xyz.fycz.myreader.ui.activity.BookstoreActivity; import xyz.fycz.myreader.ui.activity.BookstoreActivity;
import xyz.fycz.myreader.util.utils.ImageLoader;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.Ben100FindCrawler; import xyz.fycz.myreader.webapi.crawler.find.Ben100FindCrawler;
import xyz.fycz.myreader.webapi.crawler.find.MiaoBiFindCrawler; import xyz.fycz.myreader.webapi.crawler.find.MiaoBiFindCrawler;
@ -29,6 +33,20 @@ public class FindFragment extends BaseFragment {
return binding.getRoot(); return binding.getRoot();
} }
@Override
protected void initWidget(Bundle savedInstanceState) {
super.initWidget(savedInstanceState);
if (!App.isDestroy(getActivity())) {
ImageLoader.INSTANCE.load(getContext(), "http://yunjuw.cn/template/mytheme/statics/img/logo.png")
.into(binding.ivDyys);
}
binding.mineRlDyys.setOnClickListener(v -> {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse("http://yunjuw.cn/"));
startActivity(intent);
});
}
@Override @Override
protected void initClick() { protected void initClick() {
super.initClick(); super.initClick();

@ -2,6 +2,7 @@ package xyz.fycz.myreader.ui.fragment;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
import android.content.Intent; import android.content.Intent;
import android.net.Uri;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
@ -35,6 +36,7 @@ import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.FragmentMineBinding; import xyz.fycz.myreader.databinding.FragmentMineBinding;
import xyz.fycz.myreader.entity.Setting; import xyz.fycz.myreader.entity.Setting;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.ReadRecord;
import xyz.fycz.myreader.greendao.service.BookService; import xyz.fycz.myreader.greendao.service.BookService;
import xyz.fycz.myreader.model.backup.UserService; import xyz.fycz.myreader.model.backup.UserService;
import xyz.fycz.myreader.model.storage.Backup; import xyz.fycz.myreader.model.storage.Backup;
@ -48,10 +50,13 @@ import xyz.fycz.myreader.ui.activity.DonateActivity;
import xyz.fycz.myreader.ui.activity.FeedbackActivity; import xyz.fycz.myreader.ui.activity.FeedbackActivity;
import xyz.fycz.myreader.ui.activity.MainActivity; import xyz.fycz.myreader.ui.activity.MainActivity;
import xyz.fycz.myreader.ui.activity.MoreSettingActivity; import xyz.fycz.myreader.ui.activity.MoreSettingActivity;
import xyz.fycz.myreader.ui.activity.ReadRecordActivity;
import xyz.fycz.myreader.ui.dialog.DialogCreator; import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog; import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.utils.GsonExtensionsKt;
import xyz.fycz.myreader.util.utils.ImageLoader;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.webapi.ResultCallback; import xyz.fycz.myreader.webapi.ResultCallback;
@ -67,9 +72,9 @@ public class MineFragment extends BaseFragment {
//private boolean isLogin; //private boolean isLogin;
private Setting mSetting; private Setting mSetting;
// private String[] webSynMenu; // private String[] webSynMenu;
private String[] backupMenu; private String[] backupMenu;
// private AlertDialog themeModeDia; // private AlertDialog themeModeDia;
private int themeMode; private int themeMode;
private String[] themeModeArr; private String[] themeModeArr;
@SuppressLint("HandlerLeak") @SuppressLint("HandlerLeak")
@ -159,7 +164,7 @@ public class MineFragment extends BaseFragment {
binding.mineRlSyn.setOnClickListener(v -> { binding.mineRlSyn.setOnClickListener(v -> {
String account = SharedPreUtils.getInstance().getString("webdavAccount"); String account = SharedPreUtils.getInstance().getString("webdavAccount");
String password = SharedPreUtils.getInstance().getString("webdavPassword"); String password = SharedPreUtils.getInstance().getString("webdavPassword");
if (TextUtils.isEmpty(account) || TextUtils.isEmpty(password)){ if (TextUtils.isEmpty(account) || TextUtils.isEmpty(password)) {
ToastUtils.showWarring("请先配置WebDav账户"); ToastUtils.showWarring("请先配置WebDav账户");
binding.mineRlWebdav.performClick(); binding.mineRlWebdav.performClick();
return; return;
@ -267,6 +272,10 @@ public class MineFragment extends BaseFragment {
.setPositiveButton(null, null) .setPositiveButton(null, null)
.show(); .show();
});*/ });*/
binding.mineRlReadRecord.setOnClickListener(v -> {
startActivity(new Intent(getContext(), ReadRecordActivity.class));
});
binding.mineRlSetting.setOnClickListener(v -> { binding.mineRlSetting.setOnClickListener(v -> {
Intent settingIntent = new Intent(getActivity(), MoreSettingActivity.class); Intent settingIntent = new Intent(getActivity(), MoreSettingActivity.class);
startActivity(settingIntent); startActivity(settingIntent);

@ -22,13 +22,12 @@ import xyz.fycz.myreader.base.BaseFragment;
import xyz.fycz.myreader.base.observer.MySingleObserver; import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.databinding.FragmentWebdavSettingBinding; import xyz.fycz.myreader.databinding.FragmentWebdavSettingBinding;
import xyz.fycz.myreader.model.storage.BackupRestoreUi;
import xyz.fycz.myreader.model.storage.Restore; import xyz.fycz.myreader.model.storage.Restore;
import xyz.fycz.myreader.model.storage.WebDavHelp; import xyz.fycz.myreader.model.storage.WebDavHelp;
import xyz.fycz.myreader.ui.activity.MainActivity; import xyz.fycz.myreader.ui.activity.MainActivity;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog; import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.ToastUtils; import xyz.fycz.myreader.util.ToastUtils;
/** /**

@ -38,10 +38,10 @@ import xyz.fycz.myreader.application.SysManager;
import xyz.fycz.myreader.base.BasePresenter; import xyz.fycz.myreader.base.BasePresenter;
import xyz.fycz.myreader.base.observer.MyObserver; import xyz.fycz.myreader.base.observer.MyObserver;
import xyz.fycz.myreader.ui.dialog.BookGroupDialog; import xyz.fycz.myreader.ui.dialog.BookGroupDialog;
import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.RxUtils; import xyz.fycz.myreader.util.utils.RxUtils;
import xyz.fycz.myreader.webapi.ResultCallback; import xyz.fycz.myreader.webapi.ResultCallback;
import xyz.fycz.myreader.common.APPCONST; import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.ui.dialog.MyAlertDialog;
import xyz.fycz.myreader.greendao.entity.BookGroup; import xyz.fycz.myreader.greendao.entity.BookGroup;
import xyz.fycz.myreader.greendao.service.BookGroupService; import xyz.fycz.myreader.greendao.service.BookGroupService;
import xyz.fycz.myreader.model.backup.UserService; import xyz.fycz.myreader.model.backup.UserService;

@ -1,4 +1,4 @@
package xyz.fycz.myreader.util; package xyz.fycz.myreader.util.help;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.DateFormat; import java.text.DateFormat;

@ -1,10 +1,13 @@
package xyz.fycz.myreader.util; package xyz.fycz.myreader.util.help;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import java.io.File; import java.io.File;
import xyz.fycz.myreader.util.ToastUtils;
import xyz.fycz.myreader.util.UriFileUtil;
public class OpenFileHelper { public class OpenFileHelper {
private final static String[][] MIME_MapTable = { private final static String[][] MIME_MapTable = {

@ -0,0 +1,96 @@
package xyz.fycz.myreader.util.help;
import android.text.TextUtils;
import xyz.fycz.myreader.entity.Date;
/**
* @author fengyue
* @date 2021/6/1 19:20
*/
public class RelativeDateHelp {
private static final long ONE_MINUTE = 60000L;
private static final long ONE_HOUR = 3600000L;
private static final long ONE_DAY = 86400000L;
private static final long ONE_WEEK = 604800000L;
private static final String ONE_SECOND_AGO = "秒前";
private static final String ONE_MINUTE_AGO = "分钟前";
private static final String ONE_HOUR_AGO = "小时前";
private static final String ONE_DAY_AGO = "天前";
private static final String ONE_MONTH_AGO = "月前";
private static final String ONE_YEAR_AGO = "年前";
//时间转换
public static String format(long time) {
long delta = System.currentTimeMillis() - time;
if (delta < ONE_MINUTE) {
long seconds = toSeconds(delta);
return (seconds <= 0 ? 1 : seconds) + ONE_SECOND_AGO;
}
if (delta < 45L * ONE_MINUTE) {
long minutes = toMinutes(delta);
return (minutes <= 0 ? 1 : minutes) + ONE_MINUTE_AGO;
}
if (delta < 24L * ONE_HOUR) {
long hours = toHours(delta);
return (hours <= 0 ? 1 : hours) + ONE_HOUR_AGO;
}
if (delta < 48L * ONE_HOUR) {
return "昨天";
}
if (delta < 30L * ONE_DAY) {
long days = toDays(delta);
return (days <= 0 ? 1 : days) + ONE_DAY_AGO;
}
if (delta < 12L * 4L * ONE_WEEK) {
long months = toMonths(delta);
return (months <= 0 ? 1 : months) + ONE_MONTH_AGO;
} else {
long years = toYears(delta);
return (years <= 0 ? 1 : years) + ONE_YEAR_AGO;
}
}
private static long toSeconds(long date) {
return date / 1000L;
}
private static long toMinutes(long date) {
return toSeconds(date) / 60L;
}
private static long toHours(long date) {
return toMinutes(date) / 60L;
}
private static long toDays(long date) {
return toHours(date) / 24L;
}
private static long toMonths(long date) {
return toDays(date) / 30L;
}
private static long toYears(long date) {
return toMonths(date) / 365L;
}
public static String formatDuring(long time){
long days = time / (1000 * 60 * 60 * 24);
long hours = time % (1000 * 60 * 60 * 24) / (1000 * 60 * 60);
long minutes = time % (1000 * 60 * 60) / (1000 * 60);
long seconds = time % (1000 * 60) / 1000;
String d = days > 0 ? days + "天" : "";
String h = hours > 0 ? hours + "小时" : "";
String m = minutes > 0 ? minutes + "分钟" : "";
String s = seconds > 0 ? seconds + "秒" : "";
String strTime = d + h + m + s;
if (TextUtils.isEmpty(strTime)) {
strTime = "0秒";
}
return strTime;
}
}

@ -1,4 +1,4 @@
package xyz.fycz.myreader.util; package xyz.fycz.myreader.util.help;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;

@ -17,7 +17,7 @@ import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.base.observer.MySingleObserver; import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.URLCONST; import xyz.fycz.myreader.common.URLCONST;
import xyz.fycz.myreader.model.backup.UserService; import xyz.fycz.myreader.model.backup.UserService;
import xyz.fycz.myreader.util.DateHelper; import xyz.fycz.myreader.util.help.DateHelper;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
/** /**

@ -13,7 +13,6 @@ import android.util.Log;
import org.mozilla.universalchardet.UniversalDetector; import org.mozilla.universalchardet.UniversalDetector;
import java.io.BufferedOutputStream;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.io.File; import java.io.File;
@ -35,10 +34,8 @@ import io.reactivex.Single;
import io.reactivex.SingleEmitter; import io.reactivex.SingleEmitter;
import io.reactivex.SingleOnSubscribe; import io.reactivex.SingleOnSubscribe;
import xyz.fycz.myreader.application.App; import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.common.APPCONST;
import xyz.fycz.myreader.ui.dialog.DialogCreator;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
public class FileUtils { public class FileUtils {

@ -8,7 +8,7 @@ import android.net.NetworkInfo;
import okhttp3.Response; import okhttp3.Response;
import xyz.fycz.myreader.application.App; import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import java.net.InetAddress; import java.net.InetAddress;

@ -1,17 +1,12 @@
package xyz.fycz.myreader.webapi; package xyz.fycz.myreader.webapi;
import org.jetbrains.annotations.NotNull;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import io.reactivex.Observable; import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe; import io.reactivex.ObservableOnSubscribe;
import io.reactivex.ObservableSource;
import io.reactivex.functions.Function;
import okhttp3.MediaType; import okhttp3.MediaType;
import okhttp3.RequestBody; import okhttp3.RequestBody;
import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.entity.SearchBookBean;
@ -19,7 +14,7 @@ import xyz.fycz.myreader.entity.StrResponse;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -16,7 +16,7 @@ import okhttp3.RequestBody;
import xyz.fycz.myreader.application.App; import xyz.fycz.myreader.application.App;
import xyz.fycz.myreader.base.observer.MySingleObserver; import xyz.fycz.myreader.base.observer.MySingleObserver;
import xyz.fycz.myreader.common.URLCONST; import xyz.fycz.myreader.common.URLCONST;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.util.utils.RxUtils; import xyz.fycz.myreader.util.utils.RxUtils;

@ -9,7 +9,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager; import xyz.fycz.myreader.model.sourceAnalyzer.BookSourceManager;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawlerNoInfo; import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawlerNoInfo;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;

@ -22,7 +22,7 @@ import xyz.fycz.myreader.greendao.entity.rule.TocRule;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.BaseAnalyzer; import xyz.fycz.myreader.model.sourceAnalyzer.BaseAnalyzer;
import xyz.fycz.myreader.model.sourceAnalyzer.MatcherAnalyzer; import xyz.fycz.myreader.model.sourceAnalyzer.MatcherAnalyzer;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.util.utils.StringUtils; import xyz.fycz.myreader.util.utils.StringUtils;

@ -11,7 +11,7 @@ import java.util.List;
import xyz.fycz.myreader.entity.bookstore.BookType; import xyz.fycz.myreader.entity.bookstore.BookType;
import xyz.fycz.myreader.enums.LocalBookSource; import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;

@ -22,7 +22,7 @@ import xyz.fycz.myreader.entity.bookstore.SortBook;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.SharedPreUtils; import xyz.fycz.myreader.util.SharedPreUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.FindCrawler; import xyz.fycz.myreader.webapi.crawler.base.FindCrawler;
import java.io.BufferedReader; import java.io.BufferedReader;

@ -12,7 +12,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -11,7 +11,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;
import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.ReadCrawler;

@ -14,7 +14,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -14,7 +14,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -11,7 +11,7 @@ import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -17,7 +17,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.OkHttpUtils; import xyz.fycz.myreader.util.utils.OkHttpUtils;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -12,7 +12,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import java.util.ArrayList; import java.util.ArrayList;

@ -14,7 +14,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -14,7 +14,7 @@ import xyz.fycz.myreader.enums.LocalBookSource;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -13,7 +13,7 @@ import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.entity.rule.SearchRule; import xyz.fycz.myreader.greendao.entity.rule.SearchRule;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.JsonPathAnalyzer; import xyz.fycz.myreader.model.sourceAnalyzer.JsonPathAnalyzer;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler;
/** /**

@ -9,7 +9,7 @@ import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.MatcherAnalyzer; import xyz.fycz.myreader.model.sourceAnalyzer.MatcherAnalyzer;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.NetworkUtils; import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler;

@ -1,13 +1,12 @@
package xyz.fycz.myreader.webapi.crawler.source; package xyz.fycz.myreader.webapi.crawler.source;
import java.util.List; import java.util.List;
import java.util.Map;
import xyz.fycz.myreader.entity.SearchBookBean; import xyz.fycz.myreader.entity.SearchBookBean;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.rule.BookSource; import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseReadCrawler;
import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler; import xyz.fycz.myreader.webapi.crawler.base.BookInfoCrawler;

@ -12,7 +12,7 @@ import xyz.fycz.myreader.greendao.entity.rule.BookSource;
import xyz.fycz.myreader.greendao.entity.rule.SearchRule; import xyz.fycz.myreader.greendao.entity.rule.SearchRule;
import xyz.fycz.myreader.model.mulvalmap.ConMVMap; import xyz.fycz.myreader.model.mulvalmap.ConMVMap;
import xyz.fycz.myreader.model.sourceAnalyzer.XpathAnalyzer; import xyz.fycz.myreader.model.sourceAnalyzer.XpathAnalyzer;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler; import xyz.fycz.myreader.webapi.crawler.base.BaseSourceCrawler;
/** /**

@ -10,7 +10,7 @@ import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.service.ChapterService; import xyz.fycz.myreader.greendao.service.ChapterService;
import xyz.fycz.myreader.util.IOUtils; import xyz.fycz.myreader.util.IOUtils;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.FileUtils;
import xyz.fycz.myreader.util.utils.RxUtils; import xyz.fycz.myreader.util.utils.RxUtils;

@ -19,7 +19,7 @@ import xyz.fycz.myreader.entity.Setting;
import xyz.fycz.myreader.greendao.entity.Book; import xyz.fycz.myreader.greendao.entity.Book;
import xyz.fycz.myreader.greendao.entity.Chapter; import xyz.fycz.myreader.greendao.entity.Chapter;
import xyz.fycz.myreader.greendao.service.ChapterService; import xyz.fycz.myreader.greendao.service.ChapterService;
import xyz.fycz.myreader.util.StringHelper; import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.utils.FileUtils; import xyz.fycz.myreader.util.utils.FileUtils;
import xyz.fycz.myreader.util.utils.RxUtils; import xyz.fycz.myreader.util.utils.RxUtils;
import xyz.fycz.myreader.webapi.BookApi; import xyz.fycz.myreader.webapi.BookApi;

@ -4,9 +4,9 @@
android:viewportWidth="1024" android:viewportWidth="1024"
android:viewportHeight="1024"> android:viewportHeight="1024">
<path <path
android:fillColor="#FFFFFF" android:fillColor="#689CD5"
android:pathData="M762.24,506.88a32,32 0,0 1,-46.08 -44.16l55.68,-58.24a125.76,125.76 0,0 0,-12.16 -171.2c-48.32,-50.24 -119.68,-54.72 -160,-12.48L444.16,384a125.76,125.76 0,0 0,12.16 171.2,32 32,0 0,1 0,45.12 32,32 0,0 1,-45.44 0,189.44 189.44,0 0,1 -12.16,-259.52l155.52,-162.24c66.88,-69.76 180.48,-64 252.8,12.8A189.44,189.44 0,0 1,818.24 448z"/> android:pathData="M762.24,506.88a32,32 0,0 1,-46.08 -44.16l55.68,-58.24a125.76,125.76 0,0 0,-12.16 -171.2c-48.32,-50.24 -119.68,-54.72 -160,-12.48L444.16,384a125.76,125.76 0,0 0,12.16 171.2,32 32,0 0,1 0,45.12 32,32 0,0 1,-45.44 0,189.44 189.44,0 0,1 -12.16,-259.52l155.52,-162.24c66.88,-69.76 180.48,-64 252.8,12.8A189.44,189.44 0,0 1,818.24 448z"/>
<path <path
android:fillColor="#FFFFFF" android:fillColor="#689CD5"
android:pathData="M229.76,517.12a32,32 0,0 1,46.08 44.16l-55.68,58.24a125.76,125.76 0,0 0,12.16 171.2c48.32,50.24 119.68,54.72 160,12.48L547.84,640a125.76,125.76 0,0 0,-12.16 -171.2,32 32,0 0,1 0,-45.12 32,32 0,0 1,45.44 0,189.44 189.44,0 0,1 12.16,259.52L437.76,845.44c-66.88,69.76 -180.48,64 -252.8,-12.8A189.44,189.44 0,0 1,173.76 576z"/> android:pathData="M229.76,517.12a32,32 0,0 1,46.08 44.16l-55.68,58.24a125.76,125.76 0,0 0,12.16 171.2c48.32,50.24 119.68,54.72 160,12.48L547.84,640a125.76,125.76 0,0 0,-12.16 -171.2,32 32,0 0,1 0,-45.12 32,32 0,0 1,45.44 0,189.44 189.44,0 0,1 12.16,259.52L437.76,845.44c-66.88,69.76 -180.48,64 -252.8,-12.8A189.44,189.44 0,0 1,173.76 576z"/>
</vector> </vector>

@ -0,0 +1,15 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,298.65a85.35,85.35 0,1 0,0 -170.65,85.35 85.35,0 0,0 0,170.65z"
android:fillColor="#ffffff"/>
<path
android:pathData="M512,512m-85.35,0a85.35,85.35 0,1 0,170.7 0,85.35 85.35,0 1,0 -170.7,0Z"
android:fillColor="#ffffff"/>
<path
android:pathData="M512,896a85.35,85.35 0,1 0,0 -170.7,85.35 85.35,0 0,0 0,170.7z"
android:fillColor="#ffffff"/>
</vector>

@ -0,0 +1,51 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/toolbar"/>
<RelativeLayout
android:id="@+id/rl_all_record"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="?android:attr/selectableItemBackground">
<ImageView
android:id="@+id/iv_all_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_marginHorizontal="15dp"
android:src="@drawable/ic_history"
app:tint="@color/textPrimary" />
<TextView
android:id="@+id/tv_all_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/iv_all_record"
android:text="@string/all_read_time"
android:textColor="@color/textPrimary"
android:textSize="@dimen/text_normal_size" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_centerVertical="true"
android:background="?android:attr/selectableItemBackground"
android:padding="5dp"
app:srcCompat="@drawable/ic_more"
app:tint="@color/textSecondary" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_records"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>

@ -7,6 +7,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="@color/colorBackground" android:background="@color/colorBackground"
android:scrollbars="vertical"> android:scrollbars="vertical">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
@ -249,5 +250,57 @@
android:text="@string/read_xs7"/> android:text="@string/read_xs7"/>
</RelativeLayout>--> </RelativeLayout>-->
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="35dp"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:clickable="false">
<ImageView
android:id="@+id/iv_links"
android:layout_alignParentStart="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:src="@drawable/ic_link"
/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="15dp"
android:layout_toEndOf="@id/iv_links"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_small_size"
android:text="友情链接"/>
</RelativeLayout>
<RelativeLayout
android:id="@+id/mine_rl_dyys"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@drawable/selector_common_bg"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<ImageView
android:id="@+id/iv_dyys"
android:layout_width="90dp"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true" />
<TextView
android:id="@+id/tv_dyys"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="15dp"
android:layout_toEndOf="@id/iv_dyys"
android:text="@string/dyys"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

@ -208,7 +208,35 @@
android:textSize="@dimen/text_normal_size" /> android:textSize="@dimen/text_normal_size" />
</RelativeLayout> </RelativeLayout>
<RelativeLayout
android:id="@+id/mine_rl_read_record"
android:layout_width="match_parent"
android:layout_height="60dp"
android:background="@drawable/selector_common_bg"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<ImageView
android:id="@+id/iv_read_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:src="@drawable/ic_history"
app:tint="@color/textPrimary" />
<TextView
android:id="@+id/tv_read_record"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginStart="15dp"
android:layout_toEndOf="@id/iv_read_record"
android:text="@string/read_record"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_normal_size" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -430,7 +458,5 @@
android:textSize="@dimen/text_normal_size" /> android:textSize="@dimen/text_normal_size" />
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
</androidx.core.widget.NestedScrollView> </androidx.core.widget.NestedScrollView>

@ -0,0 +1,113 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/rl_book_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingStart="5dp"
android:paddingEnd="5dp">
<LinearLayout
android:id="@+id/ll_book_item"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="5dp">
<CheckBox
android:id="@+id/cb_book_select"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:clickable="false"
android:enabled="true"
android:focusable="true"
android:paddingEnd="2dp"
android:theme="@style/MyCheckBox"
android:visibility="gone" />
<xyz.fycz.myreader.widget.CoverImageView
android:id="@+id/iv_book_img"
android:layout_width="48dp"
android:layout_height="66dp"
android:scaleType="fitXY"
app:srcCompat="@mipmap/default_cover" />
<LinearLayout
android:id="@+id/ll_book_read"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tv_book_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="1"
android:padding="4dp"
android:text="bookname"
android:textColor="@color/textPrimary"
android:textSize="16dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:padding="3dp"
app:srcCompat="@drawable/ic_author"
app:tint="@color/textSecondary" />
<TextView
android:id="@+id/tv_book_author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxLines="1"
android:text="辰东"
android:textColor="@color/textSecondary"
android:textSize="12dp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="20dp"
android:layout_height="20dp"
android:padding="3dp"
app:srcCompat="@drawable/ic_book_last"
app:tint="@color/textSecondary" />
<TextView
android:id="@+id/tv_book_read_record"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:maxLines="1"
android:text="一天前 · 5分钟3秒"
android:textColor="@color/textSecondary"
android:textSize="@dimen/text_default_size" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_more"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:background="?android:attr/selectableItemBackground"
android:padding="5dp"
app:srcCompat="@drawable/ic_more"
app:tint="@color/textSecondary" />
</RelativeLayout>

@ -489,6 +489,9 @@
<string name="clear_cookie">清除Cookie</string> <string name="clear_cookie">清除Cookie</string>
<string name="book_source">编辑书源</string> <string name="book_source">编辑书源</string>
<string name="adapt_en_type">适配英文排版</string> <string name="adapt_en_type">适配英文排版</string>
<string name="dyys">段友影视,超清无水印广告视频站</string>
<string name="all_read_time">总阅读时间:%s</string>
<string name="read_record">阅读记录</string>
<string-array name="reset_screen_time"> <string-array name="reset_screen_time">

@ -1,2 +1,2 @@
#Tue Jun 01 08:59:40 CST 2021 #Tue Jun 01 18:16:41 CST 2021
VERSION_CODE=204 VERSION_CODE=204

Loading…
Cancel
Save