This commit is contained in:
kunfei
2023-03-01 19:54:53 +08:00
parent 1a40a391b6
commit c24da8ae6d
8 changed files with 22 additions and 7 deletions
@@ -17,10 +17,11 @@ object ReadTipConfig {
const val bookName = 7
const val timeBattery = 8
const val timeBatteryPercentage = 9
const val totalProgress1 = 10
val tipValues = arrayOf(
none, bookName, chapterTitle, time, battery, batteryPercentage, page,
totalProgress, pageAndTotal, timeBattery, timeBatteryPercentage
totalProgress, totalProgress1, pageAndTotal, timeBattery, timeBatteryPercentage
)
val tipNames get() = appCtx.resources.getStringArray(R.array.read_tip).toList()
@@ -40,6 +40,7 @@ class PageView(context: Context) : FrameLayout(context) {
private var tvBookName: BatteryView? = null
private var tvTimeBattery: BatteryView? = null
private var tvTimeBatteryP: BatteryView? = null
private var tvTotalProgress1: BatteryView? = null
val headerHeight: Int
get() {
@@ -168,6 +169,12 @@ class PageView(context: Context) : FrameLayout(context) {
typeface = ChapterProvider.typeface
textSize = 12f
}
tvTotalProgress1 = getTipView(ReadTipConfig.totalProgress1)?.apply {
tag = ReadTipConfig.totalProgress1
isBattery = false
typeface = ChapterProvider.typeface
textSize = 12f
}
tvPageAndTotal = getTipView(ReadTipConfig.pageAndTotal)?.apply {
tag = ReadTipConfig.pageAndTotal
isBattery = false
@@ -295,6 +302,7 @@ class PageView(context: Context) : FrameLayout(context) {
tvTitle?.text = textPage.title
tvPage?.text = "${index.plus(1)}/$pageSize"
tvTotalProgress?.text = readProgress
tvTotalProgress1?.text = "${textPage.chapterIndex.plus(1)}/${textPage.chapterSize}"
tvPageAndTotal?.text = "${index.plus(1)}/$pageSize $readProgress"
}