| 58 | private DateFormat TF; |
| 59 | |
| 60 | public class ViewHolder extends RecyclerView.ViewHolder { |
| 61 | private TextView tvTime; |
| 62 | private TextView tvData; |
| 63 | |
| 64 | ViewHolder(View itemView) { |
| 65 | super(itemView); |
| 66 | |
| 67 | tvTime = itemView.findViewById(R.id.tvTime); |
| 68 | tvData = itemView.findViewById(R.id.tvData); |
| 69 | } |
| 70 | |
| 71 | private void bindTo(EntityLog log) { |
| 72 | tvTime.setText(TF.format(log.time)); |
| 73 | SpannableStringBuilder ssb = new SpannableStringBuilderEx(log.data); |
| 74 | |
| 75 | Integer color = log.getColor(context); |
| 76 | if (color != null) |
| 77 | ssb.setSpan(new ForegroundColorSpan(color), 0, ssb.length(), 0); |
| 78 | |
| 79 | tvData.setText(ssb); |
| 80 | } |
| 81 | } |
| 82 | |
| 83 | AdapterLog(Fragment parentFragment) { |
| 84 | this.parentFragment = parentFragment; |
nothing calls this directly
no outgoing calls
no test coverage detected