|
|
|
@ -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 (ReadAloudService.running) { |
|
|
|
|
if (mPageLoader.hasChapterData(mChapters.get(mPageLoader.getChapterPos()))) { |
|
|
|
|
if (resetRead) { |
|
|
|
|
if (mAudioPlayerDialog != null) { |
|
|
|
|
mHandler.postDelayed(() ->mAudioPlayerDialog.readAloud(), 500); |
|
|
|
|
mHandler.postDelayed(() -> mAudioPlayerDialog.readAloud(), 500); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
if (pos == 0) { |
|
|
|
|
if (mAudioPlayerDialog != null) { |
|
|
|
|
mHandler.postDelayed(() ->mAudioPlayerDialog.readAloud(), 500); |
|
|
|
|
mHandler.postDelayed(() -> mAudioPlayerDialog.readAloud(), 500); |
|
|
|
|
} |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
}else { |
|
|
|
|
ReadAloudService.stop(ReadActivity.this); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|