<commit_before>package fi.bitrite.android.ws.activity;

import android.content.Context;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import fi.bitrite.android.ws.R;
import fi.bitrite.android.ws.model.HostBriefInfo;

import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class HostListAdapter extends ArrayAdapter<HostBriefInfo> {

    private int mResource;
    private Context mContext;
    private String mQuery;

    public HostListAdapter(Context context, int resource, String query, List<HostBriefInfo> hosts) {
        super(context, resource, hosts);
        mContext = context;
        mQuery = query;
        mResource = resource;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LinearLayout hostListItem = inflateView(convertView);

        HostBriefInfo host = getItem(position);

        TextView fullname = (TextView) hostListItem.findViewById(R.id.txtHostFullname);
        TextView location = (TextView) hostListItem.findViewById(R.id.txtHostLocation);
        ImageView icon = (ImageView) hostListItem.findViewById(R.id.icon);
        TextView memberInfo = (TextView) hostListItem.findViewById(R.id.txtMemberInfo);

        String hostFullname = host.getFullname();
        if (mQuery != null) {
            if (host.getCity().contains(mQuery)) {
                location.setTextColor(0xffffff);
                location.setTypeface(null, Typeface.BOLD);
            } else {
                // fullname.setTypeface(null, Typeface.BOLD);
            }
        }
        if (host.getNotCurrentlyAvailable()) {
            icon.setImageResource(R.drawable.ic_home_variant_grey600_24dp);<commit_msg>Emphasize location if it's a match<commit_after>package fi.bitrite.android.ws.activity;

import android.content.Context;
import android.graphics.Color;
import android.graphics.Typeface;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import fi.bitrite.android.ws.R;
import fi.bitrite.android.ws.model.HostBriefInfo;

import java.lang.reflect.Type;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

public class HostListAdapter extends ArrayAdapter<HostBriefInfo> {

    private int mResource;
    private Context mContext;
    private String mQuery;

    public HostListAdapter(Context context, int resource, String query, List<HostBriefInfo> hosts) {
        super(context, resource, hosts);
        mContext = context;
        mQuery = query.toLowerCase();
        mResource = resource;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        LinearLayout hostListItem = inflateView(convertView);

        HostBriefInfo host = getItem(position);

        TextView fullname = (TextView) hostListItem.findViewById(R.id.txtHostFullname);
        TextView location = (TextView) hostListItem.findViewById(R.id.txtHostLocation);
        ImageView icon = (ImageView) hostListItem.findViewById(R.id.icon);
        TextView memberInfo = (TextView) hostListItem.findViewById(R.id.txtMemberInfo);

        String hostFullname = host.getFullname();

        // Emphasize the location if it's a match on the search
        if (mQuery != null) {
            if (host.getCity().toLowerCase().contains(mQuery)) {
                location.setTextColor(Color.BLACK);
                // location.setTypeface(null, Typeface.BOLD);
            } else {
                 location.setTextColor(Color.GRAY);
                // fullname.setTypeface(null, Typeface.BOLD);
            }
        }

        // Set the host icon to black if they're available, otherwise gray
        if (host.getNotCurrentlyAvailable()) {
            icon.setImageResource(R.drawable.ic_home_variant_grey600_24dp);
{'fraction_non_alphanumeric': 0.0958323522486461, 'fraction_numerical': 0.0025900635742877325, 'mean_word_length': 3.330275229357798, 'pattern_counts': {'":': 0, '<': 7, '<?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': '1213758', 'n_tokens_mistral': 1216, 'n_tokens_neox': 1156, 'n_words': 256}