pull/967/head
gedoor 4 years ago
parent 0cab67420f
commit 09bd44345d
  1. 20
      app/src/main/java/io/legado/app/ui/book/read/config/BgTextConfigDialog.kt
  2. 1
      app/src/main/res/layout/dialog_read_bg_text.xml

@ -98,19 +98,23 @@ class BgTextConfigDialog : BaseDialogFragment() {
(activity as ReadBookActivity).bottomDialog-- (activity as ReadBookActivity).bottomDialog--
} }
private fun initView() { private fun initView() = with(binding) {
val bg = requireContext().bottomBackground val bg = requireContext().bottomBackground
val isLight = ColorUtils.isColorLight(bg) val isLight = ColorUtils.isColorLight(bg)
primaryTextColor = requireContext().getPrimaryTextColor(isLight) primaryTextColor = requireContext().getPrimaryTextColor(isLight)
secondaryTextColor = requireContext().getSecondaryTextColor(isLight) secondaryTextColor = requireContext().getSecondaryTextColor(isLight)
binding.rootView.setBackgroundColor(bg) rootView.setBackgroundColor(bg)
binding.swDarkStatusIcon.setTextColor(primaryTextColor) tvNameTitle.setTextColor(primaryTextColor)
binding.ivImport.setColorFilter(primaryTextColor) tvName.setTextColor(secondaryTextColor)
binding.ivExport.setColorFilter(primaryTextColor) ivEdit.setColorFilter(secondaryTextColor)
binding.ivDelete.setColorFilter(primaryTextColor) tvRestore.setTextColor(primaryTextColor)
binding.tvBgImage.setTextColor(primaryTextColor) swDarkStatusIcon.setTextColor(primaryTextColor)
ivImport.setColorFilter(primaryTextColor)
ivExport.setColorFilter(primaryTextColor)
ivDelete.setColorFilter(primaryTextColor)
tvBgImage.setTextColor(primaryTextColor)
adapter = BgAdapter(requireContext(), secondaryTextColor) adapter = BgAdapter(requireContext(), secondaryTextColor)
binding.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.setTextColor(secondaryTextColor)

@ -16,6 +16,7 @@
android:gravity="center_vertical"> android:gravity="center_vertical">
<TextView <TextView
android:id="@+id/tv_name_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="@string/style_name" android:text="@string/style_name"

Loading…
Cancel
Save