diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/SourcePickerDialog.kt b/app/src/main/java/io/legado/app/ui/book/arrange/SourcePickerDialog.kt index 02c4c9897..50101e9a6 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/SourcePickerDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/SourcePickerDialog.kt @@ -14,7 +14,7 @@ import io.legado.app.base.adapter.RecyclerAdapter import io.legado.app.data.appDb import io.legado.app.data.entities.BookSource import io.legado.app.databinding.DialogSourcePickerBinding -import io.legado.app.databinding.Item1lineTextAndDelBinding +import io.legado.app.databinding.Item1lineTextBinding import io.legado.app.lib.theme.primaryColor import io.legado.app.lib.theme.primaryTextColor import io.legado.app.utils.applyTint @@ -81,24 +81,24 @@ class SourcePickerDialog : BaseDialogFragment(R.layout.dialog_source_picker) { } inner class SourceAdapter(context: Context) : - RecyclerAdapter(context) { + RecyclerAdapter(context) { - override fun getViewBinding(parent: ViewGroup): Item1lineTextAndDelBinding { - return Item1lineTextAndDelBinding.inflate(inflater, parent, false).apply { + override fun getViewBinding(parent: ViewGroup): Item1lineTextBinding { + return Item1lineTextBinding.inflate(inflater, parent, false).apply { root.setPadding(16.dpToPx()) } } override fun convert( holder: ItemViewHolder, - binding: Item1lineTextAndDelBinding, + binding: Item1lineTextBinding, item: BookSource, payloads: MutableList ) { binding.textView.text = item.getDisPlayNameGroup() } - override fun registerListener(holder: ItemViewHolder, binding: Item1lineTextAndDelBinding) { + override fun registerListener(holder: ItemViewHolder, binding: Item1lineTextBinding) { binding.root.onClick { getItemByLayoutPosition(holder.layoutPosition)?.let { callback?.sourceOnClick(it) diff --git a/app/src/main/res/layout/item_1line_text.xml b/app/src/main/res/layout/item_1line_text.xml new file mode 100644 index 000000000..b2af0e293 --- /dev/null +++ b/app/src/main/res/layout/item_1line_text.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_1line_text_and_del.xml b/app/src/main/res/layout/item_1line_text_and_del.xml index ae73faa7b..b65a0b09b 100644 --- a/app/src/main/res/layout/item_1line_text_and_del.xml +++ b/app/src/main/res/layout/item_1line_text_and_del.xml @@ -6,7 +6,6 @@ android:layout_height="wrap_content" android:gravity="center_vertical" android:orientation="horizontal" - android:background="?attr/selectableItemBackground" android:padding="6dp" tools:ignore="UseCompoundDrawables"> @@ -15,6 +14,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" + android:background="?attr/selectableItemBackground" android:singleLine="true" android:textColor="@color/primaryText" />