页脚等
This commit is contained in:
10 files changed
+27
-13
No files matched your search
@@ -24,9 +24,11 @@ object ReadTipConfig {
|
|||||||
const val batteryIcon = 14
|
const val batteryIcon = 14
|
||||||
const val batteryClassic = 15
|
const val batteryClassic = 15
|
||||||
const val timeBatteryClassic = 16
|
const val timeBatteryClassic = 16
|
||||||
|
const val chapterTitleArrowClassic = 17
|
||||||
|
|
||||||
|
|
||||||
val tipValues = arrayOf(
|
val tipValues = arrayOf(
|
||||||
none, bookName, chapterTitle, chapterTitleArrow, time, battery, batteryClassic, batteryInside, batteryIcon, batteryPercentage, page,
|
none, bookName, chapterTitle, chapterTitleArrow, chapterTitleArrowClassic, time, battery, batteryClassic, batteryInside, batteryIcon, batteryPercentage, page,
|
||||||
totalProgress, totalProgress1, pageAndTotal, timeBattery, timeBatteryClassic, timeBatteryPercentage
|
totalProgress, totalProgress1, pageAndTotal, timeBattery, timeBatteryClassic, timeBatteryPercentage
|
||||||
)
|
)
|
||||||
val tipNames get() = appCtx.resources.getStringArray(R.array.read_tip).toList()
|
val tipNames get() = appCtx.resources.getStringArray(R.array.read_tip).toList()
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
private var tvBatteryIcon: BatteryView? = null
|
private var tvBatteryIcon: BatteryView? = null
|
||||||
private var tvBatteryClassic: BatteryView? = null
|
private var tvBatteryClassic: BatteryView? = null
|
||||||
private var tvTimeBatteryClassic: BatteryView? = null
|
private var tvTimeBatteryClassic: BatteryView? = null
|
||||||
|
private var tvTitleArrowClassic: BatteryView? = null
|
||||||
|
|
||||||
private var isMainView = false
|
private var isMainView = false
|
||||||
var isScroll = false
|
var isScroll = false
|
||||||
@@ -190,6 +191,11 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
}
|
}
|
||||||
tvTitleArrow = getTipView(ReadTipConfig.chapterTitleArrow)?.apply {
|
tvTitleArrow = getTipView(ReadTipConfig.chapterTitleArrow)?.apply {
|
||||||
tag = ReadTipConfig.chapterTitleArrow
|
tag = ReadTipConfig.chapterTitleArrow
|
||||||
|
textSize = 12f
|
||||||
|
batteryMode = BatteryView.BatteryMode.ARROW
|
||||||
|
}
|
||||||
|
tvTitleArrowClassic = getTipView(ReadTipConfig.chapterTitleArrowClassic)?.apply {
|
||||||
|
tag = ReadTipConfig.chapterTitleArrowClassic
|
||||||
typeface = ChapterProvider.typeface
|
typeface = ChapterProvider.typeface
|
||||||
textSize = 12f
|
textSize = 12f
|
||||||
batteryMode = BatteryView.BatteryMode.ARROW
|
batteryMode = BatteryView.BatteryMode.ARROW
|
||||||
@@ -390,6 +396,7 @@ class PageView(context: Context) : FrameLayout(context) {
|
|||||||
tvBookName?.setTextIfNotEqual(ReadBook.book?.name)
|
tvBookName?.setTextIfNotEqual(ReadBook.book?.name)
|
||||||
tvTitle?.setTextIfNotEqual(textPage.title)
|
tvTitle?.setTextIfNotEqual(textPage.title)
|
||||||
tvTitleArrow?.setTextIfNotEqual(textPage.title)
|
tvTitleArrow?.setTextIfNotEqual(textPage.title)
|
||||||
|
tvTitleArrowClassic?.setTextIfNotEqual(textPage.title)
|
||||||
val readProgress = readProgress
|
val readProgress = readProgress
|
||||||
tvTotalProgress?.setTextIfNotEqual(readProgress)
|
tvTotalProgress?.setTextIfNotEqual(readProgress)
|
||||||
tvTotalProgress1?.setTextIfNotEqual("${chapterIndex.plus(1)}/${chapterSize}")
|
tvTotalProgress1?.setTextIfNotEqual("${chapterIndex.plus(1)}/${chapterSize}")
|
||||||
|
|||||||
@@ -21,17 +21,12 @@ class BatteryView @JvmOverloads constructor(
|
|||||||
|
|
||||||
enum class BatteryMode { OUTER, INNER, ICON, ARROW, TIME, CLASSIC, NO_BATTERY }
|
enum class BatteryMode { OUTER, INNER, ICON, ARROW, TIME, CLASSIC, NO_BATTERY }
|
||||||
|
|
||||||
// private val batteryTypeface by lazy {
|
private val batteryTypeface by lazy {
|
||||||
// Typeface.createFromAsset(context.assets, "font/number.ttf")
|
Typeface.createFromAsset(context.assets, "font/number.ttf")
|
||||||
// }
|
}
|
||||||
|
|
||||||
private var battery: Int = 0
|
private var battery: Int = 0
|
||||||
|
|
||||||
init {
|
|
||||||
//binding.batteryText.typeface = batteryTypeface
|
|
||||||
//binding.batteryTextInner.typeface = batteryTypeface
|
|
||||||
}
|
|
||||||
|
|
||||||
var text: CharSequence?
|
var text: CharSequence?
|
||||||
get() = binding.batteryText.text
|
get() = binding.batteryText.text
|
||||||
set(value) {
|
set(value) {
|
||||||
@@ -75,7 +70,10 @@ class BatteryView @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
BatteryMode.CLASSIC -> {
|
BatteryMode.CLASSIC -> {
|
||||||
|
binding.batteryText.typeface = batteryTypeface
|
||||||
|
binding.batteryTextInner.typeface = batteryTypeface
|
||||||
binding.batteryClassic.isBattery = true
|
binding.batteryClassic.isBattery = true
|
||||||
|
binding.batteryClassic.textSize = 11f
|
||||||
binding.batteryClassic.setBattery(battery, text)
|
binding.batteryClassic.setBattery(battery, text)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +167,7 @@ class BatteryView @JvmOverloads constructor(
|
|||||||
|
|
||||||
private fun updateFill() {
|
private fun updateFill() {
|
||||||
post {
|
post {
|
||||||
val maxWidth = 14.dpToPx()
|
val maxWidth = 17.dpToPx()
|
||||||
val params = binding.batteryFill.layoutParams
|
val params = binding.batteryFill.layoutParams
|
||||||
params.width = (maxWidth * battery / 100f).toInt()
|
params.width = (maxWidth * battery / 100f).toInt()
|
||||||
binding.batteryFill.layoutParams = params
|
binding.batteryFill.layoutParams = params
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ class BatteryViewOrgin @JvmOverloads constructor(
|
|||||||
private val outFrame = Rect()
|
private val outFrame = Rect()
|
||||||
private val polar = Rect()
|
private val polar = Rect()
|
||||||
private val canvasRecorder = CanvasRecorderFactory.create()
|
private val canvasRecorder = CanvasRecorderFactory.create()
|
||||||
var isBattery = false
|
var isBattery = true
|
||||||
set(value) {
|
set(value) {
|
||||||
field = value
|
field = value
|
||||||
if (value && !isInEditMode) {
|
if (value && !isInEditMode) {
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<com.google.android.material.card.MaterialCardView
|
<com.google.android.material.card.MaterialCardView
|
||||||
android:id="@+id/battery_fill"
|
android:id="@+id/battery_fill"
|
||||||
android:layout_width="14dp"
|
android:layout_width="17dp"
|
||||||
android:layout_height="8dp"
|
android:layout_height="8dp"
|
||||||
android:visibility="gone"
|
android:visibility="gone"
|
||||||
android:layout_marginStart="4.2dp"
|
android:layout_marginStart="4.2dp"
|
||||||
|
|||||||
@@ -58,8 +58,11 @@
|
|||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_source_action"
|
android:id="@+id/tv_source_action"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="120dp"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="end"
|
||||||
android:paddingVertical="8dp"
|
android:paddingVertical="8dp"
|
||||||
android:text="@string/book_source" />
|
android:text="@string/book_source" />
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
<item>無</item>
|
<item>無</item>
|
||||||
<item>書名</item>
|
<item>書名</item>
|
||||||
<item>標題</item>
|
<item>標題</item>
|
||||||
|
<item>標題+箭頭(使用系統字體)</item>
|
||||||
<item>標題+箭頭</item>
|
<item>標題+箭頭</item>
|
||||||
<item>時間</item>
|
<item>時間</item>
|
||||||
<item>電量</item>
|
<item>電量</item>
|
||||||
|
|||||||
@@ -88,6 +88,7 @@
|
|||||||
<item>無</item>
|
<item>無</item>
|
||||||
<item>書名</item>
|
<item>書名</item>
|
||||||
<item>標題</item>
|
<item>標題</item>
|
||||||
|
<item>標題+箭頭(使用系統字體)</item>
|
||||||
<item>標題+箭頭</item>
|
<item>標題+箭頭</item>
|
||||||
<item>時間</item>
|
<item>時間</item>
|
||||||
<item>電量</item>
|
<item>電量</item>
|
||||||
|
|||||||
@@ -75,6 +75,7 @@
|
|||||||
<item>无</item>
|
<item>无</item>
|
||||||
<item>书名</item>
|
<item>书名</item>
|
||||||
<item>标题</item>
|
<item>标题</item>
|
||||||
|
<item>带箭头的标题(使用系统字体)</item>
|
||||||
<item>带箭头的标题</item>
|
<item>带箭头的标题</item>
|
||||||
<item>时间</item>
|
<item>时间</item>
|
||||||
<item>电量</item>
|
<item>电量</item>
|
||||||
|
|||||||
@@ -142,6 +142,7 @@
|
|||||||
<item>Blank</item>
|
<item>Blank</item>
|
||||||
<item>Book name</item>
|
<item>Book name</item>
|
||||||
<item>Title</item>
|
<item>Title</item>
|
||||||
|
<item>Title With Arrow using System Fonts</item>
|
||||||
<item>Title With Arrow</item>
|
<item>Title With Arrow</item>
|
||||||
<item>Time</item>
|
<item>Time</item>
|
||||||
<item>Battery</item>
|
<item>Battery</item>
|
||||||
|
|||||||
Reference in new issue
Block a user