diff --git a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt new file mode 100644 index 000000000..8f450e770 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleActivity.kt @@ -0,0 +1,19 @@ +package io.legado.app.ui.book.local.rule + +import android.os.Bundle +import androidx.activity.viewModels +import io.legado.app.base.VMBaseActivity +import io.legado.app.databinding.ActivityTxtTocRuleBinding +import io.legado.app.utils.viewbindingdelegate.viewBinding + +class TxtTocRuleActivity : VMBaseActivity() { + + override val viewModel: TxtTocRuleViewModel by viewModels() + override val binding: ActivityTxtTocRuleBinding by viewBinding(ActivityTxtTocRuleBinding::inflate) + + override fun onActivityCreated(savedInstanceState: Bundle?) { + TODO("Not yet implemented") + } + + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt new file mode 100644 index 000000000..aad8da3ac --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleAdapter.kt @@ -0,0 +1,31 @@ +package io.legado.app.ui.book.local.rule + +import android.content.Context +import android.view.ViewGroup +import io.legado.app.base.adapter.ItemViewHolder +import io.legado.app.base.adapter.RecyclerAdapter +import io.legado.app.data.entities.TxtTocRule +import io.legado.app.databinding.ItemTxtTocRuleBinding + +class TxtTocRuleAdapter(context: Context) : + RecyclerAdapter(context) { + + override fun getViewBinding(parent: ViewGroup): ItemTxtTocRuleBinding { + return ItemTxtTocRuleBinding.inflate(inflater, parent, false) + } + + override fun convert( + holder: ItemViewHolder, + binding: ItemTxtTocRuleBinding, + item: TxtTocRule, + payloads: MutableList + ) { + binding.cbSource.text = item.name + binding.swtEnabled.isChecked = item.enable + } + + override fun registerListener(holder: ItemViewHolder, binding: ItemTxtTocRuleBinding) { + TODO("Not yet implemented") + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleViewModel.kt b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleViewModel.kt new file mode 100644 index 000000000..204f1c59c --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/book/local/rule/TxtTocRuleViewModel.kt @@ -0,0 +1,6 @@ +package io.legado.app.ui.book.local.rule + +import android.app.Application +import io.legado.app.base.BaseViewModel + +class TxtTocRuleViewModel(app: Application) : BaseViewModel(app) \ No newline at end of file diff --git a/app/src/main/res/layout/activity_txt_toc_rule.xml b/app/src/main/res/layout/activity_txt_toc_rule.xml new file mode 100644 index 000000000..21f662944 --- /dev/null +++ b/app/src/main/res/layout/activity_txt_toc_rule.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_txt_toc_rule.xml b/app/src/main/res/layout/item_txt_toc_rule.xml new file mode 100644 index 000000000..9db02db4e --- /dev/null +++ b/app/src/main/res/layout/item_txt_toc_rule.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + \ No newline at end of file