diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt index ba77137cc..cea8c77d1 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookActivity.kt @@ -317,8 +317,8 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_rea observeEvent(Bus.ALOUD_STATE) { readAloudStatus = it } observeEvent(Bus.TTS_START) {} observeEvent(Bus.TTS_RANGE_START) {} - observeEvent(Bus.TIME_CHANGED) {} - observeEvent(Bus.BATTERY_CHANGED) {} + observeEvent(Bus.TIME_CHANGED) { page_view.upTime() } + observeEvent(Bus.BATTERY_CHANGED) { page_view.upBattery(it) } observeEventSticky(Bus.READ_ALOUD) { onClickReadAloud() } } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt index 08db472a9..a8bc37183 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt @@ -27,6 +27,14 @@ class ContentView : FrameLayout { page_panel.horizontalPadding = 16.dp } + fun upTime() { + + } + + fun upBattery(battery: Int) { + + } + fun setContent(text: CharSequence?) { content_text_view.text = text } diff --git a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt index 25f9eefcb..255068c07 100644 --- a/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/page/PageView.kt @@ -111,6 +111,18 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, att nextPage?.upStyle() } + fun upTime() { + curPage?.upTime() + prevPage?.upTime() + nextPage?.upTime() + } + + fun upBattery(battery: Int) { + curPage?.upBattery(battery) + prevPage?.upBattery(battery) + nextPage?.upBattery(battery) + } + interface CallBack { fun durChapterIndex(): Int fun durChapterPos(pageSize: Int): Int