|
|
@ -45,6 +45,7 @@ import io.legado.app.ui.book.read.page.entities.PageDirection |
|
|
|
import io.legado.app.ui.book.read.page.provider.TextPageFactory |
|
|
|
import io.legado.app.ui.book.read.page.provider.TextPageFactory |
|
|
|
import io.legado.app.ui.book.searchContent.SearchContentActivity |
|
|
|
import io.legado.app.ui.book.searchContent.SearchContentActivity |
|
|
|
import io.legado.app.ui.book.source.edit.BookSourceEditActivity |
|
|
|
import io.legado.app.ui.book.source.edit.BookSourceEditActivity |
|
|
|
|
|
|
|
import io.legado.app.ui.book.toc.BookmarkDialog |
|
|
|
import io.legado.app.ui.book.toc.TocActivityResult |
|
|
|
import io.legado.app.ui.book.toc.TocActivityResult |
|
|
|
import io.legado.app.ui.dict.DictDialog |
|
|
|
import io.legado.app.ui.dict.DictDialog |
|
|
|
import io.legado.app.ui.login.SourceLoginActivity |
|
|
|
import io.legado.app.ui.login.SourceLoginActivity |
|
|
@ -110,7 +111,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
|
override val isInitFinish: Boolean get() = viewModel.isInitFinish |
|
|
|
override val isScroll: Boolean get() = binding.readView.isScroll |
|
|
|
override val isScroll: Boolean get() = binding.readView.isScroll |
|
|
|
private val mHandler = Handler(Looper.getMainLooper()) |
|
|
|
private val mHandler = Handler(Looper.getMainLooper()) |
|
|
|
private val keepScreenRunnable = Runnable { keepScreenOn(window, false) } |
|
|
|
private val keepScreenRunnable = Runnable { keepScreenOn(false) } |
|
|
|
private val autoPageRunnable = Runnable { autoPagePlus() } |
|
|
|
private val autoPageRunnable = Runnable { autoPagePlus() } |
|
|
|
private val backupRunnable = Runnable { |
|
|
|
private val backupRunnable = Runnable { |
|
|
|
if (!BuildConfig.DEBUG) { |
|
|
|
if (!BuildConfig.DEBUG) { |
|
|
@ -251,7 +252,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
chapterName = page.title |
|
|
|
chapterName = page.title |
|
|
|
bookText = page.text.trim() |
|
|
|
bookText = page.text.trim() |
|
|
|
} |
|
|
|
} |
|
|
|
showBookMark(bookmark) |
|
|
|
BookmarkDialog.start(supportFragmentManager, bookmark) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
R.id.menu_copy_text -> |
|
|
|
R.id.menu_copy_text -> |
|
|
@ -513,7 +514,7 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
if (bookmark == null) { |
|
|
|
if (bookmark == null) { |
|
|
|
toastOnUi(R.string.create_bookmark_error) |
|
|
|
toastOnUi(R.string.create_bookmark_error) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
showBookMark(bookmark) |
|
|
|
BookmarkDialog.start(supportFragmentManager, bookmark) |
|
|
|
} |
|
|
|
} |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
@ -983,16 +984,16 @@ class ReadBookActivity : ReadBookBaseActivity(), |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
override fun screenOffTimerStart() { |
|
|
|
override fun screenOffTimerStart() { |
|
|
|
if (screenTimeOut < 0) { |
|
|
|
if (screenTimeOut < 0) { |
|
|
|
keepScreenOn(window, true) |
|
|
|
keepScreenOn(true) |
|
|
|
return |
|
|
|
return |
|
|
|
} |
|
|
|
} |
|
|
|
val t = screenTimeOut - sysScreenOffTime |
|
|
|
val t = screenTimeOut - sysScreenOffTime |
|
|
|
if (t > 0) { |
|
|
|
if (t > 0) { |
|
|
|
mHandler.removeCallbacks(keepScreenRunnable) |
|
|
|
mHandler.removeCallbacks(keepScreenRunnable) |
|
|
|
keepScreenOn(window, true) |
|
|
|
keepScreenOn(true) |
|
|
|
mHandler.postDelayed(keepScreenRunnable, screenTimeOut) |
|
|
|
mHandler.postDelayed(keepScreenRunnable, screenTimeOut) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
keepScreenOn(window, false) |
|
|
|
keepScreenOn(false) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |