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()));
}
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("");
}
}
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());
}
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());
}
Aggregations