支持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 2021.06.06
风月读书v2.1.1 风月读书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.NotificationClickReceiver;
import xyz.fycz.myreader.util.notification.NotificationUtil; import xyz.fycz.myreader.util.notification.NotificationUtil;
import xyz.fycz.myreader.util.utils.ColorUtil; 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.NetworkUtils;
import xyz.fycz.myreader.util.utils.ScreenUtils; import xyz.fycz.myreader.util.utils.ScreenUtils;
import xyz.fycz.myreader.util.utils.StringUtils; 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) { private void skipToChapterAndPage(int chapterPos, int pagePos) {
mPageLoader.setPrev(false); mPageLoader.setPrev(false);
if (StringHelper.isEmpty(mChapters.get(chapterPos).getContent())) { if (StringHelper.isEmpty(mChapters.get(chapterPos).getContent())) {
if ("本地书籍".equals(mBook.getType())) { if ("本地书籍".equals(mBook.getType()) &&
!mBook.getChapterUrl().endsWith(FileUtils.SUFFIX_EPUB)) {
ToastUtils.showWarring("该章节无内容!"); ToastUtils.showWarring("该章节无内容!");
return; return;
} }

@ -40,7 +40,6 @@ import xyz.fycz.myreader.webapi.crawler.find.QiDianMobileRank;
public class FindFragment extends BaseFragment { public class FindFragment extends BaseFragment {
private FragmentFindBinding binding; private FragmentFindBinding binding;
private Quotation quotation;
@Override @Override
protected View bindView(LayoutInflater inflater, ViewGroup container) { protected View bindView(LayoutInflater inflater, ViewGroup container) {
@ -49,23 +48,14 @@ public class FindFragment extends BaseFragment {
} }
@Override @Override
public void onResume() { protected void initWidget(Bundle savedInstanceState) {
super.onResume();
getQuotation(); getQuotation();
} }
@Override @Override
protected void initClick() { protected void initClick() {
super.initClick(); super.initClick();
binding.findRlQuotation.setOnClickListener(v -> { binding.findRlQuotation.setOnClickListener(v -> getQuotation());
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.findRlQidianTop.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(false))); binding.findRlQidianTop.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(false)));
binding.findRlQidianNsTop.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(true))); binding.findRlQidianNsTop.setOnClickListener(v -> comeToBookstore(new QiDianMobileRank(true)));
//binding.findRlXs7Top.setOnClickListener(v -> comeToBookstore(new XS7Rank())); //binding.findRlXs7Top.setOnClickListener(v -> comeToBookstore(new XS7Rank()));
@ -91,7 +81,6 @@ public class FindFragment extends BaseFragment {
}).compose(RxUtils::toSimpleSingle).subscribe(new MySingleObserver<Quotation>() { }).compose(RxUtils::toSimpleSingle).subscribe(new MySingleObserver<Quotation>() {
@Override @Override
public void onSuccess(@NotNull Quotation q) { public void onSuccess(@NotNull Quotation q) {
quotation = q;
binding.tvQuotation.setText(q.getHitokoto()); binding.tvQuotation.setText(q.getHitokoto());
binding.tvFrom.setText(String.format("--- %s", q.getFrom())); binding.tvFrom.setText(String.format("--- %s", q.getFrom()));
} }

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

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

Loading…
Cancel
Save