Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinTCoughlin committed Nov 29, 2024
1 parent 9fad704 commit b682458
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ import java.util.Locale
*/
class EpisodeView : BinderRecyclerAdapter.ItemBinder<Item, EpisodeViewHolder> {

override fun bind(model: Item, viewHolder: EpisodeViewHolder) = with(viewHolder) {
mTitle.text = model.title
mDescription.text = HtmlCompat.fromHtml(model.summary.orEmpty(), HtmlCompat.FROM_HTML_MODE_LEGACY)
mMetadata.text = mMetadata.context.getString(
override fun bind(model: Item, viewHolder: EpisodeViewHolder) = with(viewHolder.binding) {
title.text = model.title
description.text = HtmlCompat.fromHtml(model.summary.orEmpty(), HtmlCompat.FROM_HTML_MODE_LEGACY)
metadata.text = metadata.context.getString(
R.string.metadata,
formatDate(model.pubDate),
model.duration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ import androidx.recyclerview.widget.RecyclerView
import com.kevintcoughlin.smodr.databinding.ItemListEpisodeLayoutBinding

class EpisodeViewHolder(
binding: ItemListEpisodeLayoutBinding
) : RecyclerView.ViewHolder(binding.root) {
val mTitle = binding.title
val mDescription = binding.description
val mMetadata = binding.metadata
}
val binding: ItemListEpisodeLayoutBinding
) : RecyclerView.ViewHolder(binding.root)

0 comments on commit b682458

Please sign in to comment.