@Override public void onBindHeaderViewHolder(RecyclerView.ViewHolder holder, int position) { View view = holder.itemView; TextView headerTextView = (TextView) view.findViewById(R.id.header_date_textview); CombinationMessage combinationMessage = getItem(position); headerTextView.setText( DateUtils.toTodayYesterdayFullMonthDate(combinationMessage.getCreatedDate())); }
@Override public long getHeaderId(int position) { CombinationMessage combinationMessage = getItem(position); return DateUtils.toShortDateLong(combinationMessage.getCreatedDate()); }