|
|
@ -17,10 +17,7 @@ import io.legado.app.help.ReadBookConfig |
|
|
|
import io.legado.app.help.http.HttpHelper |
|
|
|
import io.legado.app.help.http.HttpHelper |
|
|
|
import io.legado.app.help.permission.Permissions |
|
|
|
import io.legado.app.help.permission.Permissions |
|
|
|
import io.legado.app.help.permission.PermissionsCompat |
|
|
|
import io.legado.app.help.permission.PermissionsCompat |
|
|
|
import io.legado.app.lib.dialogs.alert |
|
|
|
import io.legado.app.lib.dialogs.* |
|
|
|
import io.legado.app.lib.dialogs.customView |
|
|
|
|
|
|
|
import io.legado.app.lib.dialogs.noButton |
|
|
|
|
|
|
|
import io.legado.app.lib.dialogs.okButton |
|
|
|
|
|
|
|
import io.legado.app.lib.theme.bottomBackground |
|
|
|
import io.legado.app.lib.theme.bottomBackground |
|
|
|
import io.legado.app.lib.theme.getPrimaryTextColor |
|
|
|
import io.legado.app.lib.theme.getPrimaryTextColor |
|
|
|
import io.legado.app.lib.theme.getSecondaryTextColor |
|
|
|
import io.legado.app.lib.theme.getSecondaryTextColor |
|
|
@ -99,6 +96,7 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack { |
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("InflateParams") |
|
|
|
@SuppressLint("InflateParams") |
|
|
|
private fun initData() = with(ReadBookConfig.durConfig) { |
|
|
|
private fun initData() = with(ReadBookConfig.durConfig) { |
|
|
|
|
|
|
|
tv_name.text = name.ifBlank { "文字" } |
|
|
|
sw_dark_status_icon.isChecked = curStatusIconDark() |
|
|
|
sw_dark_status_icon.isChecked = curStatusIconDark() |
|
|
|
adapter = BgAdapter(requireContext(), secondaryTextColor) |
|
|
|
adapter = BgAdapter(requireContext(), secondaryTextColor) |
|
|
|
recycler_view.adapter = adapter |
|
|
|
recycler_view.adapter = adapter |
|
|
@ -115,7 +113,25 @@ class BgTextConfigDialog : BaseDialogFragment(), FileChooserDialog.CallBack { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@SuppressLint("InflateParams") |
|
|
|
private fun initEvent() = with(ReadBookConfig.durConfig) { |
|
|
|
private fun initEvent() = with(ReadBookConfig.durConfig) { |
|
|
|
|
|
|
|
iv_edit.onClick { |
|
|
|
|
|
|
|
alert(R.string.style_name) { |
|
|
|
|
|
|
|
var editText: AutoCompleteTextView? = null |
|
|
|
|
|
|
|
customView { |
|
|
|
|
|
|
|
layoutInflater.inflate(R.layout.dialog_edit_text, null).apply { |
|
|
|
|
|
|
|
editText = edit_view |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
okButton { |
|
|
|
|
|
|
|
editText?.text?.toString()?.let { |
|
|
|
|
|
|
|
tv_name.text = it |
|
|
|
|
|
|
|
ReadBookConfig.durConfig.name = it |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
cancelButton() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
sw_dark_status_icon.onCheckedChange { buttonView, isChecked -> |
|
|
|
sw_dark_status_icon.onCheckedChange { buttonView, isChecked -> |
|
|
|
if (buttonView?.isPressed == true) { |
|
|
|
if (buttonView?.isPressed == true) { |
|
|
|
setCurStatusIconDark(isChecked) |
|
|
|
setCurStatusIconDark(isChecked) |
|
|
|