支持epub阅读(仅支持文字)

pull/5/head
fengyuecanzhu 4 years ago
parent 0fe7b59989
commit 891770ad51
  1. 7
      app/src/main/assets/updatelog.fy
  2. 4
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  3. 15
      app/src/main/java/xyz/fycz/myreader/ui/fragment/FindFragment.java
  4. 6
      app/src/main/java/xyz/fycz/myreader/util/utils/AdUtils.java
  5. 3
      app/src/main/java/xyz/fycz/myreader/webapi/crawler/read/JiuTaoReadCrawler.java

@ -1,3 +1,10 @@
2021.06.13
风月读书v2.1.2
更新内容:
1、修复搜索界面点击换一批闪退bug
2、支持epub文件导入阅读(仅支持文字)
3、阅读模块优化
2021.06.06
风月读书v2.1.1
更新内容:

@ -99,6 +99,7 @@ import xyz.fycz.myreader.util.help.StringHelper;
import xyz.fycz.myreader.util.notification.NotificationClickReceiver;
import xyz.fycz.myreader.util.notification.NotificationUtil;
import xyz.fycz.myreader.util.utils.ColorUtil;
import xyz.fycz.myreader.util.utils.FileUtils;
import xyz.fycz.myreader.util.utils.NetworkUtils;
import xyz.fycz.myreader.util.utils.ScreenUtils;
import xyz.fycz.myreader.util.utils.StringUtils;
@ -1022,7 +1023,8 @@ public class ReadActivity extends BaseActivity implements ColorPickerDialogListe
private void skipToChapterAndPage(int chapterPos, int pagePos) {
mPageLoader.setPrev(false);
if (StringHelper.isEmpty(mChapters.get(chapterPos).getContent())) {
if ("本地书籍".equals(mBook.getType())) {
if ("本地书籍".equals(mBook.getType()) &&
!mBook.getChapterUrl().endsWith(FileUtils.SUFFIX_EPUB)) {
ToastUtils.showWarring("该章节无内容!");
return;
}

@ -40,7 +40,6 @@ import xyz.fycz.myreader.webapi.crawler.find.QiDianMobileRank;
public class FindFragment extends BaseFragment {
private FragmentFindBinding binding;
private Quotation quotation;
@Override
protected View bindView(LayoutInflater inflater, ViewGroup container) {
@ -49,23 +48,14 @@ public class FindFragment extends BaseFragment {
}
@Override
public void onResume() {
super.onResume();
protected void initWidget(Bundle savedInstanceState) {
getQuotation();
}
@Override
protected void initClick() {
super.initClick();
binding.findRlQuotation.setOnClickListener(v -> {
if (quotation == null) return;
ClipboardManager mClipboardManager = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
//数据
ClipData mClipData = ClipData.newPlainText("Label", quotation.toString());
//把数据设置到剪切板上
mClipboardManager.setPrimaryClip(mClipData);
ToastUtils.showSuccess("语录已复制到剪切板");
});
binding.findRlQuotation.setOnClickListener(v -> getQuotation());
binding.findRlQidianTop.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(false)));
binding.findRlQidianNsTop.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(true)));
//binding.findRlXs7Top.setOnClickListener(v -> comeToBookstore(new XS7Rank()));
@ -91,7 +81,6 @@ public class FindFragment extends BaseFragment {
}).compose(RxUtils::toSimpleSingle).subscribe(new MySingleObserver<Quotation>() {
@Override
public void onSuccess(@NotNull Quotation q) {
quotation = q;
binding.tvQuotation.setText(q.getHitokoto());
binding.tvFrom.setText(String.format("--- %s", q.getFrom()));
}

@ -123,9 +123,9 @@ public class AdUtils {
public static void initAd() {
if (!hasInitAd) {
hasInitAd = true;
DdSdkHelper.init("1234", "216", "51716a16fbdf50905704b6575b1b3b60",
"142364", "35ce0efe5f3cc960b116db227498e238",
"8167", "85bd159309c3da1b",
DdSdkHelper.init("", "", "",
"", "",
"", "",
App.getApplication(), true);
}
}

@ -60,7 +60,8 @@ public class JiuTaoReadCrawler extends BaseReadCrawler {
String content = Html.fromHtml(divContent.html()).toString();
char c = 160;
String spaec = "" + c;
content = content.replace(spaec, " ").replaceAll("您可以在.*最新章节!|\\\\", "");
content = content.replace(spaec, " ")
.replaceAll("您可以在.*最新章节!|\\\\", "");
return content;
}

Loading…
Cancel
Save