parent
c819890a43
commit
7811e49867
@ -0,0 +1,32 @@ |
||||
package io.legado.app.ui.rss.subscription |
||||
|
||||
import android.content.Context |
||||
import android.view.ViewGroup |
||||
import io.legado.app.base.adapter.ItemViewHolder |
||||
import io.legado.app.base.adapter.SimpleRecyclerAdapter |
||||
import io.legado.app.data.entities.SourceSub |
||||
import io.legado.app.databinding.ItemSourceSubBinding |
||||
|
||||
class SourceSubAdapter(context: Context) : |
||||
SimpleRecyclerAdapter<SourceSub, ItemSourceSubBinding>(context) { |
||||
|
||||
|
||||
override fun convert( |
||||
holder: ItemViewHolder, |
||||
binding: ItemSourceSubBinding, |
||||
item: SourceSub, |
||||
payloads: MutableList<Any> |
||||
) { |
||||
binding.tvName.text = item.name |
||||
binding.tvUrl.text = item.url |
||||
} |
||||
|
||||
override fun registerListener(holder: ItemViewHolder, binding: ItemSourceSubBinding) { |
||||
|
||||
} |
||||
|
||||
override fun getViewBinding(parent: ViewGroup): ItemSourceSubBinding { |
||||
return ItemSourceSubBinding.inflate(inflater, parent, false) |
||||
} |
||||
|
||||
} |
@ -0,0 +1,57 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||
xmlns:tools="http://schemas.android.com/tools" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:padding="16dp"> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_name" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:textSize="16sp" |
||||
android:textColor="@color/primaryText" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
app:layout_constraintLeft_toLeftOf="parent" |
||||
tools:text="name" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/tv_url" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:textSize="12sp" |
||||
android:textColor="@color/secondaryText" |
||||
app:layout_constraintTop_toBottomOf="@+id/tv_name" |
||||
app:layout_constraintLeft_toLeftOf="parent" |
||||
tools:text="url" /> |
||||
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView |
||||
android:id="@+id/iv_edit" |
||||
android:layout_width="36dp" |
||||
android:layout_height="36dp" |
||||
android:layout_gravity="center" |
||||
android:background="?attr/selectableItemBackgroundBorderless" |
||||
android:contentDescription="@string/edit" |
||||
android:padding="6dp" |
||||
android:src="@drawable/ic_edit" |
||||
android:tint="@color/primaryText" |
||||
app:layout_constraintRight_toLeftOf="@id/iv_menu_more" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
app:layout_constraintBottom_toBottomOf="parent" /> |
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView |
||||
android:id="@+id/iv_menu_more" |
||||
android:layout_width="36dp" |
||||
android:layout_height="36dp" |
||||
android:background="?attr/selectableItemBackgroundBorderless" |
||||
android:padding="6dp" |
||||
android:src="@drawable/ic_more_vert" |
||||
android:tint="@color/primaryText" |
||||
app:layout_constraintRight_toRightOf="parent" |
||||
app:layout_constraintTop_toTopOf="parent" |
||||
app:layout_constraintBottom_toBottomOf="parent" |
||||
tools:ignore="RtlHardcoded" /> |
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout> |
Loading…
Reference in new issue