<commit_before>package com.neeplayer.compose

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.compose.ui.platform.setContent

class ComposeSampleActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            PreviewArtistsScreen()
        }
    }
}<commit_msg>Add home screen<commit_after>package com.neeplayer.compose

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.compose.foundation.Text
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material.Button
import androidx.compose.runtime.Composable
import androidx.compose.runtime.mutableStateOf
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.setContent
import androidx.compose.ui.unit.dp

class ComposeSampleActivity : ComponentActivity() {

    enum class Screen {
        Home, Artists, Albums, NowPlaying
    }

    private val state = mutableStateOf(Screen.Home)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContent {
            when (state.value) {
                Screen.Home -> HomeScreen()
                Screen.Artists -> PreviewArtistsScreen()
                Screen.Albums -> PreviewAlbumsScreen()
                Screen.NowPlaying -> PreviewNowPlayingScreen()
            }
        }
    }

    @Composable
    private fun HomeScreen() = NeeTheme {
        Column(modifier = Modifier.fillMaxSize()) {
            Screen.Artists.button()
            Screen.Albums.button()
            Screen.NowPlaying.button()
        }
    }

    @Composable
    private fun Screen.button() {
        Button(modifier = Modifier.padding(10.dp), onClick = { state.value = this }) {
            Text(text = name, color = Color.White)
        }
    }

    override fun onBackPressed() {
        if (state.value != Screen.Home) {
            state.value = Screen.Home
        } else {
            super.onBackPressed()
        }
    }
}
{'fraction_non_alphanumeric': 0.09103199639477241, 'fraction_numerical': 0.0009013068949977468, 'mean_word_length': 2.7248322147651005, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2370698', 'n_tokens_mistral': 631, 'n_tokens_neox': 599, 'n_words': 111}