private void updateMissionLog(final MediaInfo mediaInfo) { if (!TextUtils.isEmpty(mediaInfo.toString())) { boolean bLogColors = preferences.getBoolean("logColorsPreference", true); StringBuilder timeText = new StringBuilder(); StringBuilder actionText = new StringBuilder(); // Display log in colors (if preference is set to true) // Note: Some parts are now bold, regardless of the color settings // (Time, Unconfirmed, Serious - like the printed cards) if ((mediaInfo.getTimeColor() == null) || (bLogColors == false)) { timeText.append("<b>" + stopWatch.toString() + "</b>"); } else { timeText.append( "<b><font color=\"" + mediaInfo.getTimeColor() + "\">" + StopWatch.formatTime(mediaInfo.getStartTimeNanos()) + "</b></font>"); } if ((mediaInfo.getTimeColor() == null) || (bLogColors == false)) { actionText.append(mediaInfo.toString()); } else { actionText.append( "<font color=\"" + mediaInfo.getTextColor() + "\">" + mediaInfo.toString() + "</font>"); } missionLog.add( new MissionLog(Html.fromHtml(actionText.toString()), Html.fromHtml(timeText.toString()))); missionActivity.updateMissionLog(missionLog.size() - 1); } }
/* * Prints the mission introduction to the log. */ public void printMissionIntroduction(String missionIntroduction) { missionLog.add(new MissionLog(Html.fromHtml("<b><i> " + missionIntroduction + "</i></b>"))); missionActivity.updateMissionLog(missionLog.size() - 1); }