<commit_before>/*
 * Copyright (c) 2019 toastkidjp.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompany this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html.
 */
package jp.toastkid.yobidashi.search.trend

import androidx.core.net.toUri
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import jp.toastkid.yobidashi.databinding.ItemTrendSimpleBinding

/**
 * @author toastkidjp
 */
class ViewHolder(private val binding: ItemTrendSimpleBinding) : RecyclerView.ViewHolder(binding.root) {

    fun bind(trend: Trend) {
        binding.searchSuggestText.text = trend.title
        Glide.with(binding.image).asDrawable().load(trend.image.toUri()).into(binding.image)
        //binding.searchSuggestAdd.isVisible = false
    }

    fun setOnClick(browseCallback: (String) -> Unit) {
        binding.root.setOnClickListener {
            browseCallback(binding.searchSuggestText.text.toString())
        }
    }

    fun setOnLongClick(browseBackgroundCallback: (String) -> Unit) {
        binding.root.setOnLongClickListener {
            browseBackgroundCallback(binding.searchSuggestText.text.toString())
            true
        }
    }

}<commit_msg>refactor #412 Clean up useless function.<commit_after>/*
 * Copyright (c) 2019 toastkidjp.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompany this distribution.
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html.
 */
package jp.toastkid.yobidashi.search.trend

import androidx.core.net.toUri
import androidx.recyclerview.widget.RecyclerView
import com.bumptech.glide.Glide
import jp.toastkid.yobidashi.databinding.ItemTrendSimpleBinding

/**
 * @author toastkidjp
 */
class ViewHolder(private val binding: ItemTrendSimpleBinding) : RecyclerView.ViewHolder(binding.root) {

    fun bind(trend: Trend) {
        binding.searchSuggestText.text = trend.title
        Glide.with(binding.image).asDrawable().load(trend.image.toUri()).into(binding.image)
        //binding.searchSuggestAdd.isVisible = false
    }

}
{'fraction_non_alphanumeric': 0.10017421602787456, 'fraction_numerical': 0.008275261324041812, 'mean_word_length': 3.8256302521008405, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6202636', 'n_tokens_mistral': 719, 'n_tokens_neox': 672, 'n_words': 146}