<commit_before>package com.ashish.movies.ui.people.list

import android.support.v7.widget.RecyclerView
import android.view.ViewGroup
import com.ashish.movies.R
import com.ashish.movies.data.models.Person
import com.ashish.movies.ui.base.recyclerview.BaseContentHolder
import com.ashish.movies.ui.common.adapter.OnItemClickListener
import com.ashish.movies.ui.common.adapter.RemoveListener
import com.ashish.movies.ui.common.adapter.ViewType
import com.ashish.movies.ui.common.adapter.ViewTypeDelegateAdapter
import com.ashish.movies.utils.extensions.getOriginalImageUrl

/**
 * Created by Ashish on Dec 31.
 */
class PeopleDelegateAdapter(val layoutId: Int = R.layout.list_item_content,
                            var onItemClickListener: OnItemClickListener?)
    : ViewTypeDelegateAdapter, RemoveListener {

    override fun onCreateViewHolder(parent: ViewGroup) = PeopleHolder(parent)

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, item: ViewType) {
        (holder as PeopleHolder).bindData(item as Person)
    }

    override fun removeListener() {
        onItemClickListener = null
    }

    inner class PeopleHolder(parent: ViewGroup) : BaseContentHolder<Person>(parent, layoutId) {

        override fun bindData(item: Person) = with(item) {
            contentTitle.text = name<commit_msg>Hide subtitle textview in people fragment<commit_after>package com.ashish.movies.ui.people.list

import android.support.v7.widget.RecyclerView
import android.view.ViewGroup
import com.ashish.movies.R
import com.ashish.movies.data.models.Person
import com.ashish.movies.ui.base.recyclerview.BaseContentHolder
import com.ashish.movies.ui.common.adapter.OnItemClickListener
import com.ashish.movies.ui.common.adapter.RemoveListener
import com.ashish.movies.ui.common.adapter.ViewType
import com.ashish.movies.ui.common.adapter.ViewTypeDelegateAdapter
import com.ashish.movies.utils.extensions.getOriginalImageUrl
import com.ashish.movies.utils.extensions.hide

/**
 * Created by Ashish on Dec 31.
 */
class PeopleDelegateAdapter(val layoutId: Int = R.layout.list_item_content,
                            var onItemClickListener: OnItemClickListener?)
    : ViewTypeDelegateAdapter, RemoveListener {

    override fun onCreateViewHolder(parent: ViewGroup) = PeopleHolder(parent)

    override fun onBindViewHolder(holder: RecyclerView.ViewHolder, item: ViewType) {
        (holder as PeopleHolder).bindData(item as Person)
    }

    override fun removeListener() {
        onItemClickListener = null
    }

    inner class PeopleHolder(parent: ViewGroup) : BaseContentHolder<Person>(parent, layoutId) {

        override fun bindData(item: Person) = with(item) {
            contentTitle.text = name
            contentSubtitle.hide()
{'fraction_non_alphanumeric': 0.08932461873638345, 'fraction_numerical': 0.002178649237472767, 'mean_word_length': 4.207939508506616, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2564265', 'n_tokens_mistral': 801, 'n_tokens_neox': 780, 'n_words': 151}