<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.media.music.popup

import android.support.v4.media.MediaBrowserCompat
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshots.SnapshotStateList
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel

/**
 * @author toastkidjp
 */
class MediaPlayerPopupViewModel : ViewModel() {

    private val _clickItem = MutableLiveData<MediaBrowserCompat.MediaItem>()

    val clickItem: LiveData<MediaBrowserCompat.MediaItem> = _clickItem

    fun clickItem(item: MediaBrowserCompat.MediaItem) {
        _clickItem.postValue(item)
    }

    private val _lyrics = MutableLiveData<String>()

    val clickLyrics: LiveData<String> = _lyrics

    fun clickLyrics(name: CharSequence?) {
        name?.also { _lyrics.postValue(it.toString()) }
    }

    private val _musics = mutableStateListOf<MediaBrowserCompat.MediaItem>()

    val musics: SnapshotStateList<MediaBrowserCompat.MediaItem> = _musics

    fun nextMusics(musics: List<MediaBrowserCompat.MediaItem>) {
        _musics.clear()
        _musics.addAll(musics)
    }

    var playing by mutableStateOf(false)

}<commit_msg>refactor #496 Delete useless fields.<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.media.music.popup

import android.support.v4.media.MediaBrowserCompat
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshots.SnapshotStateList
import androidx.lifecycle.ViewModel

/**
 * @author toastkidjp
 */
class MediaPlayerPopupViewModel : ViewModel() {

    private val _musics = mutableStateListOf<MediaBrowserCompat.MediaItem>()

    val musics: SnapshotStateList<MediaBrowserCompat.MediaItem> = _musics

    fun nextMusics(musics: List<MediaBrowserCompat.MediaItem>) {
        _musics.clear()
        _musics.addAll(musics)
    }

    var playing by mutableStateOf(false)

}
{'fraction_non_alphanumeric': 0.08568329718004339, 'fraction_numerical': 0.007592190889370932, 'mean_word_length': 4.646938775510204, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3526078', 'n_tokens_mistral': 834, 'n_tokens_neox': 793, 'n_words': 185}