<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.settings.color

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.ListAdapter
import jp.toastkid.lib.ContentViewModel
import jp.toastkid.lib.view.list.CommonItemCallback
import jp.toastkid.yobidashi.R
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

/**
 * @author toastkidjp
 */
internal class SavedColorAdapter(
        private val layoutInflater: LayoutInflater,
        private val repository: SavedColorRepository,
        private val contentViewModel: ContentViewModel,
        private val commitNewColor: (Int, Int) -> Unit
) : ListAdapter<SavedColor, SavedColorHolder>(
    CommonItemCallback.with<SavedColor>({ a, b -> a.id == b.id }, { a, b -> a == b })
) {

    private val items = mutableListOf<SavedColor>()

    override fun onCreateViewHolder(
            parent: ViewGroup,
            viewType: Int
    ): SavedColorHolder {
        return SavedColorHolder(layoutInflater.inflate(R.layout.item_saved_color, parent, false))
    }
<commit_msg>refactor #827 Delete useless field.<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.settings.color

import android.view.LayoutInflater
import android.view.ViewGroup
import androidx.recyclerview.widget.ListAdapter
import jp.toastkid.lib.ContentViewModel
import jp.toastkid.lib.view.list.CommonItemCallback
import jp.toastkid.yobidashi.R
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

/**
 * @author toastkidjp
 */
internal class SavedColorAdapter(
        private val layoutInflater: LayoutInflater,
        private val repository: SavedColorRepository,
        private val contentViewModel: ContentViewModel,
        private val commitNewColor: (Int, Int) -> Unit
) : ListAdapter<SavedColor, SavedColorHolder>(
    CommonItemCallback.with<SavedColor>({ a, b -> a.id == b.id }, { a, b -> a == b })
) {

    override fun onCreateViewHolder(
            parent: ViewGroup,
            viewType: Int
    ): SavedColorHolder {
        return SavedColorHolder(layoutInflater.inflate(R.layout.item_saved_color, parent, false))
    }

{'fraction_non_alphanumeric': 0.0886512590548465, 'fraction_numerical': 0.006553984132459468, 'mean_word_length': 4.087719298245614, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 14, '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': '6722742', 'n_tokens_mistral': 903, 'n_tokens_neox': 846, 'n_words': 220}