|
|
@ -6,6 +6,8 @@ import android.view.View; |
|
|
|
import android.view.ViewGroup; |
|
|
|
import android.widget.TextView; |
|
|
|
|
|
|
|
import com.github.curioustechizen.ago.RelativeTimeTextView; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import androidx.annotation.NonNull; |
|
|
@ -45,12 +47,10 @@ class RecentAdapter extends RecyclerView.Adapter<RecentAdapter.ViewHolder> { |
|
|
|
public void onBindViewHolder(final ViewHolder holder, final int position) { |
|
|
|
RecentItem recentItem = recentItems.get(position); |
|
|
|
holder.mTitleView.setText(recentItem.getTopicTitle()); |
|
|
|
holder.mDateTimeView.setText(recentItem.getTimestamp().toString()); |
|
|
|
holder.mDateTimeView.setReferenceTime(recentItem.getTimestamp()); |
|
|
|
holder.mUserView.setText(recentItem.getPoster()); |
|
|
|
|
|
|
|
holder.mView.setOnClickListener(new View.OnClickListener() { |
|
|
|
@Override |
|
|
|
public void onClick(View v) { |
|
|
|
holder.mView.setOnClickListener(v -> { |
|
|
|
|
|
|
|
if (null != mListener) { |
|
|
|
// Notify the active callbacks interface (the activity, if the
|
|
|
@ -59,7 +59,6 @@ class RecentAdapter extends RecyclerView.Adapter<RecentAdapter.ViewHolder> { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
@ -72,7 +71,7 @@ class RecentAdapter extends RecyclerView.Adapter<RecentAdapter.ViewHolder> { |
|
|
|
final View mView; |
|
|
|
final TextView mTitleView; |
|
|
|
final TextView mUserView; |
|
|
|
final TextView mDateTimeView; |
|
|
|
final RelativeTimeTextView mDateTimeView; |
|
|
|
|
|
|
|
ViewHolder(View view) { |
|
|
|
super(view); |
|
|
|