<commit_before>package io.particle.mesh.setup.ui


import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import android.widget.VideoView
import androidx.annotation.RawRes
import androidx.annotation.StringRes
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.navigation.fragment.findNavController
import com.squareup.phrase.Phrase
import io.particle.common.buildRawResourceUri
import io.particle.mesh.setup.flow.MeshDeviceType
import io.particle.sdk.app.R
import kotlinx.android.synthetic.main.fragment_get_ready_for_setup.*


class GetReadyForSetupFragment : BaseMeshSetupFragment() {

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_get_ready_for_setup, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        action_next.setOnClickListener { onNext() }

        p_getreadyforsetup_use_ethernet_switch.setOnCheckedChangeListener { _, _ ->
            setContentFromDeviceModel()
        }

        setContentFromDeviceModel()

        setUpVideoView(videoView)
    }

    private fun setContentFromDeviceModel() {
        if (p_getreadyforsetup_use_ethernet_switch.isChecked) {
            onConfigChanged(HelpTextConfig.FEATHERWING)
            return
        }

        val config = when (flowManagerVM.flowManager!!.targetDeviceType) {
            MeshDeviceType.ARGON -> HelpTextConfig.ARGON<commit_msg>Stop pausing music when showing videos<commit_after>package io.particle.mesh.setup.ui


import android.media.AudioManager
import android.os.Build
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.TextView
import android.widget.VideoView
import androidx.annotation.RawRes
import androidx.annotation.StringRes
import androidx.lifecycle.DefaultLifecycleObserver
import androidx.lifecycle.LifecycleOwner
import androidx.navigation.fragment.findNavController
import com.squareup.phrase.Phrase
import io.particle.common.buildRawResourceUri
import io.particle.mesh.setup.flow.MeshDeviceType
import io.particle.sdk.app.R
import kotlinx.android.synthetic.main.fragment_get_ready_for_setup.*


class GetReadyForSetupFragment : BaseMeshSetupFragment() {

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        return inflater.inflate(R.layout.fragment_get_ready_for_setup, container, false)
    }

    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)

        action_next.setOnClickListener { onNext() }

        p_getreadyforsetup_use_ethernet_switch.setOnCheckedChangeListener { _, _ ->
            setContentFromDeviceModel()
        }

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
            // stop pausing the user's music when showing the video!
            videoView.setAudioFocusRequest(AudioManager.AUDIOFOCUS_NONE)
        }
        setContentFromDeviceModel()

        setUpVideoView(videoView)
    }

    private fun setContentFromDeviceModel() {
        if (p_getreadyforsetup_use_ethernet_switch.isChecked) {
            onConfigChanged(HelpTextConfig.FEATHERWING)
            return
        }

        val config = when (flowManagerVM.flowManager!!.targetDeviceType) {
            MeshDeviceType.ARGON -> HelpTextConfig.ARGON
{'fraction_non_alphanumeric': 0.07445373617480443, 'fraction_numerical': 0.0, 'mean_word_length': 3.9112582781456955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1374489', 'n_tokens_mistral': 1059, 'n_tokens_neox': 1005, 'n_words': 177}