修复语音朗读部分bug

pull/5/head
fengyuecanzhu 4 years ago
parent 566b551472
commit 5a5e5d3cea
  1. 2
      app/src/main/java/xyz/fycz/myreader/application/MyApplication.java
  2. 23
      app/src/main/java/xyz/fycz/myreader/ui/activity/ReadActivity.java
  3. 2
      app/src/main/java/xyz/fycz/myreader/widget/page/LocalPageLoader.java
  4. 2
      app/src/main/java/xyz/fycz/myreader/widget/page/NetPageLoader.java
  5. 2
      app/src/main/java/xyz/fycz/myreader/widget/page/PageLoader.java

@ -254,7 +254,7 @@ public class MyApplication extends Application {
MyApplication.getApplication().newThread(() -> {
Document doc = null;
try {
String url = "https://shimo.im/docs/cqkgjPRRydYYhQKt/read";
String url = "https://shimo.im/docs/JzVpMgbZUJARSaFs/read";
if (isApkInDebug(getmContext())) {
url = "https://shimo.im/docs/zfzpda7MUGskOC9v/read";
}

@ -397,18 +397,21 @@ public class ReadActivity extends BaseActivity {
@Override
public void onPageChange(int pos, boolean resetRead) {
mHandler.sendMessage(mHandler.obtainMessage(4));
if ((ReadAloudService.running)) {
if (resetRead) {
if (mAudioPlayerDialog != null) {
mHandler.postDelayed(() ->mAudioPlayerDialog.readAloud(), 500);
if (ReadAloudService.running) {
if (mPageLoader.hasChapterData(mChapters.get(mPageLoader.getChapterPos()))) {
if (resetRead) {
if (mAudioPlayerDialog != null) {
mHandler.postDelayed(() -> mAudioPlayerDialog.readAloud(), 500);
}
return;
}
return;
}
if (pos == 0) {
if (mAudioPlayerDialog != null) {
mHandler.postDelayed(() ->mAudioPlayerDialog.readAloud(), 500);
if (pos == 0) {
if (mAudioPlayerDialog != null) {
mHandler.postDelayed(() -> mAudioPlayerDialog.readAloud(), 500);
}
}
return;
}else {
ReadAloudService.stop(ReadActivity.this);
}
}
}

@ -395,7 +395,7 @@ public class LocalPageLoader extends PageLoader {
@Override
protected boolean hasChapterData(Chapter chapter) {
public boolean hasChapterData(Chapter chapter) {
return ChapterService.isChapterCached(mCollBook.getId(), chapter.getTitle());
}

@ -92,7 +92,7 @@ public class NetPageLoader extends PageLoader {
}
@Override
protected boolean hasChapterData(Chapter chapter) {
public boolean hasChapterData(Chapter chapter) {
return ChapterService.isChapterCached(mCollBook.getId(), chapter.getTitle());
}

@ -857,7 +857,7 @@ public abstract class PageLoader {
*
* @return
*/
protected abstract boolean hasChapterData(Chapter chapter);
public abstract boolean hasChapterData(Chapter chapter);
/**

Loading…
Cancel
Save