<commit_before>package be.ugent.zeus.hydra;

import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.util.Log;
import android.widget.TextView;
import be.ugent.zeus.hydra.data.NewsItem;
import com.google.analytics.tracking.android.EasyTracker;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 *
 * @author blackskad
 */
public class NewsItemActivity extends AbstractSherlockActivity {

    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        setTitle(R.string.title_news);
        setContentView(R.layout.news_item);

        NewsItem item = (NewsItem) getIntent().getSerializableExtra("item");

        EasyTracker.getTracker().sendView("News > " + item.title);

        TextView title = (TextView) findViewById(R.id.news_item_title);
        title.setText(item.title);

        String postedBy = getResources().getString(R.string.posted_by);
        TextView association = (TextView) findViewById(R.id.news_item_info);
        try {
            association.setText(String.format(postedBy, Html.fromHtml(item.association.display_name),
                new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Hydra.LOCALE).parse(item.date)));
        } catch (ParseException ex) {
            Log.w("Parse error", "");
            ex.printStackTrace();
        }

        TextView content = (TextView) findViewById(R.id.news_item_content);
        content.setText(Html.fromHtml(item.content.replace("\n", "<br>")));
        content.setMovementMethod(LinkMovementMethod.getInstance());
        Linkify.addLinks(content, Linkify.ALL);<commit_msg>Followed the associations display guide (closes #76)<commit_after>package be.ugent.zeus.hydra;

import android.os.Bundle;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.text.util.Linkify;
import android.util.Log;
import android.widget.TextView;
import be.ugent.zeus.hydra.data.NewsItem;
import com.google.analytics.tracking.android.EasyTracker;
import java.text.ParseException;
import java.text.SimpleDateFormat;

/**
 *
 * @author blackskad
 */
public class NewsItemActivity extends AbstractSherlockActivity {

    /**
     * Called when the activity is first created.
     */
    @Override
    public void onCreate(Bundle icicle) {
        super.onCreate(icicle);

        setTitle(R.string.title_news);
        setContentView(R.layout.news_item);

        NewsItem item = (NewsItem) getIntent().getSerializableExtra("item");

        EasyTracker.getTracker().sendView("News > " + item.title);

        TextView title = (TextView) findViewById(R.id.news_item_title);
        title.setText(item.title);

        String postedBy = getResources().getString(R.string.posted_by);
        TextView association = (TextView) findViewById(R.id.news_item_info);
        try {
            String poster = item.association.display_name;
            if (item.association.full_name != null) {
                poster += " (" + item.association.full_name + ")";
            }
            association.setText(String.format(postedBy, Html.fromHtml(poster),
                new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ", Hydra.LOCALE).parse(item.date)));

        } catch (ParseException ex) {
            Log.w("Parse error", "");
            ex.printStackTrace();
        }

        TextView content = (TextView) findViewById(R.id.news_item_content);
        content.setText(Html.fromHtml(item.content.replace("\n", "<br>")));
        content.setMovementMethod(LinkMovementMethod.getInstance());
        Linkify.addLinks(content, Linkify.ALL);
{'fraction_non_alphanumeric': 0.12557016367051246, 'fraction_numerical': 0.0005366246310705661, 'mean_word_length': 3.2752293577981653, 'pattern_counts': {'":': 0, '<': 5, '<?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': '5931561', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1066, 'n_words': 179}