|
@ -37,16 +37,16 @@ class UnreadAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, final int position) { |
|
|
public void onBindViewHolder(@NonNull final RecyclerView.ViewHolder holder, final int position) { |
|
|
TopicSummary topicSummary = unreadList.get(holder.getAdapterPosition()); |
|
|
TopicSummary topicSummary = unreadList.get(holder.getBindingAdapterPosition()); |
|
|
final UnreadAdapter.ViewHolder viewHolder = (UnreadAdapter.ViewHolder) holder; |
|
|
final UnreadAdapter.ViewHolder viewHolder = (UnreadAdapter.ViewHolder) holder; |
|
|
|
|
|
|
|
|
viewHolder.mTitleView.setText(topicSummary.getSubject()); |
|
|
viewHolder.mTitleView.setText(topicSummary.getSubject()); |
|
|
if (BaseApplication.getInstance().isDisplayRelativeTimeEnabled()) { |
|
|
if (BaseApplication.getInstance().isDisplayRelativeTimeEnabled()) { |
|
|
String timestamp = topicSummary.getLastPostTimestamp(); |
|
|
String timestamp = topicSummary.getLastPostTimestamp(); |
|
|
try { |
|
|
try { |
|
|
viewHolder.mDateTimeView.setReferenceTime(Long.valueOf(timestamp)); |
|
|
viewHolder.mDateTimeView.setReferenceTime(Long.parseLong(timestamp)); |
|
|
} catch (NumberFormatException e) { |
|
|
} catch (NumberFormatException e) { |
|
|
Timber.e(e, "Invalid number format: %s", timestamp); |
|
|
Timber.e(e, "Invalid number format \"%s\" for %s", timestamp, topicSummary.getTopicUrl()); |
|
|
viewHolder.mDateTimeView.setText(topicSummary.getLastPostSimplifiedDateTime()); |
|
|
viewHolder.mDateTimeView.setText(topicSummary.getLastPostSimplifiedDateTime()); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|