<commit_before>package jk.ut61eTool;

import android.app.Activity;
import android.view.View;
import android.widget.TextView;

import com.jake.UT61e_decoder;

public class UI {

    TextView mDataField;
    TextView neg, ol, acdc, freqDuty;

    public UI(Activity a) {
        mDataField = a.findViewById(R.id.data_value);
        neg = a.findViewById(R.id.Neg);
        ol = a.findViewById(R.id.OL);
        acdc = a.findViewById(R.id.ACDC);
        freqDuty = a.findViewById(R.id.FreqDuty);
    }

    public void update(UT61e_decoder ut61e) {
        mDataField.setText(ut61e.toString());

        enableTextView(neg, ut61e.getValue() < 0);
        enableTextView(ol, ut61e.isOL());
        if (ut61e.isFreq() || ut61e.isDuty()) {
            enableTextView(freqDuty, true);
            enableTextView(acdc, false);
            if (ut61e.isDuty()) freqDuty.setText("Duty");
            else if (ut61e.isFreq()) freqDuty.setText("Freq.");
        } else {
            enableTextView(freqDuty, false);
            enableTextView(acdc, true);
            if (ut61e.isDC()) {
                acdc.setText("DC");
            } else if (ut61e.isAC()) {
                acdc.setText("AC");
            } else {
                enableTextView(acdc, false);
            }
        }
    }

    private void enableTextView(View v, boolean enabled) {
        if (enabled) {
            v.setAlpha(1.0f);
        } else {
            v.setAlpha(0.2f);
        }
    }
}<commit_msg>Convert UI model to kotlin<commit_after>package jk.ut61eTool

import android.app.Activity
import android.view.View
import android.widget.TextView
import com.jake.UT61e_decoder

class UI(a: Activity) {
    var mDataField: TextView
    var neg: TextView
    var ol: TextView
    var acdc: TextView
    var freqDuty: TextView


    fun update(ut61e: UT61e_decoder) {
        mDataField.text = ut61e.toString()
        enableTextView(neg, ut61e.getValue() < 0)
        enableTextView(ol, ut61e.isOL)
        if (ut61e.isFreq || ut61e.isDuty) {
            enableTextView(freqDuty, true)
            enableTextView(acdc, false)
            if (ut61e.isDuty) freqDuty.text = "Duty" else if (ut61e.isFreq) freqDuty.text = "Freq."
        } else {
            enableTextView(freqDuty, false)
            enableTextView(acdc, true)
            if (ut61e.isDC) {
                acdc.text = "DC"
            } else if (ut61e.isAC) {
                acdc.text = "AC"
            } else {
                enableTextView(acdc, false)
            }
        }
    }

    private fun enableTextView(v: View, enabled: Boolean) {
        if (enabled) {
            v.alpha = 1.0f
        } else {
            v.alpha = 0.2f
        }
    }

    init {
        mDataField = a.findViewById(R.id.data_value)
        neg = a.findViewById(R.id.Neg)
        ol = a.findViewById(R.id.OL)
        acdc = a.findViewById(R.id.ACDC)
        freqDuty = a.findViewById(R.id.FreqDuty)
    }
}
{'fraction_non_alphanumeric': 0.1190719890822245, 'fraction_numerical': 0.021153190037529853, 'mean_word_length': 1.880157170923379, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '923366', 'n_tokens_mistral': 1036, 'n_tokens_neox': 970, 'n_words': 182}