Search in sources :

Example 1 with MeetingStats

use of net.johnpwood.android.standuptimer.model.MeetingStats in project standup-timer by jwood.

the class MeetingDetails method displayMeetingStats.

private void displayMeetingStats(Team team, Date date) {
    MeetingStats stats = meeting.getMeetingStats();
    ((TextView) findViewById(R.id.meeting_details_team_name)).setText(team.getName());
    ((TextView) findViewById(R.id.meeting_time)).setText(meeting.getDescription());
    ((TextView) findViewById(R.id.number_of_participants_label)).setText(getString(R.string.number_of_participants));
    ((TextView) findViewById(R.id.number_of_participants)).setText(Integer.toString((int) stats.getNumParticipants()));
    ((TextView) findViewById(R.id.meeting_length_label)).setText(getString(R.string.meeting_length));
    ((TextView) findViewById(R.id.meeting_length)).setText(TimeFormatHelper.formatTime(stats.getMeetingLength()));
    ((TextView) findViewById(R.id.individual_status_length_label)).setText(getString(R.string.individual_status_length));
    ((TextView) findViewById(R.id.individual_status_length)).setText(TimeFormatHelper.formatTime(stats.getIndividualStatusLength()));
    ((TextView) findViewById(R.id.quickest_status_label)).setText(getString(R.string.quickest_status));
    ((TextView) findViewById(R.id.quickest_status)).setText(TimeFormatHelper.formatTime(stats.getQuickestStatus()));
    ((TextView) findViewById(R.id.longest_status_label)).setText(getString(R.string.longest_status));
    ((TextView) findViewById(R.id.longest_status)).setText(TimeFormatHelper.formatTime(stats.getLongestStatus()));
}
Also used : TextView(android.widget.TextView) MeetingStats(net.johnpwood.android.standuptimer.model.MeetingStats)

Example 2 with MeetingStats

use of net.johnpwood.android.standuptimer.model.MeetingStats in project standup-timer by jwood.

the class TeamDetails method setStatsTabContent.

private void setStatsTabContent() {
    if (team != null && team.hasMeetings(this)) {
        MeetingStats stats = team.getAverageMeetingStats(TeamDetails.this);
        ((TextView) findViewById(R.id.meeting_team_name_label)).setText(getString(R.string.team_name));
        ((TextView) findViewById(R.id.meeting_team_name)).setText(team.getName());
        ((TextView) findViewById(R.id.number_of_meetings_label)).setText(getString(R.string.number_of_meetings));
        ((TextView) findViewById(R.id.number_of_meetings)).setText(Integer.toString((int) team.getNumberOfMeetings(TeamDetails.this)));
        ((TextView) findViewById(R.id.avg_number_of_participants_label)).setText(getString(R.string.avg_number_of_participants));
        ((TextView) findViewById(R.id.avg_number_of_participants)).setText(Float.toString(stats.getNumParticipants()));
        ((TextView) findViewById(R.id.avg_meeting_length_label)).setText(getString(R.string.avg_meeting_length));
        ((TextView) findViewById(R.id.avg_meeting_length)).setText(TimeFormatHelper.formatTime(stats.getMeetingLength()));
        ((TextView) findViewById(R.id.avg_individual_status_length_label)).setText(getString(R.string.avg_individual_status_length));
        ((TextView) findViewById(R.id.avg_individual_status_length)).setText(TimeFormatHelper.formatTime(stats.getIndividualStatusLength()));
        ((TextView) findViewById(R.id.avg_quickest_status_label)).setText(getString(R.string.avg_quickest_status));
        ((TextView) findViewById(R.id.avg_quickest_status)).setText(TimeFormatHelper.formatTime(stats.getQuickestStatus()));
        ((TextView) findViewById(R.id.avg_longest_status_label)).setText(getString(R.string.avg_longest_status));
        ((TextView) findViewById(R.id.avg_longest_status)).setText(TimeFormatHelper.formatTime(stats.getLongestStatus()));
    } else {
        ((TextView) findViewById(R.id.meeting_team_name_label)).setText(getString(R.string.no_meeting_stats));
        ((TextView) findViewById(R.id.meeting_team_name)).setText("");
        ((TextView) findViewById(R.id.number_of_meetings_label)).setText("");
        ((TextView) findViewById(R.id.number_of_meetings)).setText("");
        ((TextView) findViewById(R.id.avg_number_of_participants_label)).setText("");
        ((TextView) findViewById(R.id.avg_number_of_participants)).setText("");
        ((TextView) findViewById(R.id.avg_meeting_length_label)).setText("");
        ((TextView) findViewById(R.id.avg_meeting_length)).setText("");
        ((TextView) findViewById(R.id.avg_individual_status_length_label)).setText("");
        ((TextView) findViewById(R.id.avg_individual_status_length)).setText("");
        ((TextView) findViewById(R.id.avg_quickest_status_label)).setText("");
        ((TextView) findViewById(R.id.avg_quickest_status)).setText("");
        ((TextView) findViewById(R.id.avg_longest_status_label)).setText("");
        ((TextView) findViewById(R.id.avg_longest_status)).setText("");
    }
}
Also used : TextView(android.widget.TextView) MeetingStats(net.johnpwood.android.standuptimer.model.MeetingStats)

