|
|
@ -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) |
|
|
|