<commit_before>package com.ternaryop.phototumblrshare.activity;

import java.text.DateFormatSymbols;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.ternaryop.phototumblrshare.R;
import com.ternaryop.phototumblrshare.db.Birthday;
import com.ternaryop.phototumblrshare.db.BirthdayDAO;
import com.ternaryop.phototumblrshare.db.DBHelper;

public class BirthdaysActivity extends PhotoTumblrActivity implements ActionBar.OnNavigationListener {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_birthdays_main);

		setupActionBar();
		
		BirthdayDAO birthdayDatabaseHelper = DBHelper
				.getInstance(this)
				.getBirthdayDAO();
		List<Birthday> list = birthdayDatabaseHelper.getBirthdayByDate(new Date());
		fillList(list);
	}

	private void fillList(List<Birthday> list) {
		StringBuilder sb = new StringBuilder();
		for (Birthday birthday : list) {
			sb.append(birthday + "\n");
		}
		TextView textView = (TextView)findViewById(R.id.text);
        textView.setText(sb);
        // allow textView to scroll
		textView.setMovementMethod(new ScrollingMovementMethod());
	}

	private void setupActionBar() {
		ActionBar actionBar = getActionBar();
		ArrayAdapter<String> monthAdapter = new ArrayAdapter<String>(<commit_msg>highlight the birthdays of the current day<commit_after>package com.ternaryop.phototumblrshare.activity;

import java.text.DateFormatSymbols;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import android.app.ActionBar;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.text.Html;
import android.text.method.ScrollingMovementMethod;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.ternaryop.phototumblrshare.R;
import com.ternaryop.phototumblrshare.db.Birthday;
import com.ternaryop.phototumblrshare.db.BirthdayDAO;
import com.ternaryop.phototumblrshare.db.DBHelper;

public class BirthdaysActivity extends PhotoTumblrActivity implements ActionBar.OnNavigationListener {
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_birthdays_main);

		setupActionBar();
		
		BirthdayDAO birthdayDatabaseHelper = DBHelper
				.getInstance(this)
				.getBirthdayDAO();
		List<Birthday> list = birthdayDatabaseHelper.getBirthdayByDate(new Date());
		fillList(list);
	}

	private void fillList(List<Birthday> list) {
		StringBuilder sb = new StringBuilder();
		Calendar now = Calendar.getInstance();
		int dayOfMonth = now.get(Calendar.DAY_OF_MONTH);
		int month = now.get(Calendar.MONTH);
        Calendar date = Calendar.getInstance();

        for (Birthday birthday : list) {
		    date.setTime(birthday.getBirthDate());
		
		    if (date.get(Calendar.DAY_OF_MONTH) == dayOfMonth
		            && date.get(Calendar.MONTH) == month) {
		        sb.append("<b>" + birthday + "</b>");
		    } else {
	            sb.append(birthday);
		    }
		    sb.append("<br/>");
		}
		TextView textView = (TextView)findViewById(R.id.text);
        textView.setText(Html.fromHtml(sb.toString()));
        // allow textView to scroll
		textView.setMovementMethod(new ScrollingMovementMethod());
	}

	private void setupActionBar() {
		ActionBar actionBar = getActionBar();
		ArrayAdapter<String> monthAdapter = new ArrayAdapter<String>(
{'fraction_non_alphanumeric': 0.10520577814118288, 'fraction_numerical': 0.0, 'mean_word_length': 5.016393442622951, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '17497', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1102, 'n_words': 209}