pull/1395/head
gedoor 3 years ago
parent 01b6216978
commit c73c692aa2
  1. 6
      app/src/main/java/io/legado/app/ui/book/source/edit/BookSourceEditAdapter.kt
  2. 6
      app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditAdapter.kt
  3. 3
      app/src/main/res/layout/item_source_edit.xml

@ -9,6 +9,9 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import io.legado.app.R import io.legado.app.R
import io.legado.app.databinding.ItemSourceEditBinding import io.legado.app.databinding.ItemSourceEditBinding
import io.legado.app.utils.addJsPattern
import io.legado.app.utils.addJsonPattern
import io.legado.app.utils.addLegadoPattern
class BookSourceEditAdapter : RecyclerView.Adapter<BookSourceEditAdapter.MyViewHolder>() { class BookSourceEditAdapter : RecyclerView.Adapter<BookSourceEditAdapter.MyViewHolder>() {
@ -22,6 +25,9 @@ class BookSourceEditAdapter : RecyclerView.Adapter<BookSourceEditAdapter.MyViewH
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
val binding = ItemSourceEditBinding val binding = ItemSourceEditBinding
.inflate(LayoutInflater.from(parent.context), parent, false) .inflate(LayoutInflater.from(parent.context), parent, false)
binding.editText.addLegadoPattern()
binding.editText.addJsonPattern()
binding.editText.addJsPattern()
return MyViewHolder(binding) return MyViewHolder(binding)
} }

@ -9,6 +9,9 @@ import android.view.ViewGroup
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import io.legado.app.R import io.legado.app.R
import io.legado.app.databinding.ItemSourceEditBinding import io.legado.app.databinding.ItemSourceEditBinding
import io.legado.app.utils.addJsPattern
import io.legado.app.utils.addJsonPattern
import io.legado.app.utils.addLegadoPattern
class RssSourceEditAdapter : RecyclerView.Adapter<RssSourceEditAdapter.MyViewHolder>() { class RssSourceEditAdapter : RecyclerView.Adapter<RssSourceEditAdapter.MyViewHolder>() {
@ -22,6 +25,9 @@ class RssSourceEditAdapter : RecyclerView.Adapter<RssSourceEditAdapter.MyViewHol
override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder { override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
val binding = ItemSourceEditBinding val binding = ItemSourceEditBinding
.inflate(LayoutInflater.from(parent.context), parent, false) .inflate(LayoutInflater.from(parent.context), parent, false)
binding.editText.addLegadoPattern()
binding.editText.addJsonPattern()
binding.editText.addJsPattern()
return MyViewHolder(binding) return MyViewHolder(binding)
} }

@ -5,8 +5,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingTop="3dp"> android:paddingTop="3dp">
<io.legado.app.ui.widget.text.EditText <com.amrdeveloper.codeview.CodeView
android:id="@+id/editText" android:id="@+id/editText"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
</io.legado.app.ui.widget.text.TextInputLayout> </io.legado.app.ui.widget.text.TextInputLayout>
Loading…
Cancel
Save