コード例 #1
0
  @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()));
  }
コード例 #2
0
 @Override
 public long getHeaderId(int position) {
   CombinationMessage combinationMessage = getItem(position);
   return DateUtils.toShortDateLong(combinationMessage.getCreatedDate());
 }