<commit_before>package org.railsschool.tiramisu.views.patterns;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import org.railsschool.tiramisu.R;
import org.railsschool.tiramisu.models.dao.DayNotificationPreference;
import org.railsschool.tiramisu.models.dao.TwoHourNotificationPreference;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * @class ReminderSeekbarLabelPattern
 * @brief
 */
public class ReminderSeekbarLabelPattern {
    private Context _context;

    @InjectView(R.id.pattern_reminder_seekbar_always)
    TextView _always;

    @InjectView(R.id.pattern_reminder_seekbar_attending)
    TextView _onlyIfAttending;

    @InjectView(R.id.pattern_reminder_seekbar_never)
    TextView _never;

    public ReminderSeekbarLabelPattern(Context context, View pattern) {
        this._context = context;
        ButterKnife.inject(this, pattern);
    }

    private void _setCurrent(int value) {
        int softGray = _context.getResources().getColor(R.color.soft_gray),
            gray = _context.getResources().getColor(R.color.gray);

        _always.setTextColor(softGray);
        _onlyIfAttending.setTextColor(softGray);
        _never.setTextColor(softGray);

        if (value == 0) {
            _always.setTextColor(gray);
        } else if (value == 2) {
            _never.setTextColor(gray);
        } else {
            _onlyIfAttending.setTextColor(gray);
        }
    }

    public void update(TwoHourNotificationPreference preference) {
        _setCurrent(preference.toInt());
    }

    public void update(DayNotificationPreference preference) {
        _setCurrent(preference.toInt());
    }
}
<commit_msg>Changes current label color<commit_after>package org.railsschool.tiramisu.views.patterns;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import org.railsschool.tiramisu.R;
import org.railsschool.tiramisu.models.dao.DayNotificationPreference;
import org.railsschool.tiramisu.models.dao.TwoHourNotificationPreference;

import butterknife.ButterKnife;
import butterknife.InjectView;

/**
 * @class ReminderSeekbarLabelPattern
 * @brief
 */
public class ReminderSeekbarLabelPattern {
    private Context _context;

    @InjectView(R.id.pattern_reminder_seekbar_always)
    TextView _always;

    @InjectView(R.id.pattern_reminder_seekbar_attending)
    TextView _onlyIfAttending;

    @InjectView(R.id.pattern_reminder_seekbar_never)
    TextView _never;

    public ReminderSeekbarLabelPattern(Context context, View pattern) {
        this._context = context;
        ButterKnife.inject(this, pattern);
    }

    private void _setCurrent(int value) {
        int softGray = _context.getResources().getColor(R.color.soft_gray),
            blue = _context.getResources().getColor(R.color.blue);

        _always.setTextColor(softGray);
        _onlyIfAttending.setTextColor(softGray);
        _never.setTextColor(softGray);

        if (value == 0) {
            _always.setTextColor(blue);
        } else if (value == 2) {
            _never.setTextColor(blue);
        } else {
            _onlyIfAttending.setTextColor(blue);
        }
    }

    public void update(TwoHourNotificationPreference preference) {
        _setCurrent(preference.toInt());
    }

    public void update(DayNotificationPreference preference) {
        _setCurrent(preference.toInt());
    }
}

{'fraction_non_alphanumeric': 0.09484777517564402, 'fraction_numerical': 0.00117096018735363, 'mean_word_length': 3.543882978723404, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4234862', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1041, 'n_words': 159}