|
|
@ -6,14 +6,18 @@ import io.legado.app.base.adapter.ItemViewHolder |
|
|
|
import io.legado.app.base.adapter.SimpleRecyclerAdapter |
|
|
|
import io.legado.app.base.adapter.SimpleRecyclerAdapter |
|
|
|
import io.legado.app.data.entities.RssSource |
|
|
|
import io.legado.app.data.entities.RssSource |
|
|
|
import io.legado.app.help.ItemTouchCallback |
|
|
|
import io.legado.app.help.ItemTouchCallback |
|
|
|
|
|
|
|
import kotlinx.android.synthetic.main.item_rss_source.view.* |
|
|
|
|
|
|
|
|
|
|
|
class RssSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
class RssSourceAdapter(context: Context, val callBack: CallBack) : |
|
|
|
SimpleRecyclerAdapter<RssSource>(context, R.layout.item_rss_source), |
|
|
|
SimpleRecyclerAdapter<RssSource>(context, R.layout.item_rss_source), |
|
|
|
ItemTouchCallback.OnItemTouchCallbackListener { |
|
|
|
ItemTouchCallback.OnItemTouchCallbackListener { |
|
|
|
|
|
|
|
|
|
|
|
override fun convert(holder: ItemViewHolder, item: RssSource, payloads: MutableList<Any>) { |
|
|
|
override fun convert(holder: ItemViewHolder, item: RssSource, payloads: MutableList<Any>) { |
|
|
|
|
|
|
|
with(holder.itemView) { |
|
|
|
|
|
|
|
cb_source.text = item.sourceName |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun onSwiped(adapterPosition: Int) { |
|
|
|
override fun onSwiped(adapterPosition: Int) { |
|
|
|