修复阅读背景配置时不显示文字的问题
This commit is contained in:
3 files changed
+8
-10
No files matched your search
@@ -25,14 +25,13 @@ class BgAdapter(context: Context, val textColor: Int) :
|
|||||||
payloads: MutableList<Any>
|
payloads: MutableList<Any>
|
||||||
) {
|
) {
|
||||||
binding.run {
|
binding.run {
|
||||||
|
tvName.text = item.substringBeforeLast(".")
|
||||||
ImageLoader.load(
|
ImageLoader.load(
|
||||||
context,
|
context,
|
||||||
context.assets.open("bg${File.separator}$item").readBytes()
|
context.assets.open("bg${File.separator}$item").readBytes()
|
||||||
)
|
)
|
||||||
.centerCrop()
|
.centerCrop()
|
||||||
.into(ivBg)
|
.into(ivBg)
|
||||||
tvName.setTextColor(textColor)
|
|
||||||
tvName.text = item.substringBeforeLast(".")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ package io.legato.kazusa.ui.book.read.config
|
|||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
import android.content.DialogInterface
|
import android.content.DialogInterface
|
||||||
import android.graphics.PorterDuff
|
|
||||||
import android.net.Uri
|
import android.net.Uri
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
import android.view.View
|
import android.view.View
|
||||||
@@ -115,10 +114,8 @@ class BgTextConfigDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_bg
|
|||||||
recyclerView.adapter = adapter
|
recyclerView.adapter = adapter
|
||||||
adapter.addHeaderView {
|
adapter.addHeaderView {
|
||||||
ItemBgImageBinding.inflate(layoutInflater, it, false).apply {
|
ItemBgImageBinding.inflate(layoutInflater, it, false).apply {
|
||||||
tvName.setTextColor(secondaryTextColor)
|
|
||||||
tvName.text = getString(R.string.select_image)
|
tvName.text = getString(R.string.select_image)
|
||||||
ivBg.setImageResource(R.drawable.ic_image)
|
ivBg.setImageResource(R.drawable.ic_add)
|
||||||
ivBg.setColorFilter(primaryTextColor, PorterDuff.Mode.SRC_IN)
|
|
||||||
swUnderline.isGone = ReadBook.book?.isImage == true
|
swUnderline.isGone = ReadBook.book?.isImage == true
|
||||||
root.setOnClickListener {
|
root.setOnClickListener {
|
||||||
selectBgImage.launch()
|
selectBgImage.launch()
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="66dp"
|
android:layout_width="66dp"
|
||||||
android:layout_height="88dp"
|
android:layout_height="98dp"
|
||||||
xmlns:tool="http://schemas.android.com/tools"
|
|
||||||
android:layout_marginEnd="6dp"
|
android:layout_marginEnd="6dp"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
@@ -17,9 +16,9 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:contentDescription="@string/bg_image"
|
android:contentDescription="@string/bg_image"
|
||||||
android:foreground="?android:attr/selectableItemBackground"
|
android:background="?android:attr/selectableItemBackground"
|
||||||
android:scaleType="fitCenter"
|
android:scaleType="fitCenter"
|
||||||
tool:src="@drawable/ic_image" />
|
android:src="@drawable/ic_add" />
|
||||||
|
|
||||||
</com.google.android.material.card.MaterialCardView>
|
</com.google.android.material.card.MaterialCardView>
|
||||||
|
|
||||||
@@ -27,6 +26,9 @@
|
|||||||
android:id="@+id/tv_name"
|
android:id="@+id/tv_name"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp"
|
||||||
|
android:textSize="12sp"
|
||||||
|
android:textStyle="bold"
|
||||||
android:text="@string/text"
|
android:text="@string/text"
|
||||||
android:singleLine="true"
|
android:singleLine="true"
|
||||||
android:gravity="center" />
|
android:gravity="center" />
|
||||||
|
|||||||
Reference in new issue
Block a user