Example 3 with MeetingStats

use of net.johnpwood.android.standuptimer.model.MeetingStats in project standup-timer by jwood.

the class MeetingStatsTest method test_average_stats.

public void test_average_stats() {
    List<MeetingStats> meetingStats = new ArrayList<MeetingStats>();
    meetingStats.add(new MeetingStats(5, 301, 343, 30, 65));
    meetingStats.add(new MeetingStats(8, 534, 550, 32, 120));
    meetingStats.add(new MeetingStats(2, 234, 300, 23, 122));
    meetingStats.add(new MeetingStats(3, 765, 765, 15, 78));
    meetingStats.add(new MeetingStats(9, 444, 445, 10, 93));
    MeetingStats averageStats = MeetingStats.getAverageStats(meetingStats);
    assertEquals(5.4f, averageStats.getNumParticipants());
    assertEquals(455.6f, averageStats.getIndividualStatusLength());
    assertEquals(480.6f, averageStats.getMeetingLength());
    assertEquals(22f, averageStats.getQuickestStatus());
    assertEquals(95.6f, averageStats.getLongestStatus());
}
Also used : ArrayList(java.util.ArrayList) MeetingStats(net.johnpwood.android.standuptimer.model.MeetingStats)

Example 4 with MeetingStats

use of net.johnpwood.android.standuptimer.model.MeetingStats in project standup-timer by jwood.

the class TeamTest method test_get_average_meeting_stats.

@MediumTest
public void test_get_average_meeting_stats() {
    Team team = Team.create("Test Team", mContext);
    Date dateTime = new GregorianCalendar(2010, 1, 5, 10, 15, 0).getTime();
    new Meeting(team, dateTime, 5, 301, 343, 30, 65).save(mContext);
    new Meeting(team, dateTime, 8, 534, 550, 32, 120).save(mContext);
    new Meeting(team, dateTime, 2, 234, 300, 23, 122).save(mContext);
    new Meeting(team, dateTime, 3, 765, 765, 15, 78).save(mContext);
    new Meeting(team, dateTime, 9, 444, 445, 10, 93).save(mContext);
    MeetingStats averageStats = team.getAverageMeetingStats(mContext);
    assertEquals(5.4f, averageStats.getNumParticipants());
    assertEquals(455.6f, averageStats.getIndividualStatusLength());
    assertEquals(480.6f, averageStats.getMeetingLength());
    assertEquals(22f, averageStats.getQuickestStatus());
    assertEquals(95.6f, averageStats.getLongestStatus());
}
Also used : Meeting(net.johnpwood.android.standuptimer.model.Meeting) GregorianCalendar(java.util.GregorianCalendar) Team(net.johnpwood.android.standuptimer.model.Team) MeetingStats(net.johnpwood.android.standuptimer.model.MeetingStats) Date(java.util.Date) MediumTest(android.test.suitebuilder.annotation.MediumTest)

Aggregations

MeetingStats (net.johnpwood.android.standuptimer.model.MeetingStats)4 TextView (android.widget.TextView)2 MediumTest (android.test.suitebuilder.annotation.MediumTest)1 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 GregorianCalendar (java.util.GregorianCalendar)1 Meeting (net.johnpwood.android.standuptimer.model.Meeting)1 Team (net.johnpwood.android.standuptimer.model.Team)1