<commit_before>package im.tny.segvault.disturbances;

import android.content.Context;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;

import im.tny.segvault.disturbances.DisturbanceFragment.OnListFragmentInteractionListener;
import im.tny.segvault.subway.Line;
import im.tny.segvault.subway.Network;

/**
 * {@link RecyclerView.Adapter} that can display a {@link DisturbanceItem} and makes a call to the
 * specified {@link OnListFragmentInteractionListener}.
 */
public class DisturbanceRecyclerViewAdapter extends RecyclerView.Adapter<DisturbanceRecyclerViewAdapter.ViewHolder> {

    private final List<DisturbanceItem> mValues;
    private final OnListFragmentInteractionListener mListener;
    private Context context;

    public DisturbanceRecyclerViewAdapter(List<DisturbanceItem> items, OnListFragmentInteractionListener listener) {
        mValues = items;
        mListener = listener;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.fragment_disturbance, parent, false);
        context = parent.getContext();
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, int position) {
        holder.mItem = mValues.get(position);
        holder.mLineNameView.setText(String.format(holder.mView.getContext().getString(R.string.frag_disturbance_line), holder.mItem.lineName));
        holder.mLineNameView.setTextColor(holder.mItem.lineColor);
        holder.mDateView.setText(DateUtils.formatDateTime(holder.mView.getContext(), holder.mItem.startTime.getTime(), DateUtils.FORMAT_SHOW_DATE));

        Drawable drawable = ContextCompat.getDrawable(holder.mView.getContext(), Util.getDrawableResourceIdForLineId(holder.mItem.lineId));<commit_msg>Fix minor graphical glitch related to date formatting<commit_after>package im.tny.segvault.disturbances;

import android.content.Context;
import android.content.Intent;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v4.content.ContextCompat;
import android.support.v7.widget.RecyclerView;
import android.text.format.DateUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
import java.util.List;

import im.tny.segvault.disturbances.DisturbanceFragment.OnListFragmentInteractionListener;
import im.tny.segvault.subway.Line;
import im.tny.segvault.subway.Network;

/**
 * {@link RecyclerView.Adapter} that can display a {@link DisturbanceItem} and makes a call to the
 * specified {@link OnListFragmentInteractionListener}.
 */
public class DisturbanceRecyclerViewAdapter extends RecyclerView.Adapter<DisturbanceRecyclerViewAdapter.ViewHolder> {

    private final List<DisturbanceItem> mValues;
    private final OnListFragmentInteractionListener mListener;
    private Context context;

    public DisturbanceRecyclerViewAdapter(List<DisturbanceItem> items, OnListFragmentInteractionListener listener) {
        mValues = items;
        mListener = listener;
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext())
                .inflate(R.layout.fragment_disturbance, parent, false);
        context = parent.getContext();
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(final ViewHolder holder, int position) {
        holder.mItem = mValues.get(position);
        holder.mLineNameView.setText(String.format(holder.mView.getContext().getString(R.string.frag_disturbance_line), holder.mItem.lineName));
        holder.mLineNameView.setTextColor(holder.mItem.lineColor);
        holder.mDateView.setText(DateUtils.formatDateTime(holder.mView.getContext(), holder.mItem.startTime.getTime(), DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_NO_YEAR));

        Drawable drawable = ContextCompat.getDrawable(holder.mView.getContext(), Util.getDrawableResourceIdForLineId(holder.mItem.lineId));
{'fraction_non_alphanumeric': 0.09351256575102279, 'fraction_numerical': 0.0007792713812585232, 'mean_word_length': 5.207980652962515, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3440129', 'n_tokens_mistral': 1469, 'n_tokens_neox': 1444, 'n_words': 275}