Esempio n. 1
0
 /**
  * @param level {@link Level} The level to filter the log entries.
  * @return all log entries for that level and above.
  */
 public List<LogEntry> filter(Level level) {
   List<LogEntry> toReturn = new ArrayList<LogEntry>();
   for (LogEntry entry : entries) {
     if (entry.getLevel().intValue() >= level.intValue()) {
       toReturn.add(entry);
     }
   }
   return toReturn;
 }
  @Override
  public View getView(int position, View convertView, ViewGroup parent) {
    LogEntry entry = entries.get(position);
    TextView tv;
    if (convertView == null) {
      LayoutInflater inflater = mActivity.getLayoutInflater();
      tv = (TextView) inflater.inflate(R.layout.logcat_entry, null);
    } else {
      tv = (TextView) convertView;
    }

    tv.setText(entry.getText());
    tv.setTextColor(entry.getLevel().getColor());
    tv.setTextSize(TypedValue.COMPLEX_UNIT_DIP, 10);

    return tv;
  }